diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index e082b4ac5c..6181f8ec63 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -232,4 +232,8 @@ content::PermissionManager* BrowserContext::GetPermissionManager() { return permission_manager_.get(); } +content::BackgroundSyncController* BrowserContext::GetBackgroundSyncController() { + return nullptr; +} + } // namespace brightray diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 3c9b68d883..9866732cbc 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -57,6 +57,7 @@ class BrowserContext : public base::RefCounted, content::PushMessagingService* GetPushMessagingService() override; content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; content::PermissionManager* GetPermissionManager() override; + content::BackgroundSyncController* GetBackgroundSyncController() override; net::URLRequestContextGetter* CreateRequestContext( NetLog* net_log, diff --git a/brightray/browser/devtools_embedder_message_dispatcher.cc b/brightray/browser/devtools_embedder_message_dispatcher.cc index 2a4b381765..f45d90d753 100644 --- a/brightray/browser/devtools_embedder_message_dispatcher.cc +++ b/brightray/browser/devtools_embedder_message_dispatcher.cc @@ -190,8 +190,9 @@ DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend( d->RegisterHandler("resetZoom", &Delegate::ResetZoom, delegate); d->RegisterHandler("setDevicesUpdatesEnabled", &Delegate::SetDevicesUpdatesEnabled, delegate); - d->RegisterHandler("sendMessageToBrowser", - &Delegate::SendMessageToBrowser, delegate); + d->RegisterHandler("dispatchProtocolMessage", + &Delegate::DispatchProtocolMessageFromDevToolsFrontend, + delegate); d->RegisterHandler("recordActionUMA", &Delegate::RecordActionUMA, delegate); d->RegisterHandlerWithCallback("sendJsonRequest", &Delegate::SendJsonRequest, delegate); diff --git a/brightray/browser/devtools_embedder_message_dispatcher.h b/brightray/browser/devtools_embedder_message_dispatcher.h index 46f54dfbf2..eb3dc38978 100644 --- a/brightray/browser/devtools_embedder_message_dispatcher.h +++ b/brightray/browser/devtools_embedder_message_dispatcher.h @@ -68,7 +68,8 @@ class DevToolsEmbedderMessageDispatcher { virtual void ZoomOut() = 0; virtual void ResetZoom() = 0; virtual void SetDevicesUpdatesEnabled(bool enabled) = 0; - virtual void SendMessageToBrowser(const std::string& message) = 0; + virtual void DispatchProtocolMessageFromDevToolsFrontend( + const std::string& message) = 0; virtual void RecordActionUMA(const std::string& name, int action) = 0; virtual void SendJsonRequest(const DispatchCallback& callback, const std::string& browser_id, diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 76972b654e..5afff01ff6 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -26,6 +26,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/common/user_agent.h" +#include "ipc/ipc_channel.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_response_writer.h" @@ -251,7 +252,9 @@ void InspectableWebContentsImpl::ShowDevTools() { agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_.get()); frontend_host_.reset(content::DevToolsFrontendHost::Create( - web_contents_->GetMainFrame(), this)); + web_contents_->GetMainFrame(), + base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend, + base::Unretained(this)))); agent_host_->AttachClient(this); GURL devtools_url(base::StringPrintf(kChromeUIDevToolsURL, @@ -477,7 +480,8 @@ void InspectableWebContentsImpl::ResetZoom() { void InspectableWebContentsImpl::SetDevicesUpdatesEnabled(bool enabled) { } -void InspectableWebContentsImpl::SendMessageToBrowser(const std::string& message) { +void InspectableWebContentsImpl::DispatchProtocolMessageFromDevToolsFrontend( + const std::string& message) { if (agent_host_.get()) agent_host_->DispatchProtocolMessage(message); } @@ -543,12 +547,6 @@ void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(const std::st params); } -void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontendToBackend( - const std::string& message) { - if (agent_host_.get()) - agent_host_->DispatchProtocolMessage(message); -} - void InspectableWebContentsImpl::DispatchProtocolMessage( content::DevToolsAgentHost* agent_host, const std::string& message) { if (!frontend_loaded_) @@ -578,7 +576,10 @@ void InspectableWebContentsImpl::RenderFrameHostChanged( content::RenderFrameHost* new_host) { if (new_host->GetParent()) return; - frontend_host_.reset(content::DevToolsFrontendHost::Create(new_host, this)); + frontend_host_.reset(content::DevToolsFrontendHost::Create( + web_contents_->GetMainFrame(), + base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend, + base::Unretained(this)))); } void InspectableWebContentsImpl::WebContentsDestroyed() { diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 7edf9ce96e..e4a964adf0 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -104,7 +104,8 @@ class InspectableWebContentsImpl : void ZoomOut() override; void ResetZoom() override; void SetDevicesUpdatesEnabled(bool enabled) override; - void SendMessageToBrowser(const std::string& message) override; + void DispatchProtocolMessageFromDevToolsFrontend( + const std::string& message) override; void RecordActionUMA(const std::string& name, int action) override; void SendJsonRequest(const DispatchCallback& callback, const std::string& browser_id, diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index e03adba65a..a179560556 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -140,11 +140,11 @@ bool NetworkDelegate::OnCanEnablePrivacyMode( return false; } -bool OnAreStrictSecureCookiesEnabled() { +bool NetworkDelegate::OnAreStrictSecureCookiesEnabled() const { return true; } -bool OnAreExperimentalCookieFeaturesEnabled() { +bool NetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { return true; } diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 1779170136..6e516edef5 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -310,15 +310,15 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { #else http_auth_preferences_.reset(new net::HttpAuthPreferences(schemes)); #endif - auto auth_handler_factory = make_scoped_ptr( + auto auth_handler_factory = net::HttpAuthHandlerRegistryFactory::Create( - http_auth_preferences_.get(), host_resolver.get())); + http_auth_preferences_.get(), host_resolver.get()); storage_->set_cert_verifier(delegate_->CreateCertVerifier()); storage_->set_transport_security_state( make_scoped_ptr(new net::TransportSecurityState)); storage_->set_ssl_config_service(delegate_->CreateSSLConfigService()); - storage_->set_http_auth_handler_factory(auth_handler_factory.Pass()); + storage_->set_http_auth_handler_factory(std::move(auth_handler_factory)); scoped_ptr server_properties( new net::HttpServerPropertiesImpl); storage_->set_http_server_properties(std::move(server_properties)); @@ -367,10 +367,10 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { } storage_->set_http_transaction_factory(make_scoped_ptr( new net::HttpCache( - new DevToolsNetworkTransactionFactory(controller_, - http_network_session_.get()), - url_request_context_->net_log(), - std::move(backend)))); + make_scoped_ptr(new DevToolsNetworkTransactionFactory( + controller_, http_network_session_.get())), + std::move(backend), + false))); storage_->set_job_factory(delegate_->CreateURLRequestJobFactory( &protocol_handlers_, &protocol_interceptors_));