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

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: Add untracked dependency on mojom 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 | « chrome/browser/BUILD.gn ('k') | chrome/browser/extensions/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0ab09d6fd5b9ec2a19a2413e6f08ba98a5bfc31e 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);
+ host->GetInterfaceRegistry()->AddInterface(
+ base::Bind(&ChromeRenderMessageFilter::BindNetworkHints,
+ base::Unretained(chrome_render_filter)),
dcheng 2016/07/25 02:50:47 Btw, I think we should just remove the base::Unret
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
+ host->AddFilter(chrome_render_filter);
#if defined(ENABLE_EXTENSIONS)
host->AddFilter(new cast::CastTransportHostFilter);
#endif
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/extensions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698