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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2144533002: Convert network hints to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sammc's review comments 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
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 3db8ffcf93b9f72ec2566445f896cd012b3901ac..ee3dcbf60bbf0915eda38a690945d4476a9644ed 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -967,7 +967,14 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
net::URLRequestContextGetter* context =
host->GetStoragePartition()->GetURLRequestContext();
- host->AddFilter(new ChromeRenderMessageFilter(id, profile));
+ // The host owns both |chrome_render| and the interface registry, which will
+ // be destroyed before the filter.
+ auto chrome_render_filter = new ChromeRenderMessageFilter(id, profile);
dcheng 2016/07/20 13:59:50 Nit: auto*
tibell 2016/07/21 00:12:06 Done.
+ host->GetInterfaceRegistry()->AddInterface(
+ base::Bind(&ChromeRenderMessageFilter::BindNetworkHints,
+ base::Unretained(chrome_render_filter)),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
+ host->AddFilter(chrome_render_filter);
#if defined(ENABLE_EXTENSIONS)
host->AddFilter(new cast::CastTransportHostFilter);
#endif

Powered by Google App Engine
This is Rietveld 408576698