From 2c81fb47197bb0efbc7fb89569bed873e6cc70eb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 6 Dec 2014 22:16:00 -0800 Subject: [PATCH] Fix compilation warnings due to API changes --- brightray/browser/browser_context.cc | 22 +++++-------------- brightray/browser/devtools_ui.cc | 9 ++++---- .../mac/bry_inspectable_web_contents_view.mm | 10 +++++++-- .../media/media_capture_devices_dispatcher.cc | 13 ----------- .../media/media_capture_devices_dispatcher.h | 9 -------- .../browser/url_request_context_getter.cc | 4 ++-- 6 files changed, 20 insertions(+), 47 deletions(-) diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 42f28358ac98..c3820de64be7 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -45,18 +45,6 @@ class BrowserContext::ResourceContext : public content::ResourceContext { return getter_->GetURLRequestContext(); } - // 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. - virtual bool AllowCameraAccess(const GURL& origin) override { - return true; - } - URLRequestContextGetter* getter_; }; @@ -80,13 +68,13 @@ void BrowserContext::Initialize() { base::PrefServiceFactory prefs_factory; prefs_factory.SetUserPrefsFile(prefs_path, JsonPrefStore::GetTaskRunnerForFile( - prefs_path, BrowserThread::GetBlockingPool())); + prefs_path, BrowserThread::GetBlockingPool()).get()); auto registry = make_scoped_refptr(new PrefRegistrySimple); - RegisterInternalPrefs(registry); - RegisterPrefs(registry); + RegisterInternalPrefs(registry.get()); + RegisterPrefs(registry.get()); - prefs_ = prefs_factory.Create(registry); + prefs_ = prefs_factory.Create(registry.get()); } BrowserContext::~BrowserContext() { @@ -102,7 +90,7 @@ void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) { net::URLRequestContextGetter* BrowserContext::CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector protocol_interceptors) { - DCHECK(!url_request_getter_); + DCHECK(!url_request_getter_.get()); url_request_getter_ = new URLRequestContextGetter( this, GetPath(), diff --git a/brightray/browser/devtools_ui.cc b/brightray/browser/devtools_ui.cc index 43fe2a50e047..42769b53c300 100644 --- a/brightray/browser/devtools_ui.cc +++ b/brightray/browser/devtools_ui.cc @@ -68,13 +68,14 @@ class BundledDataSource : public content::URLDataSource { int resource_id = content::DevToolsHttpHandler::GetFrontendResourceId(filename); - DLOG_IF(WARNING, -1 == resource_id) << "Unable to find dev tool resource: " - << filename << ". If you compiled with debug_devtools=1, try running" - " with --debug-devtools."; + DLOG_IF(WARNING, resource_id == -1) + << "Unable to find dev tool resource: " << filename + << ". If you compiled with debug_devtools=1, try running with " + "--debug-devtools."; const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); scoped_refptr bytes(rb.LoadDataResourceBytes( resource_id)); - callback.Run(bytes); + callback.Run(bytes.get()); } virtual std::string GetMimeType(const std::string& path) const override { diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index 9efe560afa67..bb2e065d3379 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -21,8 +21,6 @@ using namespace brightray; devtools_docked_ = NO; auto contents = inspectableWebContentsView_->inspectable_web_contents()->GetWebContents(); - contents->SetAllowOverlappingViews(true); - auto contentsView = contents->GetNativeView(); [contentsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self addSubview:contentsView]; @@ -45,9 +43,17 @@ using namespace brightray; if (visible == devtools_visible_) return; + auto webContents = inspectableWebContentsView_->inspectable_web_contents()->GetWebContents(); auto devToolsWebContents = inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents(); auto devToolsView = devToolsWebContents->GetNativeView(); + if (visible && devtools_docked_) { + webContents->SetAllowOtherViews(true); + devToolsWebContents->SetAllowOtherViews(true); + } else { + webContents->SetAllowOtherViews(false); + } + devtools_visible_ = visible; if (devtools_docked_) { if (visible) { diff --git a/brightray/browser/media/media_capture_devices_dispatcher.cc b/brightray/browser/media/media_capture_devices_dispatcher.cc index ddf1948a18e4..1c99d89765ae 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.cc +++ b/brightray/browser/media/media_capture_devices_dispatcher.cc @@ -142,19 +142,6 @@ void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( content::MediaRequestState state) { } -void MediaCaptureDevicesDispatcher::OnAudioStreamPlaying( - int render_process_id, - int render_frame_id, - int stream_id, - const ReadPowerAndClipCallback& power_read_callback) { -} - -void MediaCaptureDevicesDispatcher::OnAudioStreamStopped( - int render_process_id, - int render_frame_id, - int stream_id) { -} - void MediaCaptureDevicesDispatcher::OnCreatingAudioStream( int render_process_id, int render_view_id) { diff --git a/brightray/browser/media/media_capture_devices_dispatcher.h b/brightray/browser/media/media_capture_devices_dispatcher.h index fb2e7a1c372f..f89f9b02203b 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.h +++ b/brightray/browser/media/media_capture_devices_dispatcher.h @@ -60,15 +60,6 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver { const GURL& security_origin, content::MediaStreamType stream_type, content::MediaRequestState state) override; - virtual void OnAudioStreamPlaying( - int render_process_id, - int render_frame_id, - int stream_id, - const ReadPowerAndClipCallback& power_read_callback) override; - virtual void OnAudioStreamStopped( - int render_process_id, - int render_frame_id, - int stream_id) override; virtual void OnCreatingAudioStream(int render_process_id, int render_view_id) override; diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 7010aa464a4a..44a0f6cbcd44 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -38,7 +38,7 @@ #include "net/url_request/url_request_intercepting_job_factory.h" #include "net/url_request/url_request_job_factory_impl.h" #include "url/url_constants.h" -#include "webkit/browser/quota/special_storage_policy.h" +#include "storage/browser/quota/special_storage_policy.h" using content::BrowserThread; @@ -120,7 +120,7 @@ URLRequestContextGetter::URLRequestContextGetter( // must synchronously run on the glib message loop. This will be passed to // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( - io_loop_->message_loop_proxy(), file_loop_)); + io_loop_->message_loop_proxy(), file_loop_->message_loop_proxy())); } URLRequestContextGetter::~URLRequestContextGetter() {