Chromium Code Reviews| 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 0072a6711749da34bc6832158dc1785287ffdf1a..ba913e5b245c00b74309cefe21a029ae00ccf193 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -118,7 +118,7 @@ |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| #include "components/content_settings/core/common/content_settings.h" |
| #include "components/content_settings/core/common/content_settings_types.h" |
| -#include "components/data_reduction_proxy/content/browser/data_reduction_proxy_message_filter.h" |
| +#include "components/data_reduction_proxy/content/browser/data_reduction_proxy_host_impl.h" |
| #include "components/dom_distiller/core/dom_distiller_switches.h" |
| #include "components/dom_distiller/core/url_constants.h" |
| #include "components/error_page/common/error_page_switches.h" |
| @@ -989,10 +989,6 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch( |
| #if defined(OS_ANDROID) |
| host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
| #endif |
| - DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
| - DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); |
| - host->AddFilter(new data_reduction_proxy::DataReductionProxyMessageFilter( |
| - data_reduction_proxy_settings)); |
| host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
| profile->IsOffTheRecord())); |
| @@ -2720,6 +2716,23 @@ void ChromeContentBrowserClient::RegisterRenderProcessMojoServices( |
| content::RenderProcessHost* render_process_host) { |
| registry->AddService( |
| base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
| + |
| + Profile* profile = |
| + Profile::FromBrowserContext(render_process_host->GetBrowserContext()); |
| + DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
| + DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile); |
|
Anand Mistry (off Chromium)
2016/06/24 07:12:28
I'm personally of the opinion that as much as poss
Sam McNally
2016/06/24 07:24:48
While it would be nicer to create them lazily, it'
|
| + auto* data_reduction_proxy_host = |
| + new data_reduction_proxy::DataReductionProxyHostImpl( |
| + data_reduction_proxy_settings |
| + ? data_reduction_proxy_settings->Config() |
| + : nullptr, |
| + render_process_host); |
| + // The data_reduction_proxy_host is a render process host observer, so here we |
|
Anand Mistry (off Chromium)
2016/06/24 07:12:28
I'm convinced this is technically correct. However
Sam McNally
2016/06/24 07:24:48
This feels like a lot of unnecessary thread bounci
leonhsl(Using Gerrit)
2016/06/24 09:59:21
En,, if let DataReductionProxyHostImpl live on UI
leonhsl(Using Gerrit)
2016/06/24 14:46:11
Sorry for my misunderstanding, you could just igno
|
| + // can use base::Unretained safely. |
| + registry->AddService( |
| + base::Bind(&data_reduction_proxy::DataReductionProxyHostImpl::BindRequest, |
| + base::Unretained(data_reduction_proxy_host)), |
| + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| } |
| void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( |