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 |