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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2063683002: Migrate components/data_reduction_proxy to Mojo interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only 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 | « no previous file | chrome/common/chrome_content_client.h » ('j') | chrome/renderer/page_load_histograms.cc » ('J')
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 aa41274e9d4c3d901dd114a784aeff9a82c383c4..073ffc2c600a77ae1e1db435138c38b52952b756 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"
@@ -1014,10 +1014,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()));
@@ -2783,6 +2779,23 @@ void ChromeContentBrowserClient::ExposeInterfacesToRenderer(
content::RenderProcessHost* render_process_host) {
registry->AddInterface(
base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create));
+
+ Profile* profile =
+ Profile::FromBrowserContext(render_process_host->GetBrowserContext());
dcheng 2016/07/08 05:50:53 I think a BrowserContext here should be sufficient
leonhsl(Using Gerrit) 2016/07/11 14:36:07 Done and thanks!
+ DataReductionProxyChromeSettings* data_reduction_proxy_settings =
+ DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile);
+ auto* data_reduction_proxy_host =
+ new data_reduction_proxy::DataReductionProxyHostImpl(
+ data_reduction_proxy_settings
+ ? data_reduction_proxy_settings->Config()
+ : nullptr,
+ render_process_host);
dcheng 2016/07/08 05:50:53 Lines 2789-2791 should probably just be inlined in
leonhsl(Using Gerrit) 2016/07/11 14:36:07 Done.
+ // 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::GetMessageLoopProxyForThread(BrowserThread::IO));
dcheng 2016/07/08 05:50:53 I'm a bit sad about how the ownership here has bec
leonhsl(Using Gerrit) 2016/07/11 14:36:07 I'm also investigating around,, but I think Ken wo
}
void ChromeContentBrowserClient::RegisterFrameMojoShellInterfaces(
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.h » ('j') | chrome/renderer/page_load_histograms.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698