Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS _H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS _H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS _H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 // response with a data reduction proxy via header has been received through | 92 // response with a data reduction proxy via header has been received through |
| 93 // the proxy since the last network change, then don't bypass on missing via | 93 // the proxy since the last network change, then don't bypass on missing via |
| 94 // headers in responses with non-4xx response codes. | 94 // headers in responses with non-4xx response codes. |
| 95 static bool IsIncludedInRelaxMissingViaHeaderOtherBypassFieldTrial(); | 95 static bool IsIncludedInRelaxMissingViaHeaderOtherBypassFieldTrial(); |
| 96 | 96 |
| 97 // Returns true if this client is part of the field trial that should display | 97 // Returns true if this client is part of the field trial that should display |
| 98 // a promotion for the data reduction proxy on Android One devices. | 98 // a promotion for the data reduction proxy on Android One devices. |
| 99 static bool IsIncludedInAndroidOnePromoFieldTrial( | 99 static bool IsIncludedInAndroidOnePromoFieldTrial( |
| 100 const char* build_fingerprint); | 100 const char* build_fingerprint); |
| 101 | 101 |
| 102 // Returns true if this client is part of a field trial that sets the origin | |
| 103 // proxy server as quic://proxy.googlezip.net. | |
| 104 static bool IsIncludedInUseQUICFieldTrial(); | |
| 105 | |
| 106 static std::string GetFieldTrialName(); | |
| 107 | |
| 108 // Sets if QUIC is enabled for proxies. Also, may update the origin proxy | |
|
bengr
2015/02/11 23:57:28
What do you mean by 'may'? Can't you just say:
//
tbansal1
2015/02/12 02:27:22
Done.
| |
| 109 // server to a QUIC server. | |
| 110 void EnableQUIC(bool quic_enabled_for_proxies); | |
| 111 | |
| 102 // Constructs configuration parameters. If |kAllowed|, then the standard | 112 // Constructs configuration parameters. If |kAllowed|, then the standard |
| 103 // data reduction proxy configuration is allowed to be used. If | 113 // data reduction proxy configuration is allowed to be used. If |
| 104 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is | 114 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is |
| 105 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy | 115 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy |
| 106 // configuration is allowed to be used. This alternative configuration would | 116 // configuration is allowed to be used. This alternative configuration would |
| 107 // replace the primary and fallback proxy configurations if enabled. Finally | 117 // replace the primary and fallback proxy configurations if enabled. Finally |
| 108 // if |kPromoAllowed|, the client may show a promotion for the data reduction | 118 // if |kPromoAllowed|, the client may show a promotion for the data reduction |
| 109 // proxy. | 119 // proxy. |
| 110 // | 120 // |
| 111 // A standard configuration has a primary proxy, and a fallback proxy for | 121 // A standard configuration has a primary proxy, and a fallback proxy for |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 | 263 |
| 254 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the | 264 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the |
| 255 // list of data reduction proxies that may be used. | 265 // list of data reduction proxies that may be used. |
| 256 DataReductionProxyList GetAllowedProxies() const; | 266 DataReductionProxyList GetAllowedProxies() const; |
| 257 | 267 |
| 258 // Returns true if any proxy origins are set on the command line. | 268 // Returns true if any proxy origins are set on the command line. |
| 259 bool is_configured_on_command_line() const { | 269 bool is_configured_on_command_line() const { |
| 260 return configured_on_command_line_; | 270 return configured_on_command_line_; |
| 261 } | 271 } |
| 262 | 272 |
| 273 // Returns true if QUIC is enabled for proxies. | |
| 274 bool IsQUICEnabled() const { | |
|
bengr
2015/02/11 23:57:28
IsQuicEnabled
tbansal1
2015/02/12 02:27:22
Done.
| |
| 275 return quic_enabled_for_proxies_; | |
| 276 } | |
| 277 | |
| 263 protected: | 278 protected: |
| 264 // Test constructor that optionally won't call Init(); | 279 // Test constructor that optionally won't call Init(); |
| 265 DataReductionProxyParams(int flags, | 280 DataReductionProxyParams(int flags, |
| 266 bool should_call_init); | 281 bool should_call_init); |
| 267 | 282 |
| 268 DataReductionProxyParams(const DataReductionProxyParams& params); | 283 DataReductionProxyParams(const DataReductionProxyParams& params); |
| 269 | 284 |
| 270 // Initialize the values of the proxies, and probe URL, from command | 285 // Initialize the values of the proxies, and probe URL, from command |
| 271 // line flags and preprocessor constants, and check that there are | 286 // line flags and preprocessor constants, and check that there are |
| 272 // corresponding definitions for the allowed configurations. | 287 // corresponding definitions for the allowed configurations. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 net::ProxyServer alt_fallback_origin_; | 329 net::ProxyServer alt_fallback_origin_; |
| 315 GURL probe_url_; | 330 GURL probe_url_; |
| 316 GURL warmup_url_; | 331 GURL warmup_url_; |
| 317 | 332 |
| 318 bool allowed_; | 333 bool allowed_; |
| 319 bool fallback_allowed_; | 334 bool fallback_allowed_; |
| 320 bool alt_allowed_; | 335 bool alt_allowed_; |
| 321 bool alt_fallback_allowed_; | 336 bool alt_fallback_allowed_; |
| 322 bool promo_allowed_; | 337 bool promo_allowed_; |
| 323 bool holdback_; | 338 bool holdback_; |
| 339 bool quic_enabled_for_proxies_; | |
|
bengr
2015/02/11 23:57:28
quic_enabled_
tbansal1
2015/02/12 02:27:22
Done.
| |
| 340 std::string command_line_origin_; | |
| 324 | 341 |
| 325 bool configured_on_command_line_; | 342 bool configured_on_command_line_; |
| 326 }; | 343 }; |
| 327 | 344 |
| 328 } // namespace data_reduction_proxy | 345 } // namespace data_reduction_proxy |
| 329 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PAR AMS_H_ | 346 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PAR AMS_H_ |
| OLD | NEW |