From 43f3d0acdc0713de93766608a92b1fd80ed39e21 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:36:57 -0500 Subject: [PATCH 01/52] Run cpplint as part of our CI build This will help ensure a consistent C++ coding style. --- brightray/.gitmodules | 3 +++ brightray/script/cibuild | 1 + brightray/script/cpplint | 36 ++++++++++++++++++++++++++++++ brightray/vendor/google-styleguide | 1 + 4 files changed, 41 insertions(+) create mode 100755 brightray/script/cpplint create mode 160000 brightray/vendor/google-styleguide diff --git a/brightray/.gitmodules b/brightray/.gitmodules index 1e27bc6b5a2..17120b4cdf6 100644 --- a/brightray/.gitmodules +++ b/brightray/.gitmodules @@ -4,3 +4,6 @@ [submodule "vendor/gyp"] path = vendor/gyp url = https://github.com/svn2github/gyp +[submodule "vendor/google-styleguide"] + path = vendor/google-styleguide + url = https://github.com/svn2github/sgss-mirror-google-styleguide diff --git a/brightray/script/cibuild b/brightray/script/cibuild index 318331ffb3b..ab6b8eaeadf 100755 --- a/brightray/script/cibuild +++ b/brightray/script/cibuild @@ -18,6 +18,7 @@ def main(): url = 'https://{0}.s3.amazonaws.com/libchromiumcontent'.format(os.environ['JANKY_ARTIFACTS_S3_BUCKET']) return (run_script('bootstrap', url) or + run_script('cpplint') or run_script('build')) diff --git a/brightray/script/cpplint b/brightray/script/cpplint new file mode 100755 index 00000000000..2b2851f2774 --- /dev/null +++ b/brightray/script/cpplint @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import fnmatch +import os +import subprocess +import sys + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +CPPLINT = os.path.join(SOURCE_ROOT, 'vendor', 'google-styleguide', 'trunk', 'cpplint', 'cpplint.py') + + +def main(): + os.chdir(SOURCE_ROOT) + files = list_files(['browser', 'common'], + ['*.cc', '*.mm', '*.h']) + return cpplint(files) + + +def list_files(directories, filters): + matches = [] + for directory in directories: + for root, _, filenames, in os.walk(directory): + for f in filters: + for filename in fnmatch.filter(filenames, f): + matches.append(os.path.join(root, filename)) + return matches + + +def cpplint(files): + rules = '--filter=-build/header_guard' + return subprocess.call([sys.executable, CPPLINT, rules] + files) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/brightray/vendor/google-styleguide b/brightray/vendor/google-styleguide new file mode 160000 index 00000000000..8025f5495c0 --- /dev/null +++ b/brightray/vendor/google-styleguide @@ -0,0 +1 @@ +Subproject commit 8025f5495c04f1cf9e0d65a0aaa97b58c304faf7 From 101a7bfa21a65bb6c39522bc739cca26fd7a85f8 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:39:01 -0500 Subject: [PATCH 02/52] Fix cpplint errors in browser_client.cc --- brightray/browser/browser_client.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 1c19f622ef0..c407989af49 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -42,18 +42,23 @@ NotificationPresenter* BrowserClient::notification_presenter() { return notification_presenter_.get(); } -BrowserMainParts* BrowserClient::OverrideCreateBrowserMainParts(const content::MainFunctionParams&) { +BrowserMainParts* BrowserClient::OverrideCreateBrowserMainParts( + const content::MainFunctionParams&) { return new BrowserMainParts; } -content::BrowserMainParts* BrowserClient::CreateBrowserMainParts(const content::MainFunctionParams& parameters) { +content::BrowserMainParts* BrowserClient::CreateBrowserMainParts( + const content::MainFunctionParams& parameters) { DCHECK(!browser_main_parts_); browser_main_parts_ = OverrideCreateBrowserMainParts(parameters); return browser_main_parts_; } -net::URLRequestContextGetter* BrowserClient::CreateRequestContext(content::BrowserContext* browser_context, content::ProtocolHandlerMap* protocol_handlers) { - return static_cast(browser_context)->CreateRequestContext(protocol_handlers); +net::URLRequestContextGetter* BrowserClient::CreateRequestContext( + content::BrowserContext* browser_context, + content::ProtocolHandlerMap* protocol_handlers) { + auto context = static_cast(browser_context); + return context->CreateRequestContext(protocol_handlers); } void BrowserClient::ShowDesktopNotification( @@ -74,11 +79,12 @@ void BrowserClient::CancelDesktopNotification( auto presenter = notification_presenter(); if (!presenter) return; - presenter->CancelNotification(render_process_id, render_view_id, notification_id); + presenter->CancelNotification( + render_process_id, render_view_id, notification_id); } content::MediaObserver* BrowserClient::GetMediaObserver() { return MediaCaptureDevicesDispatcher::GetInstance(); } -} +} // namespace brightray From cc4aeb995bd2f5477367e4cddeee2dfc71af5637 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:42:56 -0500 Subject: [PATCH 03/52] Fix cpplint errors in browser_context.cc --- brightray/browser/browser_context.cc | 55 +++++++++++++++++++--------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index e43607a196c..060ba3b427d 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#include "browser_context.h" +#include "browser/browser_context.h" #include "browser/download_manager_delegate.h" #include "browser/inspectable_web_contents_impl.h" #include "browser/network_delegate.h" +#include "browser/url_request_context_getter.h" #include "common/application_info.h" #include "base/environment.h" @@ -19,7 +20,6 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/resource_context.h" #include "content/public/browser/storage_partition.h" -#include "url_request_context_getter.h" #if defined(OS_LINUX) #include "base/nix/xdg_util.h" @@ -28,28 +28,30 @@ namespace brightray { class BrowserContext::ResourceContext : public content::ResourceContext { -public: + public: ResourceContext() : getter_(nullptr) {} void set_url_request_context_getter(URLRequestContextGetter* getter) { getter_ = getter; } -private: + private: virtual net::HostResolver* GetHostResolver() OVERRIDE { return getter_->host_resolver(); } - + virtual net::URLRequestContext* GetRequestContext() OVERRIDE { return getter_->GetURLRequestContext(); } - // FIXME: We should probably allow clients to override this to implement more restrictive policies. + // FIXME: We should probably allow clients to override this to implement more + // restrictive policies. virtual bool AllowMicAccess(const GURL& origin) OVERRIDE { return true; } - - // FIXME: We should probably allow clients to override this to implement more restrictive policies. + + // FIXME: We should probably allow clients to override this to implement more + // restrictive policies. virtual bool AllowCameraAccess(const GURL& origin) OVERRIDE { return true; } @@ -76,7 +78,8 @@ void BrowserContext::Initialize() { auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences")); PrefServiceBuilder builder; builder.WithUserFilePrefs(prefs_path, - JsonPrefStore::GetTaskRunnerForFile(prefs_path, content::BrowserThread::GetBlockingPool())); + JsonPrefStore::GetTaskRunnerForFile( + prefs_path, content::BrowserThread::GetBlockingPool())); auto registry = make_scoped_refptr(new PrefRegistrySimple); RegisterInternalPrefs(registry); @@ -92,12 +95,17 @@ void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) { InspectableWebContentsImpl::RegisterPrefs(registry); } -net::URLRequestContextGetter* BrowserContext::CreateRequestContext(content::ProtocolHandlerMap* protocol_handlers) { +net::URLRequestContextGetter* BrowserContext::CreateRequestContext( + content::ProtocolHandlerMap* protocol_handlers) { DCHECK(!url_request_getter_); + auto io_loop = content::BrowserThread::UnsafeGetMessageLoopForThread( + content::BrowserThread::IO), + auto file_loop = content::BrowserThread::UnsafeGetMessageLoopForThread( + content::BrowserThread::FILE), url_request_getter_ = new URLRequestContextGetter( GetPath(), - content::BrowserThread::UnsafeGetMessageLoopForThread(content::BrowserThread::IO), - content::BrowserThread::UnsafeGetMessageLoopForThread(content::BrowserThread::FILE), + io_loop, + file_loop, CreateNetworkDelegate().Pass(), protocol_handlers); resource_context_->set_url_request_context_getter(url_request_getter_.get()); @@ -120,7 +128,8 @@ net::URLRequestContextGetter* BrowserContext::GetRequestContext() { return GetDefaultStoragePartition(this)->GetURLRequestContext(); } -net::URLRequestContextGetter* BrowserContext::GetRequestContextForRenderProcess(int renderer_child_id) { +net::URLRequestContextGetter* BrowserContext::GetRequestContextForRenderProcess( + int renderer_child_id) { return GetRequestContext(); } @@ -128,15 +137,24 @@ net::URLRequestContextGetter* BrowserContext::GetMediaRequestContext() { return GetRequestContext(); } -net::URLRequestContextGetter* BrowserContext::GetMediaRequestContextForRenderProcess(int renderer_child_id) { +net::URLRequestContextGetter* + BrowserContext::GetMediaRequestContextForRenderProcess( + int renderer_child_id) { return GetRequestContext(); } -net::URLRequestContextGetter* BrowserContext::GetMediaRequestContextForStoragePartition(const base::FilePath& partition_path, bool in_memory) { +net::URLRequestContextGetter* + BrowserContext::GetMediaRequestContextForStoragePartition( + const base::FilePath& partition_path, + bool in_memory) { return GetRequestContext(); } -void BrowserContext::RequestMIDISysExPermission(int render_process_id, int render_view_id, const GURL& requesting_frame, const MIDISysExPermissionCallback& callback) { +void BrowserContext::RequestMIDISysExPermission( + int render_process_id, + int render_view_id, + const GURL& requesting_frame, + const MIDISysExPermissionCallback& callback) { callback.Run(false); } @@ -150,7 +168,8 @@ content::DownloadManagerDelegate* BrowserContext::GetDownloadManagerDelegate() { return download_manager_delegate_.get(); } -content::GeolocationPermissionContext* BrowserContext::GetGeolocationPermissionContext() { +content::GeolocationPermissionContext* + BrowserContext::GetGeolocationPermissionContext() { return nullptr; } @@ -158,4 +177,4 @@ quota::SpecialStoragePolicy* BrowserContext::GetSpecialStoragePolicy() { return nullptr; } -} +} // namespace brightray From a35a57c3c4079289b6b749001863b852c90d9d0f Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:51:19 -0500 Subject: [PATCH 04/52] Fix cpplint errors in browser_main_parts.cc --- brightray/browser/browser_main_parts.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index c41a6a3a6f3..60057034f6e 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -19,8 +19,10 @@ void BrowserMainParts::PreMainMessageLoopRun() { browser_context_.reset(CreateBrowserContext()); browser_context_->Initialize(); - web_ui_controller_factory_.reset(new WebUIControllerFactory(browser_context_.get())); - content::WebUIControllerFactory::RegisterFactory(web_ui_controller_factory_.get()); + web_ui_controller_factory_.reset( + new WebUIControllerFactory(browser_context_.get())); + content::WebUIControllerFactory::RegisterFactory( + web_ui_controller_factory_.get()); } void BrowserMainParts::PostMainMessageLoopRun() { @@ -31,4 +33,4 @@ BrowserContext* BrowserMainParts::CreateBrowserContext() { return new BrowserContext; } -} +} // namespace brightray From 0c13adb134ffcbed1709ba385a50e5532d77e01b Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:51:49 -0500 Subject: [PATCH 05/52] Don't require all files to have a copyright/license header The LICENSE file at the root of the repository is enough. --- brightray/script/cpplint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/script/cpplint b/brightray/script/cpplint index 2b2851f2774..f5911be304b 100755 --- a/brightray/script/cpplint +++ b/brightray/script/cpplint @@ -28,7 +28,7 @@ def list_files(directories, filters): def cpplint(files): - rules = '--filter=-build/header_guard' + rules = '--filter=-build/header_guard,-legal/copyright' return subprocess.call([sys.executable, CPPLINT, rules] + files) From dfb8a809ee44916509ff65fc9dcf6f9bd5681c72 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:52:24 -0500 Subject: [PATCH 06/52] Fix cpplint errors in default_web_contents_delegate.cc --- brightray/browser/default_web_contents_delegate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/browser/default_web_contents_delegate.cc b/brightray/browser/default_web_contents_delegate.cc index f4e08b84098..05bdac399ad 100644 --- a/brightray/browser/default_web_contents_delegate.cc +++ b/brightray/browser/default_web_contents_delegate.cc @@ -18,4 +18,4 @@ void DefaultWebContentsDelegate::RequestMediaAccessPermission( controller.TakeAction(); } -} +} // namespace brightray From ef5992b0eb4b2ee04a72d79280cba68ba34f2bfa Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:53:38 -0500 Subject: [PATCH 07/52] Fix cpplint errors in devtools_ui.cc --- brightray/browser/devtools_ui.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/browser/devtools_ui.cc b/brightray/browser/devtools_ui.cc index 94e581728ab..def3ecb4694 100644 --- a/brightray/browser/devtools_ui.cc +++ b/brightray/browser/devtools_ui.cc @@ -90,12 +90,12 @@ class BundledDataSource : public content::URLDataSource { DISALLOW_COPY_AND_ASSIGN(BundledDataSource); }; -} +} // namespace DevToolsUI::DevToolsUI(BrowserContext* browser_context, content::WebUI* web_ui) - : WebUIController(web_ui) { + : WebUIController(web_ui) { web_ui->SetBindings(0); content::URLDataSource::Add(browser_context, new BundledDataSource()); } -} +} // namespace brightray From c97a22ef8d93442ad15708e7b9b90a2900bbf342 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 17:54:14 -0500 Subject: [PATCH 08/52] Fix cpplint errors in inspectable_web_contents.cc --- brightray/browser/inspectable_web_contents.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/brightray/browser/inspectable_web_contents.cc b/brightray/browser/inspectable_web_contents.cc index 5e3af6013de..5090011a203 100644 --- a/brightray/browser/inspectable_web_contents.cc +++ b/brightray/browser/inspectable_web_contents.cc @@ -6,7 +6,8 @@ namespace brightray { -InspectableWebContents* InspectableWebContents::Create(const content::WebContents::CreateParams& create_params) { +InspectableWebContents* InspectableWebContents::Create( + const content::WebContents::CreateParams& create_params) { auto contents = content::WebContents::Create(create_params); #if defined(OS_MACOSX) // Work around http://crbug.com/279472. @@ -16,8 +17,9 @@ InspectableWebContents* InspectableWebContents::Create(const content::WebContent return Create(contents); } -InspectableWebContents* InspectableWebContents::Create(content::WebContents* web_contents) { +InspectableWebContents* InspectableWebContents::Create( + content::WebContents* web_contents) { return new InspectableWebContentsImpl(web_contents); } -} +} // namespace brightray From 784e270a4f58d27033965034dac973cfde424b06 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:08:34 -0500 Subject: [PATCH 09/52] Fix cpplint errors in inspectable_web_contents_impl.cc --- .../browser/inspectable_web_contents_impl.cc | 77 +++++++++++++------ 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 08d820d4631..b7ac0e74cd3 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -5,6 +5,8 @@ #include "browser/inspectable_web_contents_impl.h" +#include + #include "browser/browser_client.h" #include "browser/browser_context.h" #include "browser/browser_main_parts.h" @@ -31,15 +33,18 @@ const char kDockSidePref[] = "brightray.devtools.dockside"; } // Implemented separately on each platform. -InspectableWebContentsView* CreateInspectableContentsView(InspectableWebContentsImpl*); +InspectableWebContentsView* CreateInspectableContentsView( + InspectableWebContentsImpl* inspectable_web_contents_impl); void InspectableWebContentsImpl::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterStringPref(kDockSidePref, "bottom"); } -InspectableWebContentsImpl::InspectableWebContentsImpl(content::WebContents* web_contents) +InspectableWebContentsImpl::InspectableWebContentsImpl( + content::WebContents* web_contents) : web_contents_(web_contents) { - auto context = static_cast(web_contents_->GetBrowserContext()); + auto context = static_cast( + web_contents_->GetBrowserContext()); dock_side_ = context->prefs()->GetString(kDockSidePref); view_.reset(CreateInspectableContentsView(this)); @@ -58,7 +63,9 @@ content::WebContents* InspectableWebContentsImpl::GetWebContents() const { void InspectableWebContentsImpl::ShowDevTools() { if (!devtools_web_contents_) { - devtools_web_contents_.reset(content::WebContents::Create(content::WebContents::CreateParams(web_contents_->GetBrowserContext()))); + auto create_params = content::WebContents::CreateParams( + web_contents_->GetBrowserContext()); + devtools_web_contents_.reset(content::WebContents::Create(create_params)); #if defined(OS_MACOSX) // Work around http://crbug.com/279472. @@ -68,12 +75,20 @@ void InspectableWebContentsImpl::ShowDevTools() { Observe(devtools_web_contents_.get()); devtools_web_contents_->SetDelegate(this); - agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_->GetRenderViewHost()); - frontend_host_.reset(content::DevToolsClientHost::CreateDevToolsFrontendHost(devtools_web_contents_.get(), this)); - content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(agent_host_, frontend_host_.get()); + agent_host_ = content::DevToolsAgentHost::GetOrCreateFor( + web_contents_->GetRenderViewHost()); + frontend_host_.reset( + content::DevToolsClientHost::CreateDevToolsFrontendHost( + devtools_web_contents_.get(), this)); + content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( + agent_host_, frontend_host_.get()); GURL devtools_url(kChromeUIDevToolsURL); - devtools_web_contents_->GetController().LoadURL(devtools_url, content::Referrer(), content::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); + devtools_web_contents_->GetController().LoadURL( + devtools_url, + content::Referrer(), + content::PAGE_TRANSITION_AUTO_TOPLEVEL, + std::string()); } view_->SetDockSide(dock_side_); @@ -81,8 +96,10 @@ void InspectableWebContentsImpl::ShowDevTools() { } void InspectableWebContentsImpl::UpdateFrontendDockSide() { - auto javascript = base::StringPrintf("InspectorFrontendAPI.setDockSide(\"%s\")", dock_side_.c_str()); - devtools_web_contents_->GetRenderViewHost()->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(javascript)); + auto javascript = base::StringPrintf( + "InspectorFrontendAPI.setDockSide(\"%s\")", dock_side_.c_str()); + devtools_web_contents_->GetRenderViewHost()->ExecuteJavascriptInWebFrame( + string16(), ASCIIToUTF16(javascript)); } void InspectableWebContentsImpl::ActivateWindow() { @@ -106,7 +123,8 @@ void InspectableWebContentsImpl::SetDockSide(const std::string& side) { dock_side_ = side; - auto context = static_cast(web_contents_->GetBrowserContext()); + auto context = static_cast( + web_contents_->GetBrowserContext()); context->prefs()->SetString(kDockSidePref, side); UpdateFrontendDockSide(); @@ -115,10 +133,12 @@ void InspectableWebContentsImpl::SetDockSide(const std::string& side) { void InspectableWebContentsImpl::OpenInNewTab(const std::string& url) { } -void InspectableWebContentsImpl::SaveToFile(const std::string& url, const std::string& content, bool save_as) { +void InspectableWebContentsImpl::SaveToFile( + const std::string& url, const std::string& content, bool save_as) { } -void InspectableWebContentsImpl::AppendToFile(const std::string& url, const std::string& content) { +void InspectableWebContentsImpl::AppendToFile( + const std::string& url, const std::string& content) { } void InspectableWebContentsImpl::RequestFileSystems() { @@ -127,26 +147,36 @@ void InspectableWebContentsImpl::RequestFileSystems() { void InspectableWebContentsImpl::AddFileSystem() { } -void InspectableWebContentsImpl::RemoveFileSystem(const std::string& file_system_path) { +void InspectableWebContentsImpl::RemoveFileSystem( + const std::string& file_system_path) { } -void InspectableWebContentsImpl::IndexPath(int request_id, const std::string& file_system_path) { +void InspectableWebContentsImpl::IndexPath( + int request_id, const std::string& file_system_path) { } void InspectableWebContentsImpl::StopIndexing(int request_id) { } -void InspectableWebContentsImpl::SearchInPath(int request_id, const std::string& file_system_path, const std::string& query) { +void InspectableWebContentsImpl::SearchInPath( + int request_id, + const std::string& file_system_path, + const std::string& query) { } void InspectableWebContentsImpl::InspectedContentsClosing() { } -void InspectableWebContentsImpl::AboutToNavigateRenderView(content::RenderViewHost* render_view_host) { - content::DevToolsClientHost::SetupDevToolsFrontendClient(web_contents()->GetRenderViewHost()); +void InspectableWebContentsImpl::AboutToNavigateRenderView( + content::RenderViewHost* render_view_host) { + content::DevToolsClientHost::SetupDevToolsFrontendClient( + web_contents()->GetRenderViewHost()); } -void InspectableWebContentsImpl::DidFinishLoad(int64, const GURL&, bool is_main_frame, content::RenderViewHost*) { +void InspectableWebContentsImpl::DidFinishLoad(int64 frame_id, + const GURL& validated_url, + bool is_main_frame, + content::RenderViewHost*) { if (!is_main_frame) return; @@ -154,16 +184,19 @@ void InspectableWebContentsImpl::DidFinishLoad(int64, const GURL&, bool is_main_ } void InspectableWebContentsImpl::WebContentsDestroyed(content::WebContents*) { - content::DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); + content::DevToolsManager::GetInstance()->ClientHostClosing( + frontend_host_.get()); Observe(nullptr); agent_host_ = nullptr; frontend_host_.reset(); } -void InspectableWebContentsImpl::HandleKeyboardEvent(content::WebContents* source, const content::NativeWebKeyboardEvent& event) { +void InspectableWebContentsImpl::HandleKeyboardEvent( + content::WebContents* source, + const content::NativeWebKeyboardEvent& event) { auto delegate = web_contents_->GetDelegate(); if (delegate) delegate->HandleKeyboardEvent(source, event); } -} +} // namespace brightray From 843b21a3e81dc1822e6b5c20707d89ac4112c6f0 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:09:21 -0500 Subject: [PATCH 10/52] Fix cpplint errors in network_delegate.cc --- brightray/browser/network_delegate.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index 8213a744edb..57dd6565397 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#include "network_delegate.h" +#include "browser/network_delegate.h" + +#include #include "net/base/net_errors.h" @@ -102,4 +104,4 @@ void NetworkDelegate::OnRequestWaitStateChange( RequestWaitState waiting) { } -} +} // namespace brightray From 57ae05b6360d78df69c1569933c0136d9913d80a Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:11:47 -0500 Subject: [PATCH 11/52] Fix cpplint errors in url_request_context_getter.cc --- .../browser/url_request_context_getter.cc | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 4fe6d3f1b94..ecba106e96b 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -4,7 +4,10 @@ #include "browser/url_request_context_getter.h" -#include "network_delegate.h" +#include + +#include "browser/network_delegate.h" + #include "base/strings/string_util.h" #include "base/threading/worker_pool.h" #include "content/public/browser/browser_thread.h" @@ -43,7 +46,8 @@ URLRequestContextGetter::URLRequestContextGetter( std::swap(protocol_handlers_, *protocol_handlers); - proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService(io_loop_->message_loop_proxy(), file_loop_)); + proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( + io_loop_->message_loop_proxy(), file_loop_)); } URLRequestContextGetter::~URLRequestContextGetter() { @@ -53,8 +57,7 @@ net::HostResolver* URLRequestContextGetter::host_resolver() { return url_request_context_->host_resolver(); } -net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() -{ +net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); if (!url_request_context_.get()) { @@ -87,7 +90,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); storage_->set_http_auth_handler_factory( net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); - scoped_ptr server_properties(new net::HttpServerPropertiesImpl); + scoped_ptr server_properties( + new net::HttpServerPropertiesImpl); storage_->set_http_server_properties(server_properties.Pass()); base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache")); @@ -130,21 +134,25 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() new net::URLRequestJobFactoryImpl()); for (auto it = protocol_handlers_.begin(), end = protocol_handlers_.end(); it != end; ++it) { - bool set_protocol = job_factory->SetProtocolHandler(it->first, it->second.release()); + bool set_protocol = job_factory->SetProtocolHandler( + it->first, it->second.release()); DCHECK(set_protocol); } protocol_handlers_.clear(); - job_factory->SetProtocolHandler(chrome::kDataScheme, new net::DataProtocolHandler); - job_factory->SetProtocolHandler(chrome::kFileScheme, new net::FileProtocolHandler); + job_factory->SetProtocolHandler( + chrome::kDataScheme, new net::DataProtocolHandler); + job_factory->SetProtocolHandler( + chrome::kFileScheme, new net::FileProtocolHandler); storage_->set_job_factory(job_factory.release()); } return url_request_context_.get(); } -scoped_refptr URLRequestContextGetter::GetNetworkTaskRunner() const -{ - return content::BrowserThread::GetMessageLoopProxyForThread(content::BrowserThread::IO); +scoped_refptr + URLRequestContextGetter::GetNetworkTaskRunner() const { + return content::BrowserThread::GetMessageLoopProxyForThread( + content::BrowserThread::IO); } -} +} // namespace brightray From 80dab9d862eb5d493cfb97629c6e4f9554523318 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:12:05 -0500 Subject: [PATCH 12/52] Fix cpplint errors in web_ui_controller_factory.cc --- brightray/browser/web_ui_controller_factory.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/browser/web_ui_controller_factory.cc b/brightray/browser/web_ui_controller_factory.cc index 61f6bf993c5..9a9694de083 100644 --- a/brightray/browser/web_ui_controller_factory.cc +++ b/brightray/browser/web_ui_controller_factory.cc @@ -56,4 +56,4 @@ content::WebUIController* WebUIControllerFactory::CreateWebUIControllerForURL( return NULL; } -} +} // namespace brightray From 74661c342ffc857e5c91ce7ed4fe1e432e15f245 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:13:10 -0500 Subject: [PATCH 13/52] Fix cpplint errors in browser_client.h --- brightray/browser/browser_client.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index f5bc9d618fe..41a3861f61f 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -14,7 +14,7 @@ class BrowserMainParts; class NotificationPresenter; class BrowserClient : public content::ContentBrowserClient { -public: + public: static BrowserClient* Get(); BrowserClient(); @@ -24,17 +24,21 @@ public: BrowserMainParts* browser_main_parts() { return browser_main_parts_; } NotificationPresenter* notification_presenter(); -protected: - // Subclasses should override this to provide their own BrowserMainParts implementation. The - // lifetime of the returned instance is managed by the caller. - virtual BrowserMainParts* OverrideCreateBrowserMainParts(const content::MainFunctionParams&); + protected: + // Subclasses should override this to provide their own BrowserMainParts + // implementation. The lifetime of the returned instance is managed by the + // caller. + virtual BrowserMainParts* OverrideCreateBrowserMainParts( + const content::MainFunctionParams&); - // Subclasses that override this (e.g., to provide their own protocol handlers) should call this - // implementation after doing their own work. - virtual net::URLRequestContextGetter* CreateRequestContext(content::BrowserContext*, content::ProtocolHandlerMap*) OVERRIDE; + // Subclasses that override this (e.g., to provide their own protocol + // handlers) should call this implementation after doing their own work. + virtual net::URLRequestContextGetter* CreateRequestContext( + content::BrowserContext*, content::ProtocolHandlerMap*) OVERRIDE; -private: - virtual content::BrowserMainParts* CreateBrowserMainParts(const content::MainFunctionParams&) OVERRIDE; + private: + virtual content::BrowserMainParts* CreateBrowserMainParts( + const content::MainFunctionParams&) OVERRIDE; virtual void ShowDesktopNotification( const content::ShowDesktopNotificationHostMsgParams&, int render_process_id, @@ -52,6 +56,6 @@ private: DISALLOW_COPY_AND_ASSIGN(BrowserClient); }; -} +} // namespace brightray #endif From 991133b8e9985d83cab389044af472cea71587bf Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:15:10 -0500 Subject: [PATCH 14/52] Fix cpplint errors in browser_context.h --- brightray/browser/browser_context.h | 43 +++++++++++++++++++---------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index f18cfdadced..6356277942e 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -18,41 +18,54 @@ class NetworkDelegate; class URLRequestContextGetter; class BrowserContext : public content::BrowserContext { -public: + public: BrowserContext(); ~BrowserContext(); void Initialize(); - net::URLRequestContextGetter* CreateRequestContext(content::ProtocolHandlerMap*); + net::URLRequestContextGetter* CreateRequestContext( + content::ProtocolHandlerMap*); PrefService* prefs() { return prefs_.get(); } -protected: + protected: // Subclasses should override this to register custom preferences. - virtual void RegisterPrefs(PrefRegistrySimple*) {} + virtual void RegisterPrefs(PrefRegistrySimple* pref_registry) {} - // Subclasses should override this to provide a custom NetworkDelegate implementation. + // Subclasses should override this to provide a custom NetworkDelegate + // implementation. virtual scoped_ptr CreateNetworkDelegate(); virtual base::FilePath GetPath() const OVERRIDE; -private: + private: class ResourceContext; - void RegisterInternalPrefs(PrefRegistrySimple*); + void RegisterInternalPrefs(PrefRegistrySimple* pref_registry); virtual bool IsOffTheRecord() const OVERRIDE; virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; - virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(int renderer_child_id); + virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( + int renderer_child_id); virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; - virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(int renderer_child_id) OVERRIDE; - virtual net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition(const base::FilePath& partition_path, bool in_memory); - virtual void RequestMIDISysExPermission(int render_process_id, int render_view_id, const GURL& requesting_frame, const MIDISysExPermissionCallback&) OVERRIDE; + virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( + int renderer_child_id) OVERRIDE; + virtual net::URLRequestContextGetter* + GetMediaRequestContextForStoragePartition( + const base::FilePath& partition_path, bool in_memory); + virtual void RequestMIDISysExPermission( + int render_process_id, + int render_view_id, + const GURL& requesting_frame, + const MIDISysExPermissionCallback&) OVERRIDE; virtual content::ResourceContext* GetResourceContext() OVERRIDE; - virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE; - virtual content::GeolocationPermissionContext* GetGeolocationPermissionContext() OVERRIDE; - virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; + virtual content::DownloadManagerDelegate* + GetDownloadManagerDelegate() OVERRIDE; + virtual content::GeolocationPermissionContext* + GetGeolocationPermissionContext() OVERRIDE; + virtual quota::SpecialStoragePolicy* + GetSpecialStoragePolicy() OVERRIDE; base::FilePath path_; scoped_ptr resource_context_; @@ -63,6 +76,6 @@ private: DISALLOW_COPY_AND_ASSIGN(BrowserContext); }; -} +} // namespace brightray #endif From 24fbf6e2ef71e1596eff66be41a8f8960b5dee5f Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:15:45 -0500 Subject: [PATCH 15/52] Build before running cpplint Let's make sure things build before we check coding style. If it doesn't even build, who cares about the style? --- brightray/script/cibuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray/script/cibuild b/brightray/script/cibuild index ab6b8eaeadf..bfe1ec92b80 100755 --- a/brightray/script/cibuild +++ b/brightray/script/cibuild @@ -18,8 +18,8 @@ def main(): url = 'https://{0}.s3.amazonaws.com/libchromiumcontent'.format(os.environ['JANKY_ARTIFACTS_S3_BUCKET']) return (run_script('bootstrap', url) or - run_script('cpplint') or - run_script('build')) + run_script('build') or + run_script('cpplint')) def copy_to_environment(credentials_file): From a6ecd039e25f9d0b2b8bc49fb4d882ac67c4bec9 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:16:41 -0500 Subject: [PATCH 16/52] Fix typos --- brightray/browser/browser_context.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 060ba3b427d..20b70470552 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -99,9 +99,9 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers) { DCHECK(!url_request_getter_); auto io_loop = content::BrowserThread::UnsafeGetMessageLoopForThread( - content::BrowserThread::IO), + content::BrowserThread::IO); auto file_loop = content::BrowserThread::UnsafeGetMessageLoopForThread( - content::BrowserThread::FILE), + content::BrowserThread::FILE); url_request_getter_ = new URLRequestContextGetter( GetPath(), io_loop, From 7bada7851945cf82776d022b4d75463318208046 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:17:23 -0500 Subject: [PATCH 17/52] Fix cpplint errors in browser_main_parts.h --- brightray/browser/browser_main_parts.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/brightray/browser/browser_main_parts.h b/brightray/browser/browser_main_parts.h index 210ff7e31ba..f0aeb427796 100644 --- a/brightray/browser/browser_main_parts.h +++ b/brightray/browser/browser_main_parts.h @@ -15,15 +15,15 @@ class BrowserContext; class WebUIControllerFactory; class BrowserMainParts : public content::BrowserMainParts { -public: + public: BrowserMainParts(); ~BrowserMainParts(); BrowserContext* browser_context() { return browser_context_.get(); } -protected: - // Subclasses should override this to provide their own BrowserContxt implementation. The caller - // takes ownership of the returned object. + protected: + // Subclasses should override this to provide their own BrowserContxt + // implementation. The caller takes ownership of the returned object. virtual BrowserContext* CreateBrowserContext(); #if defined(OS_MACOSX) @@ -33,13 +33,13 @@ protected: virtual void PreMainMessageLoopRun() OVERRIDE; virtual void PostMainMessageLoopRun() OVERRIDE; -private: + private: scoped_ptr browser_context_; scoped_ptr web_ui_controller_factory_; DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); }; -} +} // namespace brightray #endif From fd54c435a9d52d7c1280a0dcef78497e14f86cf2 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:18:22 -0500 Subject: [PATCH 18/52] Fix cpplint errors in default_web_contents_delegate.h --- .../browser/default_web_contents_delegate.h | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/brightray/browser/default_web_contents_delegate.h b/brightray/browser/default_web_contents_delegate.h index b4dabdd03b8..5b16b10f653 100644 --- a/brightray/browser/default_web_contents_delegate.h +++ b/brightray/browser/default_web_contents_delegate.h @@ -5,22 +5,24 @@ namespace brightray { -// This class provides some sane default behaviors to any content::WebContents instance (e.g., -// keyboard shortcut handling on Mac). +// This class provides some sane default behaviors to any content::WebContents +// instance (e.g., keyboard shortcut handling on Mac). class DefaultWebContentsDelegate : public content::WebContentsDelegate { -public: + public: DefaultWebContentsDelegate(); ~DefaultWebContentsDelegate(); -protected: - virtual void RequestMediaAccessPermission(content::WebContents*, - const content::MediaStreamRequest&, - const content::MediaResponseCallback&) OVERRIDE; + protected: + virtual void RequestMediaAccessPermission( + content::WebContents*, + const content::MediaStreamRequest&, + const content::MediaResponseCallback&) OVERRIDE; #if defined(OS_MACOSX) - virtual void HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent&) OVERRIDE; + virtual void HandleKeyboardEvent( + content::WebContents*, const content::NativeWebKeyboardEvent&) OVERRIDE; #endif }; -} +} // namespace brightray #endif From 9ac1a539ee78e7ad6ef49cc9cb086d564af59043 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:20:17 -0500 Subject: [PATCH 19/52] Fix all remaining readability/namespace errors --- brightray/browser/devtools_ui.h | 2 +- brightray/browser/download_manager_delegate.h | 2 +- brightray/browser/inspectable_web_contents.h | 2 +- brightray/browser/inspectable_web_contents_impl.h | 2 +- brightray/browser/inspectable_web_contents_view.h | 2 +- brightray/browser/inspectable_web_contents_view_mac.h | 2 +- brightray/browser/linux/inspectable_web_contents_view_linux.cc | 2 +- brightray/browser/linux/inspectable_web_contents_view_linux.h | 2 +- brightray/browser/network_delegate.h | 2 +- brightray/browser/notification_presenter.h | 2 +- brightray/browser/notification_presenter_mac.h | 2 +- brightray/browser/url_request_context_getter.h | 2 +- brightray/browser/web_ui_controller_factory.h | 2 +- brightray/browser/win/devtools_window.cc | 2 +- brightray/browser/win/devtools_window.h | 2 +- brightray/browser/win/inspectable_web_contents_view_win.cc | 2 +- brightray/browser/win/inspectable_web_contents_view_win.h | 2 +- brightray/common/application_info_win.cc | 2 +- brightray/common/content_client.cc | 2 +- brightray/common/content_client.h | 2 +- brightray/common/main_delegate.cc | 2 +- brightray/common/main_delegate.h | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/brightray/browser/devtools_ui.h b/brightray/browser/devtools_ui.h index 70ab0f2686d..1f5ff4f7217 100644 --- a/brightray/browser/devtools_ui.h +++ b/brightray/browser/devtools_ui.h @@ -20,6 +20,6 @@ class DevToolsUI : public content::WebUIController { DISALLOW_COPY_AND_ASSIGN(DevToolsUI); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/download_manager_delegate.h b/brightray/browser/download_manager_delegate.h index c25d2e7a16a..95ac7d5a817 100644 --- a/brightray/browser/download_manager_delegate.h +++ b/brightray/browser/download_manager_delegate.h @@ -14,6 +14,6 @@ class DownloadManagerDelegate : public content::DownloadManagerDelegate { DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/inspectable_web_contents.h b/brightray/browser/inspectable_web_contents.h index 0a585146866..d539a53b9a0 100644 --- a/brightray/browser/inspectable_web_contents.h +++ b/brightray/browser/inspectable_web_contents.h @@ -22,6 +22,6 @@ public: virtual void ShowDevTools() = 0; }; -} +} // namespace brightray #endif diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index f81ccc0185a..3fd83d1651f 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -90,6 +90,6 @@ private: DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsImpl); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/inspectable_web_contents_view.h b/brightray/browser/inspectable_web_contents_view.h index 3964cc682c0..ac731ac9b0d 100644 --- a/brightray/browser/inspectable_web_contents_view.h +++ b/brightray/browser/inspectable_web_contents_view.h @@ -16,6 +16,6 @@ public: virtual bool SetDockSide(const std::string& side) = 0; }; -} +} // namespace brightray #endif diff --git a/brightray/browser/inspectable_web_contents_view_mac.h b/brightray/browser/inspectable_web_contents_view_mac.h index 1b5a6e43322..3ac76b3bee2 100644 --- a/brightray/browser/inspectable_web_contents_view_mac.h +++ b/brightray/browser/inspectable_web_contents_view_mac.h @@ -31,6 +31,6 @@ private: DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewMac); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.cc b/brightray/browser/linux/inspectable_web_contents_view_linux.cc index eb792aa69d8..f48c77bba7e 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.cc +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.cc @@ -234,4 +234,4 @@ GtkWidget *InspectableWebContentsViewLinux::GetBrowserWindow() { return browser; } -} +} // namespace brightray diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.h b/brightray/browser/linux/inspectable_web_contents_view_linux.h index f82de0a54cd..94dfa97a1ad 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.h +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.h @@ -49,6 +49,6 @@ private: DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewLinux); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/network_delegate.h b/brightray/browser/network_delegate.h index aff8e228856..91c2379dad5 100644 --- a/brightray/browser/network_delegate.h +++ b/brightray/browser/network_delegate.h @@ -37,6 +37,6 @@ class NetworkDelegate : public net::NetworkDelegate { DISALLOW_COPY_AND_ASSIGN(NetworkDelegate); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/notification_presenter.h b/brightray/browser/notification_presenter.h index a106edab208..3f238b2b867 100644 --- a/brightray/browser/notification_presenter.h +++ b/brightray/browser/notification_presenter.h @@ -23,6 +23,6 @@ class NotificationPresenter { int notification_id) = 0; }; -} +} // namespace brightray #endif diff --git a/brightray/browser/notification_presenter_mac.h b/brightray/browser/notification_presenter_mac.h index b3757bf56ea..b2a9e59fca4 100644 --- a/brightray/browser/notification_presenter_mac.h +++ b/brightray/browser/notification_presenter_mac.h @@ -34,6 +34,6 @@ class NotificationPresenterMac : public NotificationPresenter { base::scoped_nsobject delegate_; }; -} +} // namespace brightray #endif diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index 7d4efb6c00d..fa7f0952cdb 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -53,6 +53,6 @@ private: DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/web_ui_controller_factory.h b/brightray/browser/web_ui_controller_factory.h index 1ee3f9b2dfd..4a451389538 100644 --- a/brightray/browser/web_ui_controller_factory.h +++ b/brightray/browser/web_ui_controller_factory.h @@ -37,6 +37,6 @@ class WebUIControllerFactory : public content::WebUIControllerFactory { DISALLOW_COPY_AND_ASSIGN(WebUIControllerFactory); }; -} +} // namespace brightray #endif diff --git a/brightray/browser/win/devtools_window.cc b/brightray/browser/win/devtools_window.cc index 8bed3e89f7d..442bffa13cc 100644 --- a/brightray/browser/win/devtools_window.cc +++ b/brightray/browser/win/devtools_window.cc @@ -44,4 +44,4 @@ LRESULT DevToolsWindow::OnSize(UINT, WPARAM, LPARAM, BOOL&) { return 0; } -} +} // namespace brightray diff --git a/brightray/browser/win/devtools_window.h b/brightray/browser/win/devtools_window.h index 7181ab8e4d3..40f2d5afdb2 100644 --- a/brightray/browser/win/devtools_window.h +++ b/brightray/browser/win/devtools_window.h @@ -31,6 +31,6 @@ class DevToolsWindow : public ui::WindowImpl, public base::SupportsWeakPtrproduct_version()); } -} +} // namespace brightray diff --git a/brightray/common/content_client.cc b/brightray/common/content_client.cc index a518cc026ca..4f45ba7cd4b 100644 --- a/brightray/common/content_client.cc +++ b/brightray/common/content_client.cc @@ -37,4 +37,4 @@ gfx::Image& ContentClient::GetNativeImageNamed(int resource_id) const { return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); } -} +} // namespace brightray diff --git a/brightray/common/content_client.h b/brightray/common/content_client.h index 8a93771018e..e8bc579d7b4 100644 --- a/brightray/common/content_client.h +++ b/brightray/common/content_client.h @@ -24,6 +24,6 @@ private: DISALLOW_COPY_AND_ASSIGN(ContentClient); }; -} +} // namespace brightray #endif diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index b58b2e9d72f..cfa4cd67599 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -57,4 +57,4 @@ void MainDelegate::InitializeResourceBundle() { ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(*it, ui::SCALE_FACTOR_NONE); } -} +} // namespace brightray diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index ba99f5155f0..d9e9e17c2e4 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -47,5 +47,5 @@ private: DISALLOW_COPY_AND_ASSIGN(MainDelegate); }; -} +} // namespace brightray #endif From 0805b414e99ac134e1d50b792868b05ce22c601e Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:20:54 -0500 Subject: [PATCH 20/52] Fix cpplint errors in inspectable_web_contents.h --- brightray/browser/inspectable_web_contents.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/brightray/browser/inspectable_web_contents.h b/brightray/browser/inspectable_web_contents.h index d539a53b9a0..9c381ae7403 100644 --- a/brightray/browser/inspectable_web_contents.h +++ b/brightray/browser/inspectable_web_contents.h @@ -8,10 +8,12 @@ namespace brightray { class InspectableWebContentsView; class InspectableWebContents { -public: - static InspectableWebContents* Create(const content::WebContents::CreateParams&); + public: + static InspectableWebContents* Create( + const content::WebContents::CreateParams&); - // The returned InspectableWebContents takes ownership of the passed-in WebContents. + // The returned InspectableWebContents takes ownership of the passed-in + // WebContents. static InspectableWebContents* Create(content::WebContents*); virtual ~InspectableWebContents() {} From 877a1f03712efc4de4933aeec66bbb70a7414b15 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:22:48 -0500 Subject: [PATCH 21/52] Fix cpplint errors in inspectable_web_contents_impl.h --- .../browser/inspectable_web_contents_impl.h | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 3fd83d1651f..6aab5bab3ea 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -8,6 +8,8 @@ #include "browser/inspectable_web_contents.h" +#include + #include "content/public/browser/devtools_frontend_host_delegate.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" @@ -28,10 +30,10 @@ class InspectableWebContentsImpl : content::DevToolsFrontendHostDelegate, content::WebContentsObserver, content::WebContentsDelegate { -public: - static void RegisterPrefs(PrefRegistrySimple*); + public: + static void RegisterPrefs(PrefRegistrySimple* pref_registry); - InspectableWebContentsImpl(content::WebContents*); + explicit InspectableWebContentsImpl(content::WebContents*); virtual ~InspectableWebContentsImpl(); virtual InspectableWebContentsView* GetView() const OVERRIDE; @@ -39,13 +41,15 @@ public: virtual void ShowDevTools() OVERRIDE; - content::WebContents* devtools_web_contents() { return devtools_web_contents_.get(); } + content::WebContents* devtools_web_contents() { + return devtools_web_contents_.get(); + } -private: + private: void UpdateFrontendDockSide(); // content::DevToolsFrontendHostDelegate - + virtual void ActivateWindow() OVERRIDE; virtual void ChangeAttachedWindowHeight(unsigned height) OVERRIDE; virtual void CloseWindow() OVERRIDE; @@ -60,16 +64,18 @@ private: virtual void RequestFileSystems() OVERRIDE; virtual void AddFileSystem() OVERRIDE; virtual void RemoveFileSystem(const std::string& file_system_path) OVERRIDE; - virtual void IndexPath(int request_id, const std::string& file_system_path) OVERRIDE; + virtual void IndexPath(int request_id, + const std::string& file_system_path) OVERRIDE; virtual void StopIndexing(int request_id) OVERRIDE; virtual void SearchInPath(int request_id, const std::string& file_system_path, const std::string& query) OVERRIDE; virtual void InspectedContentsClosing() OVERRIDE; - + // content::WebContentsObserver - - virtual void AboutToNavigateRenderView(content::RenderViewHost* render_view_host) OVERRIDE; + + virtual void AboutToNavigateRenderView( + content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidFinishLoad(int64 frame_id, const GURL& validated_url, bool is_main_frame, @@ -77,9 +83,10 @@ private: virtual void WebContentsDestroyed(content::WebContents*) OVERRIDE; // content::WebContentsDelegate - - virtual void HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent&) OVERRIDE; - + + virtual void HandleKeyboardEvent( + content::WebContents*, const content::NativeWebKeyboardEvent&) OVERRIDE; + scoped_ptr web_contents_; scoped_ptr frontend_host_; scoped_ptr devtools_web_contents_; From ea689b31a4c558736d8a44ab2b6b380d660041dd Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:23:13 -0500 Subject: [PATCH 22/52] Fix cpplint errors in inspectable_web_contents_view.h --- brightray/browser/inspectable_web_contents_view.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brightray/browser/inspectable_web_contents_view.h b/brightray/browser/inspectable_web_contents_view.h index ac731ac9b0d..daa332d1c5e 100644 --- a/brightray/browser/inspectable_web_contents_view.h +++ b/brightray/browser/inspectable_web_contents_view.h @@ -1,12 +1,14 @@ #ifndef BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_VIEW_H_ #define BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_VIEW_H_ +#include + #include "ui/gfx/native_widget_types.h" namespace brightray { class InspectableWebContentsView { -public: + public: virtual ~InspectableWebContentsView() {} virtual gfx::NativeView GetNativeView() const = 0; From cb684c5c6eaf1c9ab2bfd4ada0859f1cc1f01ffa Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:24:36 -0500 Subject: [PATCH 23/52] Fix cpplint errors in inspectable_web_contents_view_mac.h --- .../inspectable_web_contents_view_mac.h | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_view_mac.h b/brightray/browser/inspectable_web_contents_view_mac.h index 3ac76b3bee2..839b56a744f 100644 --- a/brightray/browser/inspectable_web_contents_view_mac.h +++ b/brightray/browser/inspectable_web_contents_view_mac.h @@ -1,9 +1,11 @@ #ifndef BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_VIEW_MAC_H_ #define BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_VIEW_MAC_H_ -#import "browser/inspectable_web_contents_view.h" +#include "browser/inspectable_web_contents_view.h" -#import "base/mac/scoped_nsobject.h" +#include + +#include "base/mac/scoped_nsobject.h" @class BRYInspectableWebContentsView; @@ -12,20 +14,23 @@ namespace brightray { class InspectableWebContentsImpl; class InspectableWebContentsViewMac : public InspectableWebContentsView { -public: - InspectableWebContentsViewMac(InspectableWebContentsImpl*); - + public: + explicit InspectableWebContentsViewMac( + InspectableWebContentsImpl* inspectable_web_contents_impl); + virtual gfx::NativeView GetNativeView() const OVERRIDE; virtual void ShowDevTools() OVERRIDE; virtual void CloseDevTools() OVERRIDE; virtual bool SetDockSide(const std::string& side) OVERRIDE; - InspectableWebContentsImpl* inspectable_web_contents() { return inspectable_web_contents_; } + InspectableWebContentsImpl* inspectable_web_contents() { + return inspectable_web_contents_; + } -private: + private: // Owns us. InspectableWebContentsImpl* inspectable_web_contents_; - + base::scoped_nsobject view_; DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewMac); From ec59df1a516d58f4b59686c7eb049364e9aff014 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:36:34 -0500 Subject: [PATCH 24/52] Fix cpplint errors in network_delegate.h --- brightray/browser/network_delegate.h | 55 +++++++++++++++++++++------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/brightray/browser/network_delegate.h b/brightray/browser/network_delegate.h index 91c2379dad5..d257fdbf4c9 100644 --- a/brightray/browser/network_delegate.h +++ b/brightray/browser/network_delegate.h @@ -7,6 +7,8 @@ #include "net/base/network_delegate.h" +#include + namespace brightray { class NetworkDelegate : public net::NetworkDelegate { @@ -15,23 +17,48 @@ class NetworkDelegate : public net::NetworkDelegate { virtual ~NetworkDelegate(); protected: - virtual int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, GURL* new_url) OVERRIDE; - virtual int OnBeforeSendHeaders(net::URLRequest* request, const net::CompletionCallback& callback, net::HttpRequestHeaders* headers) OVERRIDE; - virtual void OnSendHeaders(net::URLRequest* request, const net::HttpRequestHeaders& headers) OVERRIDE; - virtual int OnHeadersReceived(net::URLRequest* request, const net::CompletionCallback& callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers) OVERRIDE; - virtual void OnBeforeRedirect(net::URLRequest* request, const GURL& new_location) OVERRIDE; + virtual int OnBeforeURLRequest(net::URLRequest* request, + const net::CompletionCallback& callback, + GURL* new_url) OVERRIDE; + virtual int OnBeforeSendHeaders(net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpRequestHeaders* headers) OVERRIDE; + virtual void OnSendHeaders(net::URLRequest* request, + const net::HttpRequestHeaders& headers) OVERRIDE; + virtual int OnHeadersReceived( + net::URLRequest* request, + const net::CompletionCallback& callback, + const net::HttpResponseHeaders* original_response_headers, + scoped_refptr* + override_response_headers) OVERRIDE; + virtual void OnBeforeRedirect(net::URLRequest* request, + const GURL& new_location) OVERRIDE; virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; - virtual void OnRawBytesRead(const net::URLRequest& request, int bytes_read) OVERRIDE; + virtual void OnRawBytesRead(const net::URLRequest& request, + int bytes_read) OVERRIDE; virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; - virtual void OnPACScriptError(int line_number, const string16& error) OVERRIDE; - virtual AuthRequiredResponse OnAuthRequired(net::URLRequest* request, const net::AuthChallengeInfo& auth_info, const AuthCallback& callback, net::AuthCredentials* credentials) OVERRIDE; - virtual bool OnCanGetCookies(const net::URLRequest& request, const net::CookieList& cookie_list) OVERRIDE; - virtual bool OnCanSetCookie(const net::URLRequest& request, const std::string& cookie_line, net::CookieOptions* options) OVERRIDE; - virtual bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& path) const OVERRIDE; - virtual bool OnCanThrottleRequest(const net::URLRequest& request) const OVERRIDE; - virtual int OnBeforeSocketStreamConnect(net::SocketStream* stream, const net::CompletionCallback& callback) OVERRIDE; - virtual void OnRequestWaitStateChange(const net::URLRequest& request, RequestWaitState state) OVERRIDE; + virtual void OnPACScriptError(int line_number, + const string16& error) OVERRIDE; + virtual AuthRequiredResponse OnAuthRequired( + net::URLRequest* request, + const net::AuthChallengeInfo& auth_info, + const AuthCallback& callback, + net::AuthCredentials* credentials) OVERRIDE; + virtual bool OnCanGetCookies(const net::URLRequest& request, + const net::CookieList& cookie_list) OVERRIDE; + virtual bool OnCanSetCookie(const net::URLRequest& request, + const std::string& cookie_line, + net::CookieOptions* options) OVERRIDE; + virtual bool OnCanAccessFile(const net::URLRequest& request, + const base::FilePath& path) const OVERRIDE; + virtual bool OnCanThrottleRequest( + const net::URLRequest& request) const OVERRIDE; + virtual int OnBeforeSocketStreamConnect( + net::SocketStream* stream, + const net::CompletionCallback& callback) OVERRIDE; + virtual void OnRequestWaitStateChange(const net::URLRequest& request, + RequestWaitState state) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(NetworkDelegate); From d4ad45334fbbc1db8bd1780848c2176fa928d30d Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:42:15 -0500 Subject: [PATCH 25/52] Turn off build/include_what_you_use Chromium doesn't seem to use this rule. --- brightray/browser/inspectable_web_contents_impl.cc | 2 -- brightray/browser/inspectable_web_contents_impl.h | 2 -- brightray/browser/inspectable_web_contents_view.h | 2 -- brightray/browser/inspectable_web_contents_view_mac.h | 2 -- brightray/browser/network_delegate.cc | 2 -- brightray/browser/network_delegate.h | 2 -- brightray/browser/notification_presenter.h | 2 +- brightray/script/cpplint | 2 +- 8 files changed, 2 insertions(+), 14 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index b7ac0e74cd3..5f561953218 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -5,8 +5,6 @@ #include "browser/inspectable_web_contents_impl.h" -#include - #include "browser/browser_client.h" #include "browser/browser_context.h" #include "browser/browser_main_parts.h" diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 6aab5bab3ea..50592fd3fc5 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -8,8 +8,6 @@ #include "browser/inspectable_web_contents.h" -#include - #include "content/public/browser/devtools_frontend_host_delegate.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" diff --git a/brightray/browser/inspectable_web_contents_view.h b/brightray/browser/inspectable_web_contents_view.h index daa332d1c5e..eed32f34919 100644 --- a/brightray/browser/inspectable_web_contents_view.h +++ b/brightray/browser/inspectable_web_contents_view.h @@ -1,8 +1,6 @@ #ifndef BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_VIEW_H_ #define BRIGHTRAY_BROWSER_INSPECTABLE_WEB_CONTENTS_VIEW_H_ -#include - #include "ui/gfx/native_widget_types.h" namespace brightray { diff --git a/brightray/browser/inspectable_web_contents_view_mac.h b/brightray/browser/inspectable_web_contents_view_mac.h index 839b56a744f..f31149f570b 100644 --- a/brightray/browser/inspectable_web_contents_view_mac.h +++ b/brightray/browser/inspectable_web_contents_view_mac.h @@ -3,8 +3,6 @@ #include "browser/inspectable_web_contents_view.h" -#include - #include "base/mac/scoped_nsobject.h" @class BRYInspectableWebContentsView; diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index 57dd6565397..6467dc3e3d6 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -4,8 +4,6 @@ #include "browser/network_delegate.h" -#include - #include "net/base/net_errors.h" namespace brightray { diff --git a/brightray/browser/network_delegate.h b/brightray/browser/network_delegate.h index d257fdbf4c9..0d4f2d3600c 100644 --- a/brightray/browser/network_delegate.h +++ b/brightray/browser/network_delegate.h @@ -7,8 +7,6 @@ #include "net/base/network_delegate.h" -#include - namespace brightray { class NetworkDelegate : public net::NetworkDelegate { diff --git a/brightray/browser/notification_presenter.h b/brightray/browser/notification_presenter.h index 3f238b2b867..db925f5e927 100644 --- a/brightray/browser/notification_presenter.h +++ b/brightray/browser/notification_presenter.h @@ -9,7 +9,7 @@ namespace brightray { class NotificationPresenter { public: - virtual ~NotificationPresenter() {}; + virtual ~NotificationPresenter() {} static NotificationPresenter* Create(); diff --git a/brightray/script/cpplint b/brightray/script/cpplint index f5911be304b..051370dac17 100755 --- a/brightray/script/cpplint +++ b/brightray/script/cpplint @@ -28,7 +28,7 @@ def list_files(directories, filters): def cpplint(files): - rules = '--filter=-build/header_guard,-legal/copyright' + rules = '--filter=-build/header_guard,-build/include_what_you_use,-legal/copyright' return subprocess.call([sys.executable, CPPLINT, rules] + files) From cf4d966958d8154f2da3d53792ce5c27cf9d40dc Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:43:20 -0500 Subject: [PATCH 26/52] Fix cpplint errors in notification_presenter_mac.h --- brightray/browser/notification_presenter_mac.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brightray/browser/notification_presenter_mac.h b/brightray/browser/notification_presenter_mac.h index b2a9e59fca4..fef6bde3f27 100644 --- a/brightray/browser/notification_presenter_mac.h +++ b/brightray/browser/notification_presenter_mac.h @@ -30,7 +30,9 @@ class NotificationPresenterMac : public NotificationPresenter { int notification_id) OVERRIDE; private: - std::map> notification_map_; + typedef NotificationMap std::map>; + NotificationMap notification_map_; base::scoped_nsobject delegate_; }; From 7a362b741308b39ce7c7a424e891389538e4b937 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:43:46 -0500 Subject: [PATCH 27/52] Fix cpplint errors in url_request_context_getter.h --- brightray/browser/url_request_context_getter.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index fa7f0952cdb..c9700250aad 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -25,7 +25,7 @@ namespace brightray { class NetworkDelegate; class URLRequestContextGetter : public net::URLRequestContextGetter { -public: + public: URLRequestContextGetter( const base::FilePath& base_path, base::MessageLoop* io_loop, @@ -37,8 +37,9 @@ public: net::HostResolver* host_resolver(); virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; -private: - virtual scoped_refptr GetNetworkTaskRunner() const OVERRIDE; + private: + virtual scoped_refptr + GetNetworkTaskRunner() const OVERRIDE; base::FilePath base_path_; base::MessageLoop* io_loop_; From 9f82d5876167410b200b18f1a6a3e225f6273792 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:46:23 -0500 Subject: [PATCH 28/52] Fix cpplint errors in web_ui_controller_factory.h --- brightray/browser/web_ui_controller_factory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/browser/web_ui_controller_factory.h b/brightray/browser/web_ui_controller_factory.h index 4a451389538..74db390746d 100644 --- a/brightray/browser/web_ui_controller_factory.h +++ b/brightray/browser/web_ui_controller_factory.h @@ -15,11 +15,11 @@ class BrowserContext; class WebUIControllerFactory : public content::WebUIControllerFactory { public: - WebUIControllerFactory(BrowserContext* browser_context); + explicit WebUIControllerFactory(BrowserContext* browser_context); virtual ~WebUIControllerFactory(); - virtual content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context, - const GURL& url) const OVERRIDE; + virtual content::WebUI::TypeID GetWebUIType( + content::BrowserContext* browser_context, const GURL& url) const OVERRIDE; virtual bool UseWebUIForURL(content::BrowserContext* browser_context, const GURL& url) const OVERRIDE; virtual bool UseWebUIBindingsForURL(content::BrowserContext* browser_context, From 23bcf4099f2c7de64b35e182a09934402e6e559d Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:52:02 -0500 Subject: [PATCH 29/52] Fix cpplint errors in inspectable_web_contents_view_linux.h --- .../linux/inspectable_web_contents_view_linux.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.h b/brightray/browser/linux/inspectable_web_contents_view_linux.h index 94dfa97a1ad..c6605b3939f 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.h +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.h @@ -10,8 +10,9 @@ namespace brightray { class InspectableWebContentsImpl; class InspectableWebContentsViewLinux : public InspectableWebContentsView { -public: - InspectableWebContentsViewLinux(InspectableWebContentsImpl*); + public: + explicit InspectableWebContentsViewLinux( + InspectableWebContentsImpl* inspectable_web_contents_impl); ~InspectableWebContentsViewLinux(); virtual gfx::NativeView GetNativeView() const OVERRIDE; @@ -19,9 +20,11 @@ public: virtual void CloseDevTools() OVERRIDE; virtual bool SetDockSide(const std::string& side) OVERRIDE; - InspectableWebContentsImpl* inspectable_web_contents() { return inspectable_web_contents_; } + InspectableWebContentsImpl* inspectable_web_contents() { + return inspectable_web_contents_; + } -private: + private: // Show the dev tools in their own window. If they're already shown // somewhere else, remove them cleanly and take any GtkPaned out of the // window. From e5e3dc6a786314c4e292dccb482e4d520f25d08d Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:53:16 -0500 Subject: [PATCH 30/52] Ignore .mm files for cpplint It doesn't process them anyway. --- brightray/script/cpplint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/script/cpplint b/brightray/script/cpplint index 051370dac17..d6e5ebcf9f2 100755 --- a/brightray/script/cpplint +++ b/brightray/script/cpplint @@ -13,7 +13,7 @@ CPPLINT = os.path.join(SOURCE_ROOT, 'vendor', 'google-styleguide', 'trunk', 'cpp def main(): os.chdir(SOURCE_ROOT) files = list_files(['browser', 'common'], - ['*.cc', '*.mm', '*.h']) + ['*.cc', '*.h']) return cpplint(files) From 236efa8be563aaaa53e99d990acc9a8e66541851 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:53:34 -0500 Subject: [PATCH 31/52] Fix cpplint errors in bry_application.h --- brightray/browser/mac/bry_application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/browser/mac/bry_application.h b/brightray/browser/mac/bry_application.h index f64d5db4e36..98594861496 100644 --- a/brightray/browser/mac/bry_application.h +++ b/brightray/browser/mac/bry_application.h @@ -1,6 +1,6 @@ #import "base/mac/scoped_sending_event.h" -@interface BRYApplication : NSApplication { +@interface BRYApplication : NSApplication { BOOL _handlingSendEvent; } From 84ae61744d05840e147931697e05bbe8fd276b97 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:55:06 -0500 Subject: [PATCH 32/52] Ignore cpplint errors in bry_inspectable_web_contents_view_private.h It's not a C++ header. --- brightray/script/cpplint | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/brightray/script/cpplint b/brightray/script/cpplint index d6e5ebcf9f2..089b210c2fe 100755 --- a/brightray/script/cpplint +++ b/brightray/script/cpplint @@ -9,12 +9,16 @@ import sys SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) CPPLINT = os.path.join(SOURCE_ROOT, 'vendor', 'google-styleguide', 'trunk', 'cpplint', 'cpplint.py') +IGNORED_FILES = [ + 'browser/mac/bry_inspectable_web_contents_view_private.h', +] + def main(): os.chdir(SOURCE_ROOT) files = list_files(['browser', 'common'], ['*.cc', '*.h']) - return cpplint(files) + return cpplint(set(files) - set(IGNORED_FILES)) def list_files(directories, filters): @@ -29,7 +33,7 @@ def list_files(directories, filters): def cpplint(files): rules = '--filter=-build/header_guard,-build/include_what_you_use,-legal/copyright' - return subprocess.call([sys.executable, CPPLINT, rules] + files) + return subprocess.call([sys.executable, CPPLINT, rules] + list(files)) if __name__ == '__main__': From 6aec3006e6652b1a975f000b4311a0cb505a5fdb Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:56:07 -0500 Subject: [PATCH 33/52] Fix whitespace/comment errors --- brightray/browser/media/media_capture_devices_dispatcher.cc | 2 +- brightray/browser/media/media_capture_devices_dispatcher.h | 2 +- brightray/browser/media/media_stream_devices_controller.cc | 2 +- brightray/browser/media/media_stream_devices_controller.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/brightray/browser/media/media_capture_devices_dispatcher.cc b/brightray/browser/media/media_capture_devices_dispatcher.cc index 1c3f9430050..a6b584e9c58 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.cc +++ b/brightray/browser/media/media_capture_devices_dispatcher.cc @@ -181,4 +181,4 @@ void MediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread( video_devices_ = devices; } -} // namespace brightray +} // namespace brightray diff --git a/brightray/browser/media/media_capture_devices_dispatcher.h b/brightray/browser/media/media_capture_devices_dispatcher.h index 680455e2321..d10c27df1bc 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.h +++ b/brightray/browser/media/media_capture_devices_dispatcher.h @@ -97,6 +97,6 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver { DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); }; -} // namespace brightray +} // namespace brightray #endif // BRIGHTRAY_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ diff --git a/brightray/browser/media/media_stream_devices_controller.cc b/brightray/browser/media/media_stream_devices_controller.cc index e6f0af89b73..a85c1c928d4 100644 --- a/brightray/browser/media/media_stream_devices_controller.cc +++ b/brightray/browser/media/media_stream_devices_controller.cc @@ -159,4 +159,4 @@ void MediaStreamDevicesController::Deny() { cb.Run(content::MediaStreamDevices(), scoped_ptr()); } -} // namespace brightray +} // namespace brightray diff --git a/brightray/browser/media/media_stream_devices_controller.h b/brightray/browser/media/media_stream_devices_controller.h index 820c8721365..9100fa4e27e 100644 --- a/brightray/browser/media/media_stream_devices_controller.h +++ b/brightray/browser/media/media_stream_devices_controller.h @@ -39,6 +39,6 @@ class MediaStreamDevicesController { DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController); }; -} // namespace brightray +} // namespace brightray #endif // BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_ From 9306fecea869fb3a7027bfe4b20f45e6048eeed9 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:56:44 -0500 Subject: [PATCH 34/52] Fix cpplint errors in content_client.cc --- brightray/common/content_client.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/brightray/common/content_client.cc b/brightray/common/content_client.cc index 4f45ba7cd4b..dd6ce530690 100644 --- a/brightray/common/content_client.cc +++ b/brightray/common/content_client.cc @@ -22,19 +22,23 @@ ContentClient::~ContentClient() { std::string ContentClient::GetProduct() const { auto name = GetApplicationName(); RemoveChars(name, kWhitespaceASCII, &name); - return base::StringPrintf("%s/%s", name.c_str(), GetApplicationVersion().c_str()); + return base::StringPrintf("%s/%s", + name.c_str(), GetApplicationVersion().c_str()); } std::string ContentClient::GetUserAgent() const { return webkit_glue::BuildUserAgentFromProduct(GetProduct()); } -base::StringPiece ContentClient::GetDataResource(int resource_id, ui::ScaleFactor scale_factor) const { - return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(resource_id, scale_factor); +base::StringPiece ContentClient::GetDataResource( + int resource_id, ui::ScaleFactor scale_factor) const { + return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( + resource_id, scale_factor); } gfx::Image& ContentClient::GetNativeImageNamed(int resource_id) const { - return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); + return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( + resource_id); } } // namespace brightray From 2c1e1b039dc0b311dbdfb0365b5126aae11e23d0 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:57:25 -0500 Subject: [PATCH 35/52] Fix cpplint errors in main_application_bundle.h --- brightray/common/mac/main_application_bundle.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/brightray/common/mac/main_application_bundle.h b/brightray/common/mac/main_application_bundle.h index 61f19adadd7..78e6bc200b4 100644 --- a/brightray/common/mac/main_application_bundle.h +++ b/brightray/common/mac/main_application_bundle.h @@ -9,12 +9,13 @@ class FilePath; namespace brightray { -// The "main" application bundle is the outermost bundle for this logical application. E.g., if you -// have MyApp.app and MyApp.app/Contents/Frameworks/MyApp Helper.app, the main application bundle is -// MyApp.app, no matter which executable is currently running. +// The "main" application bundle is the outermost bundle for this logical +// application. E.g., if you have MyApp.app and +// MyApp.app/Contents/Frameworks/MyApp Helper.app, the main application bundle +// is MyApp.app, no matter which executable is currently running. NSBundle* MainApplicationBundle(); base::FilePath MainApplicationBundlePath(); -} +} // namespace brightray #endif From 32f4862e56e911dd6be9d4cae1ac2de1c6b87755 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:57:54 -0500 Subject: [PATCH 36/52] Fix cpplint errors in main_delegate.h --- brightray/common/main_delegate.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index d9e9e17c2e4..e1d033312c9 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -5,10 +5,11 @@ #ifndef BRIGHTRAY_COMMON_MAIN_DELEGATE_H_ #define BRIGHTRAY_COMMON_MAIN_DELEGATE_H_ +#include + #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "content/public/app/content_main_delegate.h" -#include namespace base { class FilePath; @@ -19,21 +20,23 @@ namespace brightray { class ContentClient; class MainDelegate : public content::ContentMainDelegate { -public: + public: MainDelegate(); ~MainDelegate(); -protected: - // Subclasses can override this to provide their own ContentClient implementation. + protected: + // Subclasses can override this to provide their own ContentClient + // implementation. virtual scoped_ptr CreateContentClient(); - // Subclasses can override this to provide additional .pak files to be included in the ui::ResourceBundle. + // Subclasses can override this to provide additional .pak files to be + // included in the ui::ResourceBundle. virtual void AddPakPaths(std::vector* pak_paths) {} virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; virtual void PreSandboxStartup() OVERRIDE; -private: + private: void InitializeResourceBundle(); #if defined(OS_MACOSX) static base::FilePath GetResourcesPakFilePath(); From 51a2779fdbc4f9d94286302670bb116a1962d980 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 18:58:25 -0500 Subject: [PATCH 37/52] Fix cpplint errors in main_delegate.cc --- brightray/common/main_delegate.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index cfa4cd67599..4c903149d09 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -53,8 +53,10 @@ void MainDelegate::InitializeResourceBundle() { std::vector pak_paths; AddPakPaths(&pak_paths); - for (auto it = pak_paths.begin(), end = pak_paths.end(); it != end; ++it) - ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(*it, ui::SCALE_FACTOR_NONE); + for (auto it = pak_paths.begin(), end = pak_paths.end(); it != end; ++it) { + ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( + *it, ui::SCALE_FACTOR_NONE); + } } } // namespace brightray From 779dfd2bafafee0a1b2d815f0f4d929c39345af2 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:01:36 -0500 Subject: [PATCH 38/52] Fix most cpplint errors in devtools_window.h It's still complaining about the non-const reference in BOOL&. --- brightray/browser/win/devtools_window.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/brightray/browser/win/devtools_window.h b/brightray/browser/win/devtools_window.h index 40f2d5afdb2..738af0a427c 100644 --- a/brightray/browser/win/devtools_window.h +++ b/brightray/browser/win/devtools_window.h @@ -8,9 +8,11 @@ namespace brightray { class InspectableWebContentsViewWin; -class DevToolsWindow : public ui::WindowImpl, public base::SupportsWeakPtr { +class DevToolsWindow : public ui::WindowImpl, + public base::SupportsWeakPtr { public: - static DevToolsWindow* Create(InspectableWebContentsViewWin*); + static DevToolsWindow* Create( + InspectableWebContentsViewWin* inspectable_web_contents_view_win); BEGIN_MSG_MAP_EX(DevToolsWindow) MESSAGE_HANDLER(WM_CREATE, OnCreate) @@ -19,7 +21,8 @@ class DevToolsWindow : public ui::WindowImpl, public base::SupportsWeakPtr Date: Sun, 17 Nov 2013 19:02:49 -0500 Subject: [PATCH 39/52] Fix cpplint errors in inspectable_web_contents_view_win.cc --- .../win/inspectable_web_contents_view_win.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/brightray/browser/win/inspectable_web_contents_view_win.cc b/brightray/browser/win/inspectable_web_contents_view_win.cc index 508d4c0bc93..a25cdc8919f 100644 --- a/brightray/browser/win/inspectable_web_contents_view_win.cc +++ b/brightray/browser/win/inspectable_web_contents_view_win.cc @@ -15,11 +15,13 @@ const int kWindowInset = 100; } -InspectableWebContentsView* CreateInspectableContentsView(InspectableWebContentsImpl* inspectable_web_contents) { +InspectableWebContentsView* CreateInspectableContentsView( + InspectableWebContentsImpl* inspectable_web_contents) { return new InspectableWebContentsViewWin(inspectable_web_contents); } -InspectableWebContentsViewWin::InspectableWebContentsViewWin(InspectableWebContentsImpl* inspectable_web_contents) +InspectableWebContentsViewWin::InspectableWebContentsViewWin( + InspectableWebContentsImpl* inspectable_web_contents) : inspectable_web_contents_(inspectable_web_contents) { } @@ -29,7 +31,8 @@ InspectableWebContentsViewWin::~InspectableWebContentsViewWin() { } gfx::NativeView InspectableWebContentsViewWin::GetNativeView() const { - return inspectable_web_contents_->GetWebContents()->GetView()->GetNativeView(); + auto web_contents = inspectable_web_contents_->GetWebContents(); + return web_contents->GetView()->GetNativeView(); } void InspectableWebContentsViewWin::ShowDevTools() { @@ -41,7 +44,9 @@ void InspectableWebContentsViewWin::ShowDevTools() { auto contents_view = inspectable_web_contents_->GetWebContents()->GetView(); auto size = contents_view->GetContainerSize(); size.Enlarge(-kWindowInset, -kWindowInset); - ui::CenterAndSizeWindow(contents_view->GetNativeView(), devtools_window_->hwnd(), size); + ui::CenterAndSizeWindow(contents_view->GetNativeView(), + devtools_window_->hwnd(), + size); ShowWindow(devtools_window_->hwnd(), SW_SHOWNORMAL); } From ae504c319eed27b1605f9d9c03c0283d24d66e72 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:03:09 -0500 Subject: [PATCH 40/52] Fix cpplint errors in content_client.h --- brightray/common/content_client.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/brightray/common/content_client.h b/brightray/common/content_client.h index e8bc579d7b4..11ad7e0aea2 100644 --- a/brightray/common/content_client.h +++ b/brightray/common/content_client.h @@ -11,14 +11,15 @@ namespace brightray { class ContentClient : public content::ContentClient { -public: + public: ContentClient(); ~ContentClient(); -private: + private: virtual std::string GetProduct() const OVERRIDE; virtual std::string GetUserAgent() const OVERRIDE; - virtual base::StringPiece GetDataResource(int resource_id, ui::ScaleFactor) const OVERRIDE; + virtual base::StringPiece GetDataResource(int resource_id, + ui::ScaleFactor) const OVERRIDE; virtual gfx::Image& GetNativeImageNamed(int resource_id) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ContentClient); From 0271ff1964186d3341880a0d23e6712e04a4b2d1 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:03:41 -0500 Subject: [PATCH 41/52] Fix cpplint errors in inspectable_web_contents_view_win.h --- .../browser/win/inspectable_web_contents_view_win.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/brightray/browser/win/inspectable_web_contents_view_win.h b/brightray/browser/win/inspectable_web_contents_view_win.h index c24594d09ca..534f4997284 100644 --- a/brightray/browser/win/inspectable_web_contents_view_win.h +++ b/brightray/browser/win/inspectable_web_contents_view_win.h @@ -12,8 +12,9 @@ class DevToolsWindow; class InspectableWebContentsImpl; class InspectableWebContentsViewWin : public InspectableWebContentsView { -public: - InspectableWebContentsViewWin(InspectableWebContentsImpl*); + public: + explicit InspectableWebContentsViewWin( + InspectableWebContentsImpl* inspectable_web_contents_impl); ~InspectableWebContentsViewWin(); virtual gfx::NativeView GetNativeView() const OVERRIDE; @@ -21,9 +22,11 @@ public: virtual void CloseDevTools() OVERRIDE; virtual bool SetDockSide(const std::string& side) OVERRIDE; - InspectableWebContentsImpl* inspectable_web_contents() { return inspectable_web_contents_; } + InspectableWebContentsImpl* inspectable_web_contents() { + return inspectable_web_contents_; + } -private: + private: // Owns us. InspectableWebContentsImpl* inspectable_web_contents_; From 1595940723e9378aa0ced3bdfe6e2e23979d5361 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:05:21 -0500 Subject: [PATCH 42/52] Fix cpplint errors in devtools_window.cc --- brightray/browser/win/devtools_window.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/brightray/browser/win/devtools_window.cc b/brightray/browser/win/devtools_window.cc index 442bffa13cc..9fc4b5dba88 100644 --- a/brightray/browser/win/devtools_window.cc +++ b/brightray/browser/win/devtools_window.cc @@ -8,7 +8,8 @@ namespace brightray { -DevToolsWindow* DevToolsWindow::Create(InspectableWebContentsViewWin* controller) { +DevToolsWindow* DevToolsWindow::Create( + InspectableWebContentsViewWin* controller) { return new DevToolsWindow(controller); } @@ -20,13 +21,18 @@ DevToolsWindow::~DevToolsWindow() { } LRESULT DevToolsWindow::OnCreate(UINT, WPARAM, LPARAM, BOOL&) { - SetParent(controller_->inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(), hwnd()); + auto devtools_web_contents = + controller_->inspectable_web_contents()->devtools_web_contents(); + SetParent(devtools_web_contents->GetView()->GetNativeView(), hwnd()); SetWindowText(hwnd(), L"Developer Tools"); return 0; } LRESULT DevToolsWindow::OnDestroy(UINT, WPARAM, LPARAM, BOOL&) { - SetParent(controller_->inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(), ui::GetHiddenWindow()); + auto devtools_web_contents = + controller_->inspectable_web_contents()->devtools_web_contents(); + SetParent( + devtools_web_contents->GetView()->GetNativeView(), ui::GetHiddenWindow()); delete this; return 0; } @@ -35,7 +41,9 @@ LRESULT DevToolsWindow::OnSize(UINT, WPARAM, LPARAM, BOOL&) { RECT rect; GetClientRect(hwnd(), &rect); - SetWindowPos(controller_->inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(), + auto devtools_web_contents = + controller_->inspectable_web_contents()->devtools_web_contents(); + SetWindowPos(devtools_web_contents->GetView()->GetNativeView(), nullptr, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, From 4938fc62ad8d351f9ed25caa6c5706e9dfd7c517 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:12:50 -0500 Subject: [PATCH 43/52] Fix most cpplint errors in inspectable_web_contents_view_linux.cc --- .../inspectable_web_contents_view_linux.cc | 104 +++++++++++------- 1 file changed, 66 insertions(+), 38 deletions(-) diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.cc b/brightray/browser/linux/inspectable_web_contents_view_linux.cc index f48c77bba7e..c08aa65d5b3 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.cc +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.cc @@ -1,4 +1,4 @@ -#include "inspectable_web_contents_view_linux.h" +#include "browser/linux/inspectable_web_contents_view_linux.h" #include #include @@ -10,12 +10,15 @@ namespace brightray { -InspectableWebContentsView* CreateInspectableContentsView(InspectableWebContentsImpl* inspectable_web_contents) { +InspectableWebContentsView* CreateInspectableContentsView( + InspectableWebContentsImpl* inspectable_web_contents) { return new InspectableWebContentsViewLinux(inspectable_web_contents); } -InspectableWebContentsViewLinux::InspectableWebContentsViewLinux(InspectableWebContentsImpl* inspectable_web_contents) - : inspectable_web_contents_(inspectable_web_contents), devtools_window_(NULL) { +InspectableWebContentsViewLinux::InspectableWebContentsViewLinux( + InspectableWebContentsImpl* inspectable_web_contents) + : inspectable_web_contents_(inspectable_web_contents), + devtools_window_(NULL) { } InspectableWebContentsViewLinux::~InspectableWebContentsViewLinux() { @@ -26,11 +29,13 @@ InspectableWebContentsViewLinux::~InspectableWebContentsViewLinux() { static void dump_one(GtkWidget *wat, int indent) { GtkAllocation alloc; gtk_widget_get_allocation(wat, &alloc); - fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d", + fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d", indent, "", wat, g_type_name_from_instance((GTypeInstance*)wat), alloc.x, alloc.y, alloc.width, alloc.height); - if (GTK_IS_WINDOW(wat)) fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat))); + if (GTK_IS_WINDOW(wat)) { + fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat))); + } fputc('\n', stderr); } @@ -41,21 +46,22 @@ static void dump_the_whole_tree(GtkWidget *wat, int indent) { } dump_one(wat, indent); GList *kids = gtk_container_get_children(GTK_CONTAINER(wat)); - for (GList *p=kids; p; p=p->next) { + for (GList *p = kids; p; p = p->next) { dump_the_whole_tree(GTK_WIDGET(p->data), indent+2); } } static void dump_parents(GtkWidget *wat) { fprintf(stderr, "Parents:\n"); - for (GtkWidget *p=gtk_widget_get_parent(wat); p; p=gtk_widget_get_parent(p)) { + for (GtkWidget *p = gtk_widget_get_parent(wat); p; p = gtk_widget_get_parent(p)) { dump_one(p, 2); } } #endif gfx::NativeView InspectableWebContentsViewLinux::GetNativeView() const { - return inspectable_web_contents_->GetWebContents()->GetView()->GetNativeView(); + auto web_contents = inspectable_web_contents_->GetWebContents(); + return web_contents->GetView()->GetNativeView(); } @@ -90,18 +96,23 @@ gfx::NativeView InspectableWebContentsViewLinux::GetNativeView() const { */ void InspectableWebContentsViewLinux::ShowDevTools() { - GtkWidget *devtools = inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(); + auto devtools_web_contents = + inspectable_web_contents()->devtools_web_contents(); + GtkWidget *devtools = devtools_web_contents->GetView()->GetNativeView(); GtkWidget *parent = gtk_widget_get_parent(devtools); - DLOG(INFO) << base::StringPrintf("InspectableWebContentsViewLinux::ShowDevTools - parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance((GTypeInstance*)parent), parent, devtools_window_, dockside_.c_str()); + DLOG(INFO) << base::StringPrintf( + "InspectableWebContentsViewLinux::ShowDevTools - parent=%s@%p window=%p dockside=\"%s\"", + g_type_name_from_instance((GTypeInstance*)parent), + parent, + devtools_window_, + dockside_.c_str()); if (!parent || GTK_IS_PANED(parent)) { if (dockside_ == "undocked") ShowDevToolsInWindow(); else if (dockside_ == "bottom") ShowDevToolsInPane(true); else if (dockside_ == "right") ShowDevToolsInPane(false); - } - else { + } else { DCHECK(parent == devtools_window_); if (dockside_ == "undocked") gtk_widget_show_all(parent); else if (dockside_ == "bottom") ShowDevToolsInPane(true); @@ -110,16 +121,22 @@ void InspectableWebContentsViewLinux::ShowDevTools() { } void InspectableWebContentsViewLinux::CloseDevTools() { - GtkWidget *devtools = inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(); + auto devtools_web_contents = + inspectable_web_contents()->devtools_web_contents(); + GtkWidget *devtools = devtools_web_contents->GetView()->GetNativeView(); GtkWidget *parent = gtk_widget_get_parent(devtools); - DLOG(INFO) << base::StringPrintf("InspectableWebContentsViewLinux::CloseDevTools - parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance((GTypeInstance*)parent), parent, devtools_window_, dockside_.c_str()); + DLOG(INFO) << base::StringPrintf( + "InspectableWebContentsViewLinux::CloseDevTools - parent=%s@%p window=%p dockside=\"%s\"", + g_type_name_from_instance((GTypeInstance*)parent), + parent, + devtools_window_, + dockside_.c_str()); - if (!parent) { + if (!parent) return; // Not visible -> nothing to do - } - else if (GTK_IS_PANED(parent)) { + + if (GTK_IS_PANED(parent)) { GtkWidget *browser = GetBrowserWindow(); GtkWidget *view = GetNativeView(); @@ -129,22 +146,26 @@ void InspectableWebContentsViewLinux::CloseDevTools() { gtk_container_remove(GTK_CONTAINER(browser), parent); gtk_widget_reparent(view, browser); g_object_unref(parent); - } - else { + } else { DCHECK(parent == devtools_window_); gtk_widget_hide(parent); } } bool InspectableWebContentsViewLinux::SetDockSide(const std::string& side) { - DLOG(INFO) << "InspectableWebContentsViewLinux::SetDockSide: \"" << side << "\""; - if (side != "undocked" && side != "bottom" && side != "right") return false; // unsupported display location - if (dockside_ == side) return true; // no change from current location + DLOG(INFO) << + "InspectableWebContentsViewLinux::SetDockSide: \"" << side << "\""; + if (side != "undocked" && side != "bottom" && side != "right") + return false; // unsupported display location + if (dockside_ == side) + return true; // no change from current location dockside_ = side; // If devtools already has a parent, then we're being asked to move it. - GtkWidget *devtools = inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(); + auto devtools_web_contents = + inspectable_web_contents()->devtools_web_contents(); + GtkWidget *devtools = devtools_web_contents->GetView()->GetNativeView(); if (gtk_widget_get_parent(devtools)) { ShowDevTools(); } @@ -153,14 +174,16 @@ bool InspectableWebContentsViewLinux::SetDockSide(const std::string& side) { } void InspectableWebContentsViewLinux::ShowDevToolsInWindow() { - GtkWidget *devtools = inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(); + auto devtools_web_contents = + inspectable_web_contents()->devtools_web_contents(); + GtkWidget *devtools = devtools_web_contents->GetView()->GetNativeView(); GtkWidget *parent = gtk_widget_get_parent(devtools); - if (!devtools_window_) MakeDevToolsWindow(); + if (!devtools_window_) + MakeDevToolsWindow(); if (!parent) { gtk_container_add(GTK_CONTAINER(devtools_window_), devtools); - } - else if (parent != devtools_window_) { + } else if (parent != devtools_window_) { DCHECK(GTK_IS_PANED(parent)); gtk_widget_reparent(devtools, devtools_window_); @@ -181,11 +204,16 @@ void InspectableWebContentsViewLinux::MakeDevToolsWindow() { devtools_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(devtools_window_), "Developer Tools"); gtk_window_set_default_size(GTK_WINDOW(devtools_window_), 800, 600); - g_signal_connect(GTK_OBJECT(devtools_window_), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), this); + g_signal_connect(GTK_OBJECT(devtools_window_), + "delete-event", + G_CALLBACK(gtk_widget_hide_on_delete), + this); } void InspectableWebContentsViewLinux::ShowDevToolsInPane(bool on_bottom) { - GtkWidget *devtools = inspectable_web_contents()->devtools_web_contents()->GetView()->GetNativeView(); + auto devtools_web_contents = + inspectable_web_contents()->devtools_web_contents(); + GtkWidget *devtools = devtools_web_contents->GetView()->GetNativeView(); GtkWidget *parent = gtk_widget_get_parent(devtools); GtkWidget *pane = on_bottom ? gtk_vpaned_new() : gtk_hpaned_new(); GtkWidget *view = GetNativeView(); @@ -193,15 +221,15 @@ void InspectableWebContentsViewLinux::ShowDevToolsInPane(bool on_bottom) { GtkAllocation alloc; gtk_widget_get_allocation(browser, &alloc); - gtk_paned_set_position(GTK_PANED(pane), on_bottom ? alloc.height*2/3 : alloc.width/2); + gtk_paned_set_position(GTK_PANED(pane), + on_bottom ? alloc.height * 2 / 3 : alloc.width / 2); if (!parent) { g_object_ref(view); gtk_container_remove(GTK_CONTAINER(browser), view); gtk_paned_add1(GTK_PANED(pane), view); gtk_paned_add2(GTK_PANED(pane), devtools); g_object_unref(view); - } - else if (GTK_IS_PANED(parent)) { + } else if (GTK_IS_PANED(parent)) { g_object_ref(view); g_object_ref(devtools); gtk_container_remove(GTK_CONTAINER(parent), view); @@ -211,8 +239,7 @@ void InspectableWebContentsViewLinux::ShowDevToolsInPane(bool on_bottom) { g_object_unref(view); g_object_unref(devtools); gtk_container_remove(GTK_CONTAINER(browser), parent); - } - else { + } else { DCHECK(parent == devtools_window_); g_object_ref(view); gtk_container_remove(GTK_CONTAINER(devtools_window_), devtools); @@ -229,7 +256,8 @@ void InspectableWebContentsViewLinux::ShowDevToolsInPane(bool on_bottom) { GtkWidget *InspectableWebContentsViewLinux::GetBrowserWindow() { GtkWidget *view = GetNativeView(); GtkWidget *parent = gtk_widget_get_parent(view); - GtkWidget *browser = GTK_IS_PANED(parent) ? gtk_widget_get_parent(parent) : parent; + GtkWidget *browser = + GTK_IS_PANED(parent) ? gtk_widget_get_parent(parent) : parent; DCHECK(GTK_IS_WINDOW(browser)); return browser; } From d0566e6e053bb485133ba2e9c556b482ee802243 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:13:44 -0500 Subject: [PATCH 44/52] Fix cpplint errors in application_info_win.cc --- brightray/common/application_info_win.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/brightray/common/application_info_win.cc b/brightray/common/application_info_win.cc index 6bb5dd96d28..696d8b36b5e 100644 --- a/brightray/common/application_info_win.cc +++ b/brightray/common/application_info_win.cc @@ -7,12 +7,16 @@ namespace brightray { std::string GetApplicationName() { - auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr))); + auto module = GetModuleHandle(nullptr); + auto info = make_scoped_ptr( + FileVersionInfo::CreateFileVersionInfoForModule(module)); return UTF16ToUTF8(info->product_name()); } std::string GetApplicationVersion() { - auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr))); + auto module = GetModuleHandle(nullptr); + auto info = make_scoped_ptr( + FileVersionInfo::CreateFileVersionInfoForModule(module)); return UTF16ToUTF8(info->product_version()); } From 7b47a6152de7bac94f137f655077fabe2f044a25 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:14:08 -0500 Subject: [PATCH 45/52] Fix cpplint errors in media_capture_devices_dispatcher.cc --- brightray/browser/media/media_capture_devices_dispatcher.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/brightray/browser/media/media_capture_devices_dispatcher.cc b/brightray/browser/media/media_capture_devices_dispatcher.cc index a6b584e9c58..eb3e6731a27 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.cc +++ b/brightray/browser/media/media_capture_devices_dispatcher.cc @@ -28,7 +28,7 @@ const content::MediaStreamDevice* FindDeviceWithId( } } return NULL; -}; +} } // namespace @@ -153,7 +153,6 @@ void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( const content::MediaStreamDevice& device, content::MediaRequestState state) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - } void MediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged( @@ -175,7 +174,7 @@ void MediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread( } void MediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread( - const content::MediaStreamDevices& devices){ + const content::MediaStreamDevices& devices) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); devices_enumerated_ = true; video_devices_ = devices; From 654f415a49e39ca6833cb21a1328edc4140be2d4 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:14:24 -0500 Subject: [PATCH 46/52] Fix cpplint errors in common/mac/foundation_util.h --- brightray/common/mac/foundation_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray/common/mac/foundation_util.h b/brightray/common/mac/foundation_util.h index 509c635b04f..3b7e6a66a95 100644 --- a/brightray/common/mac/foundation_util.h +++ b/brightray/common/mac/foundation_util.h @@ -6,8 +6,8 @@ #import -// base/mac/foundation_util.h contains an incompatible declaration of NSSearchPathDirectory, -// so here we #define it to be something else. +// base/mac/foundation_util.h contains an incompatible declaration of +// NSSearchPathDirectory, so here we #define it to be something else. #define NSSearchPathDirectory NSSearchPathDirectory___PRE_10_8 #import "base/mac/foundation_util.h" #undef NSSearchPathDirectory From cdbfff2fcf0f89cc9ccd27db50f1ed30c63eb053 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:15:26 -0500 Subject: [PATCH 47/52] Fix backwards typedef --- brightray/browser/notification_presenter_mac.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brightray/browser/notification_presenter_mac.h b/brightray/browser/notification_presenter_mac.h index fef6bde3f27..e4656b98f02 100644 --- a/brightray/browser/notification_presenter_mac.h +++ b/brightray/browser/notification_presenter_mac.h @@ -30,8 +30,8 @@ class NotificationPresenterMac : public NotificationPresenter { int notification_id) OVERRIDE; private: - typedef NotificationMap std::map>; + typedef std::map> + NotificationMap; NotificationMap notification_map_; base::scoped_nsobject delegate_; }; From 07de5ef46251f478a67017b9e6fe274c3afd07e7 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:19:58 -0500 Subject: [PATCH 48/52] Silence warnings about ui::WindowImpl's BOOL& parameters --- brightray/script/cpplint | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/brightray/script/cpplint b/brightray/script/cpplint index 089b210c2fe..18e7ef7b3f1 100755 --- a/brightray/script/cpplint +++ b/brightray/script/cpplint @@ -13,6 +13,14 @@ IGNORED_FILES = [ 'browser/mac/bry_inspectable_web_contents_view_private.h', ] +FILTERS = [ + '-build/header_guard', + '-build/include_what_you_use', + '-legal/copyright', + # cpplint doesn't like the BOOL& parameters that ui::WindowImpl uses. + '-runtime/references', +] + def main(): os.chdir(SOURCE_ROOT) @@ -32,8 +40,7 @@ def list_files(directories, filters): def cpplint(files): - rules = '--filter=-build/header_guard,-build/include_what_you_use,-legal/copyright' - return subprocess.call([sys.executable, CPPLINT, rules] + list(files)) + return subprocess.call([sys.executable, CPPLINT, '--filter=' + ','.join(FILTERS)] + list(files)) if __name__ == '__main__': From 3d8b636f9e506261c3993a8d716a68fbe5c1d095 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:21:50 -0500 Subject: [PATCH 49/52] Fix remaining cpplint errors in inspectable_web_contents_view_linux.cc --- .../linux/inspectable_web_contents_view_linux.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.cc b/brightray/browser/linux/inspectable_web_contents_view_linux.cc index c08aa65d5b3..dc58b38dfff 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.cc +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.cc @@ -31,7 +31,7 @@ static void dump_one(GtkWidget *wat, int indent) { gtk_widget_get_allocation(wat, &alloc); fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d", indent, "", wat, - g_type_name_from_instance((GTypeInstance*)wat), + g_type_name_from_instance(reinterpret_cast(wat)), alloc.x, alloc.y, alloc.width, alloc.height); if (GTK_IS_WINDOW(wat)) { fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat))); @@ -53,7 +53,9 @@ static void dump_the_whole_tree(GtkWidget *wat, int indent) { static void dump_parents(GtkWidget *wat) { fprintf(stderr, "Parents:\n"); - for (GtkWidget *p = gtk_widget_get_parent(wat); p; p = gtk_widget_get_parent(p)) { + for (GtkWidget *p = gtk_widget_get_parent(wat); + p; + p = gtk_widget_get_parent(p)) { dump_one(p, 2); } } @@ -102,8 +104,9 @@ void InspectableWebContentsViewLinux::ShowDevTools() { GtkWidget *parent = gtk_widget_get_parent(devtools); DLOG(INFO) << base::StringPrintf( - "InspectableWebContentsViewLinux::ShowDevTools - parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance((GTypeInstance*)parent), + "InspectableWebContentsViewLinux::ShowDevTools - " \ + "parent=%s@%p window=%p dockside=\"%s\"", + g_type_name_from_instance(reinterpret_cast(parent)), parent, devtools_window_, dockside_.c_str()); @@ -127,8 +130,9 @@ void InspectableWebContentsViewLinux::CloseDevTools() { GtkWidget *parent = gtk_widget_get_parent(devtools); DLOG(INFO) << base::StringPrintf( - "InspectableWebContentsViewLinux::CloseDevTools - parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance((GTypeInstance*)parent), + "InspectableWebContentsViewLinux::CloseDevTools - " \ + "parent=%s@%p window=%p dockside=\"%s\"", + g_type_name_from_instance(reinterpret_cast(parent)), parent, devtools_window_, dockside_.c_str()); From c9e948dc58023e460cfabea591879258716f2467 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Sun, 17 Nov 2013 19:22:53 -0500 Subject: [PATCH 50/52] Make ignoring files work on Windows --- brightray/script/cpplint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/script/cpplint b/brightray/script/cpplint index 18e7ef7b3f1..69b7aaff9a0 100755 --- a/brightray/script/cpplint +++ b/brightray/script/cpplint @@ -10,7 +10,7 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) CPPLINT = os.path.join(SOURCE_ROOT, 'vendor', 'google-styleguide', 'trunk', 'cpplint', 'cpplint.py') IGNORED_FILES = [ - 'browser/mac/bry_inspectable_web_contents_view_private.h', + os.path.join('browser', 'mac', 'bry_inspectable_web_contents_view_private.h'), ] FILTERS = [ From 9f9aeac59f5adbb5f070db26d85188af3bb05637 Mon Sep 17 00:00:00 2001 From: Patrick Reynolds Date: Sun, 17 Nov 2013 22:25:24 -0600 Subject: [PATCH 51/52] safer casts, clearer if-else chain --- .../linux/inspectable_web_contents_view_linux.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.cc b/brightray/browser/linux/inspectable_web_contents_view_linux.cc index dc58b38dfff..2546bccc823 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.cc +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.cc @@ -31,7 +31,7 @@ static void dump_one(GtkWidget *wat, int indent) { gtk_widget_get_allocation(wat, &alloc); fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d", indent, "", wat, - g_type_name_from_instance(reinterpret_cast(wat)), + g_type_name_from_instance(static_cast(wat)), alloc.x, alloc.y, alloc.width, alloc.height); if (GTK_IS_WINDOW(wat)) { fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat))); @@ -106,7 +106,7 @@ void InspectableWebContentsViewLinux::ShowDevTools() { DLOG(INFO) << base::StringPrintf( "InspectableWebContentsViewLinux::ShowDevTools - " \ "parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance(reinterpret_cast(parent)), + g_type_name_from_instance(static_cast(parent)), parent, devtools_window_, dockside_.c_str()); @@ -132,15 +132,14 @@ void InspectableWebContentsViewLinux::CloseDevTools() { DLOG(INFO) << base::StringPrintf( "InspectableWebContentsViewLinux::CloseDevTools - " \ "parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance(reinterpret_cast(parent)), + g_type_name_from_instance(static_cast(parent)), parent, devtools_window_, dockside_.c_str()); - if (!parent) + if (!parent) { return; // Not visible -> nothing to do - - if (GTK_IS_PANED(parent)) { + } else if (GTK_IS_PANED(parent)) { GtkWidget *browser = GetBrowserWindow(); GtkWidget *view = GetNativeView(); From 470daa571c9c99e396b955645ff9203e491f0f8c Mon Sep 17 00:00:00 2001 From: Patrick Reynolds Date: Sun, 17 Nov 2013 22:27:23 -0600 Subject: [PATCH 52/52] back to reinterpret_cast --- .../browser/linux/inspectable_web_contents_view_linux.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.cc b/brightray/browser/linux/inspectable_web_contents_view_linux.cc index 2546bccc823..cbe8e4e9c34 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.cc +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.cc @@ -31,7 +31,7 @@ static void dump_one(GtkWidget *wat, int indent) { gtk_widget_get_allocation(wat, &alloc); fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d", indent, "", wat, - g_type_name_from_instance(static_cast(wat)), + g_type_name_from_instance(reinterpret_cast(wat)), alloc.x, alloc.y, alloc.width, alloc.height); if (GTK_IS_WINDOW(wat)) { fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat))); @@ -106,7 +106,7 @@ void InspectableWebContentsViewLinux::ShowDevTools() { DLOG(INFO) << base::StringPrintf( "InspectableWebContentsViewLinux::ShowDevTools - " \ "parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance(static_cast(parent)), + g_type_name_from_instance(reinterpret_cast(parent)), parent, devtools_window_, dockside_.c_str()); @@ -132,7 +132,7 @@ void InspectableWebContentsViewLinux::CloseDevTools() { DLOG(INFO) << base::StringPrintf( "InspectableWebContentsViewLinux::CloseDevTools - " \ "parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance(static_cast(parent)), + g_type_name_from_instance(reinterpret_cast(parent)), parent, devtools_window_, dockside_.c_str());