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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from willchan Created 6 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
Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
index abdbe4bd60e623134369db81ff2249744cc6cdaf..0cb071cb34e67e07ec483a91a3acbc610103d2e3 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h"
#include "chrome/browser/profiles/profile.h"
@@ -11,6 +13,7 @@
#include "components/data_reduction_proxy/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h"
+#include "net/url_request/url_request_context_getter.h"
using data_reduction_proxy::DataReductionProxyParams;
using data_reduction_proxy::DataReductionProxySettings;
@@ -23,18 +26,16 @@ DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() {
}
void DataReductionProxyChromeSettings::InitDataReductionProxySettings(
- Profile* profile) {
- DCHECK(profile);
- PrefService* prefs = profile->GetPrefs();
-
- scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
- configurator(new DataReductionProxyChromeConfigurator(prefs));
+ scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
+ configurator,
+ PrefService* profile_prefs,
+ PrefService* local_state_prefs,
+ net::URLRequestContextGetter* request_context) {
SetProxyConfigurator(configurator.Pass());
DataReductionProxySettings::InitDataReductionProxySettings(
- prefs,
- g_browser_process->local_state(),
- ProfileManager::GetActiveUserProfile()->GetRequestContext());
-
+ profile_prefs,
+ local_state_prefs,
+ request_context);
SetDataReductionProxyAlternativeEnabled(
DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
}

Powered by Google App Engine
This is Rietveld 408576698