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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.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 and sgurun 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_factory.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.cc
index cf8ed375a02d29f3c6bdedb9d4ec71275d10865f..42ad1ac4ba170a99037f10e85fb52a13f6ec78ec 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/memory/singleton.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
-#include "chrome/browser/profiles/profile.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -53,10 +52,11 @@ DataReductionProxyChromeSettingsFactory::
KeyedService* DataReductionProxyChromeSettingsFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
- Profile* profile = static_cast<Profile*>(context);
- int flags = DataReductionProxyParams::kFallbackAllowed;
- if (DataReductionProxyParams::IsIncludedInFieldTrial())
- flags |= DataReductionProxyParams::kAllowed;
+ int flags = 0;
+ if (DataReductionProxyParams::IsIncludedInFieldTrial()) {
+ flags |= (DataReductionProxyParams::kAllowed |
+ DataReductionProxyParams::kFallbackAllowed);
+ }
if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial())
flags |= DataReductionProxyParams::kAlternativeAllowed;
if (DataReductionProxyParams::IsIncludedInPromoFieldTrial())
@@ -64,11 +64,6 @@ KeyedService* DataReductionProxyChromeSettingsFactory::BuildServiceInstanceFor(
if (DataReductionProxyParams::IsIncludedInHoldbackFieldTrial())
flags |= DataReductionProxyParams::kHoldback;
- DataReductionProxyParams* params = new DataReductionProxyParams(flags);
-
- // Takes ownership of params.
- DataReductionProxyChromeSettings* settings =
- new DataReductionProxyChromeSettings(params);
- settings->InitDataReductionProxySettings(profile);
- return settings;
+ return new DataReductionProxyChromeSettings(
+ new DataReductionProxyParams(flags));
}

Powered by Google App Engine
This is Rietveld 408576698