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 f8af92a04931b0c22929199aa1e70f96b6998325..5a06a56cafb528654c1a6367be66d5a8b060438f 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" |
@@ -1015,10 +1015,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())); |
@@ -2784,6 +2780,19 @@ void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
content::RenderProcessHost* render_process_host) { |
registry->AddInterface( |
base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create)); |
+ |
+ DataReductionProxyChromeSettings* data_reduction_proxy_settings = |
+ DataReductionProxyChromeSettingsFactory::GetForBrowserContext( |
+ render_process_host->GetBrowserContext()); |
+ auto* data_reduction_proxy_host = |
+ new data_reduction_proxy::DataReductionProxyHostImpl( |
+ data_reduction_proxy_settings, render_process_host); |
+ // The data_reduction_proxy_host is a render process host observer, so here we |
+ // can use base::Unretained safely. |
+ registry->AddInterface( |
+ base::Bind(&data_reduction_proxy::DataReductionProxyHostImpl::BindRequest, |
+ base::Unretained(data_reduction_proxy_host)), |
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
} |
void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces( |