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 |