Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Unified Diff: chromecast/browser/cast_content_browser_client.cc

Issue 2179693002: Revert of Convert network hints to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/browser/cast_content_browser_client.h ('k') | components/network_hints.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_content_browser_client.cc
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc
index 4b3665c30cb68482143c551e099199f762d9cb0f..b64ca12915b163b5db7da0f5981cb83d04a01154 100644
--- a/chromecast/browser/cast_content_browser_client.cc
+++ b/chromecast/browser/cast_content_browser_client.cc
@@ -38,7 +38,7 @@
#include "chromecast/public/media/media_pipeline_backend.h"
#include "components/crash/content/app/breakpad_linux.h"
#include "components/crash/content/browser/crash_handler_host_linux.h"
-#include "components/network_hints/browser/network_hints_impl.h"
+#include "components/network_hints/browser/network_hints_message_filter.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/certificate_request_result_type.h"
#include "content/public/browser/client_certificate_delegate.h"
@@ -52,7 +52,6 @@
#include "content/public/common/web_preferences.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/url_request/url_request_context_getter.h"
-#include "services/shell/public/cpp/interface_registry.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gl/gl_switches.h"
@@ -210,16 +209,15 @@
// getting HostResolver.
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
- base::Bind(
- &net::URLRequestContextGetter::GetURLRequestContext,
- base::Unretained(url_request_context_factory_->GetSystemGetter())),
- base::Bind(&CastContentBrowserClient::AddNetworkHintsImpl,
+ base::Bind(&net::URLRequestContextGetter::GetURLRequestContext,
+ base::Unretained(
+ url_request_context_factory_->GetSystemGetter())),
+ base::Bind(&CastContentBrowserClient::AddNetworkHintsMessageFilter,
base::Unretained(this), host->GetID()));
}
-void CastContentBrowserClient::AddNetworkHintsImpl(
- int render_process_id,
- net::URLRequestContext* context) {
+void CastContentBrowserClient::AddNetworkHintsMessageFilter(
+ int render_process_id, net::URLRequestContext* context) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::RenderProcessHost* host =
@@ -227,15 +225,10 @@
if (!host)
return;
- network_hints_.reset(new network_hints::NetworkHintsImpl(
- url_request_context_factory_->host_resolver()));
- // The client outlives the host, which owns the registry, and thus
- // |network_hints_| will outlive the registry.
- host->GetInterfaceRegistry()->AddInterface(
- base::Bind(&network_hints::NetworkHintsImpl::Bind,
- base::Unretained(network_hints_.get())),
- content::BrowserThread::GetTaskRunnerForThread(
- content::BrowserThread::IO));
+ scoped_refptr<content::BrowserMessageFilter> network_hints_message_filter(
+ new network_hints::NetworkHintsMessageFilter(
+ url_request_context_factory_->host_resolver()));
+ host->AddFilter(network_hints_message_filter.get());
}
bool CastContentBrowserClient::IsHandledURL(const GURL& url) {
« no previous file with comments | « chromecast/browser/cast_content_browser_client.h ('k') | components/network_hints.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698