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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_params.h

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, 4 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 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is 73 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is
74 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy 74 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy
75 // configuration is allowed to be used. This alternative configuration would 75 // configuration is allowed to be used. This alternative configuration would
76 // replace the primary and fallback proxy configurations if enabled. Finally 76 // replace the primary and fallback proxy configurations if enabled. Finally
77 // if |kPromoAllowed|, the client may show a promotion for the data reduction 77 // if |kPromoAllowed|, the client may show a promotion for the data reduction
78 // proxy. 78 // proxy.
79 // 79 //
80 // A standard configuration has a primary proxy, and a fallback proxy for 80 // A standard configuration has a primary proxy, and a fallback proxy for
81 // HTTP traffic. The alternative configuration has a different primary and 81 // HTTP traffic. The alternative configuration has a different primary and
82 // fallback proxy for HTTP traffic, and an SSL proxy. 82 // fallback proxy for HTTP traffic, and an SSL proxy.
83 explicit DataReductionProxyParams(int flags);
83 84
84 DataReductionProxyParams(int flags); 85 // Creates a copy of the configuration parameters.
86 DataReductionProxyParams* Clone();
willchan no longer on Chromium 2014/07/31 22:31:35 Return scoped_ptr<DataReductionProxyParams>. This
bengr 2014/08/02 01:10:32 Done.
85 87
86 virtual ~DataReductionProxyParams(); 88 virtual ~DataReductionProxyParams();
87 89
88 // Returns true if a data reduction proxy was used for the given |request|. 90 // Returns true if a data reduction proxy was used for the given |request|.
89 // If true, |proxy_servers.first| will contain the name of the proxy that was 91 // If true, |proxy_servers.first| will contain the name of the proxy that was
90 // used. |proxy_servers.second| will contain the name of the data reduction 92 // used. |proxy_servers.second| will contain the name of the data reduction
91 // proxy server that would be used if |proxy_server.first| is bypassed, if one 93 // proxy server that would be used if |proxy_server.first| is bypassed, if one
92 // exists. |proxy_servers| can be NULL if the caller isn't interested in its 94 // exists. |proxy_servers| can be NULL if the caller isn't interested in its
93 // values. 95 // values.
94 virtual bool WasDataReductionProxyUsed( 96 virtual bool WasDataReductionProxyUsed(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Returns true if any proxy origins are set on the command line. 202 // Returns true if any proxy origins are set on the command line.
201 bool is_configured_on_command_line() const { 203 bool is_configured_on_command_line() const {
202 return configured_on_command_line_; 204 return configured_on_command_line_;
203 } 205 }
204 206
205 protected: 207 protected:
206 // Test constructor that optionally won't call Init(); 208 // Test constructor that optionally won't call Init();
207 DataReductionProxyParams(int flags, 209 DataReductionProxyParams(int flags,
208 bool should_call_init); 210 bool should_call_init);
209 211
212 DataReductionProxyParams(const DataReductionProxyParams& params);
213
210 // Initialize the values of the proxies, and probe URL, from command 214 // Initialize the values of the proxies, and probe URL, from command
211 // line flags and preprocessor constants, and check that there are 215 // line flags and preprocessor constants, and check that there are
212 // corresponding definitions for the allowed configurations. 216 // corresponding definitions for the allowed configurations.
213 bool Init(bool allowed, bool fallback_allowed, bool alt_allowed); 217 bool Init(bool allowed, bool fallback_allowed, bool alt_allowed);
214 218
215 // Initialize the values of the proxies, and probe URL from command 219 // Initialize the values of the proxies, and probe URL from command
216 // line flags and preprocessor constants. 220 // line flags and preprocessor constants.
217 void InitWithoutChecks(); 221 void InitWithoutChecks();
218 222
219 // Returns the corresponding string from preprocessor constants if defined, 223 // Returns the corresponding string from preprocessor constants if defined,
(...skipping 24 matching lines...) Expand all
244 GURL alt_fallback_origin_; 248 GURL alt_fallback_origin_;
245 GURL probe_url_; 249 GURL probe_url_;
246 GURL warmup_url_; 250 GURL warmup_url_;
247 251
248 bool allowed_; 252 bool allowed_;
249 const bool fallback_allowed_; 253 const bool fallback_allowed_;
250 bool alt_allowed_; 254 bool alt_allowed_;
251 const bool promo_allowed_; 255 const bool promo_allowed_;
252 bool holdback_; 256 bool holdback_;
253 257
254 bool configured_on_command_line_; 258 bool configured_on_command_line_;
willchan no longer on Chromium 2014/07/31 22:31:35 Please declare a private operator=. I don't think
bengr 2014/08/02 01:10:32 Done.
255
256 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams);
257 }; 259 };
258 260
259 } // namespace data_reduction_proxy 261 } // namespace data_reduction_proxy
260 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H _ 262 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698