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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 893003002: Data Reduction Proxy class ownership updates and Settings cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 proxy_rules.ParseFromString(proxy_server); 44 proxy_rules.ParseFromString(proxy_server);
45 if (!data_reduction_proxy::DataReductionProxyConfigurator:: 45 if (!data_reduction_proxy::DataReductionProxyConfigurator::
46 ContainsDataReductionProxy(proxy_rules)) { 46 ContainsDataReductionProxy(proxy_rules)) {
47 return; 47 return;
48 } 48 }
49 dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_SYSTEM)); 49 dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_SYSTEM));
50 dict->SetString("server", ""); 50 dict->SetString("server", "");
51 dict->SetString("bypass_list", ""); 51 dict->SetString("bypass_list", "");
52 } 52 }
53 53
54 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( 54 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings()
55 scoped_ptr<DataReductionProxyParams> params) 55 : DataReductionProxySettings() {
56 : DataReductionProxySettings(params.Pass()) {
57 } 56 }
58 57
59 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() { 58 DataReductionProxyChromeSettings::~DataReductionProxyChromeSettings() {
60 } 59 }
61 60
62 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( 61 void DataReductionProxyChromeSettings::InitDataReductionProxySettings(
63 data_reduction_proxy::DataReductionProxyIOData* io_data, 62 data_reduction_proxy::DataReductionProxyIOData* io_data,
64 PrefService* profile_prefs, 63 PrefService* profile_prefs,
65 PrefService* local_state_prefs, 64 PrefService* local_state_prefs) {
66 net::URLRequestContextGetter* request_context) {
67 SetProxyConfigurator(io_data->configurator());
68 DataReductionProxySettings::InitDataReductionProxySettings( 65 DataReductionProxySettings::InitDataReductionProxySettings(
69 profile_prefs, 66 profile_prefs,
70 request_context, 67 io_data->config(),
bengr 2015/02/03 21:51:57 Why not just pass in io_data? Then you wouldn't ne
jeremyim 2015/02/04 01:31:20 Done.
71 io_data->net_log(),
72 io_data->event_store()); 68 io_data->event_store());
73 DataReductionProxySettings::SetOnDataReductionEnabledCallback( 69 DataReductionProxySettings::SetOnDataReductionEnabledCallback(
74 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, 70 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial,
75 base::Unretained(this))); 71 base::Unretained(this)));
76 SetDataReductionProxyAlternativeEnabled( 72 SetDataReductionProxyAlternativeEnabled(
77 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); 73 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
78 // TODO(bengr): Remove after M46. See http://crbug.com/445599. 74 // TODO(bengr): Remove after M46. See http://crbug.com/445599.
79 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); 75 MigrateDataReductionProxyOffProxyPrefs(profile_prefs);
80 } 76 }
81 77
(...skipping 23 matching lines...) Expand all
105 #elif defined(OS_OPENBSD) 101 #elif defined(OS_OPENBSD)
106 return Client::CHROME_OPENBSD; 102 return Client::CHROME_OPENBSD;
107 #elif defined(OS_SOLARIS) 103 #elif defined(OS_SOLARIS)
108 return Client::CHROME_SOLARIS; 104 return Client::CHROME_SOLARIS;
109 #elif defined(OS_QNX) 105 #elif defined(OS_QNX)
110 return Client::CHROME_QNX; 106 return Client::CHROME_QNX;
111 #else 107 #else
112 return Client::UNKNOWN; 108 return Client::UNKNOWN;
113 #endif 109 #endif
114 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698