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

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

Issue 896713003: Revert of DataReductionProxyStatisticsPrefs should support WeakPtr (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"
11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
12 #include "chrome/browser/prefs/proxy_prefs.h" 12 #include "chrome/browser/prefs/proxy_prefs.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
15 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h" 16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h"
17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h" 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h"
18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
20 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h"
21 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 20 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
22 #include "net/url_request/url_request_context_getter.h" 21 #include "net/url_request/url_request_context_getter.h"
23 22
24 using data_reduction_proxy::Client; 23 using data_reduction_proxy::Client;
25 using data_reduction_proxy::DataReductionProxyParams; 24 using data_reduction_proxy::DataReductionProxyParams;
26 using data_reduction_proxy::DataReductionProxySettings; 25 using data_reduction_proxy::DataReductionProxySettings;
27 26
28 // The Data Reduction Proxy has been turned into a "best effort" proxy, 27 // The Data Reduction Proxy has been turned into a "best effort" proxy,
29 // meaning it is used only if the effective proxy configuration resolves to 28 // meaning it is used only if the effective proxy configuration resolves to
30 // DIRECT for a URL. It no longer can be a ProxyConfig in the proxy preference 29 // DIRECT for a URL. It no longer can be a ProxyConfig in the proxy preference
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 67 }
69 68
70 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( 69 void DataReductionProxyChromeSettings::InitDataReductionProxySettings(
71 data_reduction_proxy::DataReductionProxyIOData* io_data, 70 data_reduction_proxy::DataReductionProxyIOData* io_data,
72 PrefService* profile_prefs, 71 PrefService* profile_prefs,
73 PrefService* local_state_prefs, 72 PrefService* local_state_prefs,
74 net::URLRequestContextGetter* request_context) { 73 net::URLRequestContextGetter* request_context) {
75 SetProxyConfigurator(io_data->configurator()); 74 SetProxyConfigurator(io_data->configurator());
76 DataReductionProxySettings::InitDataReductionProxySettings( 75 DataReductionProxySettings::InitDataReductionProxySettings(
77 profile_prefs, 76 profile_prefs,
78 io_data->PassStatisticsPrefs(),
79 request_context, 77 request_context,
80 io_data->net_log(), 78 io_data->net_log(),
81 io_data->event_store()); 79 io_data->event_store());
82 DataReductionProxySettings::SetOnDataReductionEnabledCallback( 80 DataReductionProxySettings::SetOnDataReductionEnabledCallback(
83 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, 81 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial,
84 base::Unretained(this))); 82 base::Unretained(this)));
85 SetDataReductionProxyAlternativeEnabled( 83 SetDataReductionProxyAlternativeEnabled(
86 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); 84 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
87 // TODO(bengr): Remove after M46. See http://crbug.com/445599. 85 // TODO(bengr): Remove after M46. See http://crbug.com/445599.
88 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); 86 MigrateDataReductionProxyOffProxyPrefs(profile_prefs);
(...skipping 25 matching lines...) Expand all
114 #elif defined(OS_OPENBSD) 112 #elif defined(OS_OPENBSD)
115 return Client::CHROME_OPENBSD; 113 return Client::CHROME_OPENBSD;
116 #elif defined(OS_SOLARIS) 114 #elif defined(OS_SOLARIS)
117 return Client::CHROME_SOLARIS; 115 return Client::CHROME_SOLARIS;
118 #elif defined(OS_QNX) 116 #elif defined(OS_QNX)
119 return Client::CHROME_QNX; 117 return Client::CHROME_QNX;
120 #else 118 #else
121 return Client::UNKNOWN; 119 return Client::UNKNOWN;
122 #endif 120 #endif
123 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698