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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 72e8d9222036d6f035993e5cb8fcda8be3ddcf78..525793c741dcfa2a7cfa2e03918117cf337de9df 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -55,6 +55,7 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/dom_distiller/core/url_constants.h"
@@ -1006,14 +1007,14 @@ void ProfileIOData::Init(
main_request_context_.reset(new net::URLRequestContext());
extensions_request_context_.reset(new net::URLRequestContext());
- ChromeNetworkDelegate* network_delegate =
- new ChromeNetworkDelegate(
+ scoped_ptr<ChromeNetworkDelegate> network_delegate =
+ scoped_ptr<ChromeNetworkDelegate>(new ChromeNetworkDelegate(
#if defined(ENABLE_EXTENSIONS)
io_thread_globals->extension_event_router_forwarder.get(),
#else
NULL,
#endif
- &enable_referrers_);
+ &enable_referrers_));
if (command_line.HasSwitch(switches::kEnableClientHints))
network_delegate->SetEnableClientHints();
#if defined(ENABLE_EXTENSIONS)
@@ -1029,7 +1030,21 @@ void ProfileIOData::Init(
network_delegate->set_enable_do_not_track(&enable_do_not_track_);
network_delegate->set_force_google_safe_search(&force_safesearch_);
network_delegate->set_prerender_tracker(profile_params_->prerender_tracker);
- network_delegate_.reset(network_delegate);
+ chrome_network_delegate_ = network_delegate.get();
+ data_reduction_proxy::DataReductionProxyNetworkDelegate*
+ data_reduction_proxy_network_delegate =
+ new data_reduction_proxy::DataReductionProxyNetworkDelegate(
+ network_delegate.Pass());
+ Profile* profile = reinterpret_cast<Profile*>(profile_params_->profile);
+ // Ignore off-the-record data.
+ if (profile && !profile->IsOffTheRecord()) {
+ data_reduction_proxy_network_delegate->set_profile_prefs(
+ profile->GetPrefs());
bengr 2014/11/18 19:30:55 The DRPND constructor should take the pref service
megjablon 2014/11/19 19:23:40 Done.
+ data_reduction_proxy_network_delegate->set_ui_thread_proxy(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
+ }
+ data_reduction_proxy_network_delegate_.reset(
+ data_reduction_proxy_network_delegate);
fraudulent_certificate_reporter_.reset(
new chrome_browser_net::ChromeFraudulentCertificateReporter(

Powered by Google App Engine
This is Rietveld 408576698