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

Side by Side Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params.h

Issue 903213003: Enable QUIC for proxies based on Finch config and command line switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and removed code duplication. 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 #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
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 // Sets if QUIC is enabled for proxies. Also, may update the origin proxy
107 // server to a QUIC server.
108 void SetIsQuicEnabledForProxies(bool quic_enabled_for_proxies);
bengr 2015/02/10 20:18:31 void EnableQUIC(bool enable)
tbansal1 2015/02/10 22:24:39 Done.
109
102 // Constructs configuration parameters. If |kAllowed|, then the standard 110 // Constructs configuration parameters. If |kAllowed|, then the standard
103 // data reduction proxy configuration is allowed to be used. If 111 // data reduction proxy configuration is allowed to be used. If
104 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is 112 // |kfallbackAllowed| a fallback proxy can be used if the primary proxy is
105 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy 113 // bypassed or disabled. If |kAlternativeAllowed| then an alternative proxy
106 // configuration is allowed to be used. This alternative configuration would 114 // configuration is allowed to be used. This alternative configuration would
107 // replace the primary and fallback proxy configurations if enabled. Finally 115 // replace the primary and fallback proxy configurations if enabled. Finally
108 // if |kPromoAllowed|, the client may show a promotion for the data reduction 116 // if |kPromoAllowed|, the client may show a promotion for the data reduction
109 // proxy. 117 // proxy.
110 // 118 //
111 // A standard configuration has a primary proxy, and a fallback proxy for 119 // A standard configuration has a primary proxy, and a fallback proxy for
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 261
254 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the 262 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the
255 // list of data reduction proxies that may be used. 263 // list of data reduction proxies that may be used.
256 DataReductionProxyList GetAllowedProxies() const; 264 DataReductionProxyList GetAllowedProxies() const;
257 265
258 // Returns true if any proxy origins are set on the command line. 266 // Returns true if any proxy origins are set on the command line.
259 bool is_configured_on_command_line() const { 267 bool is_configured_on_command_line() const {
260 return configured_on_command_line_; 268 return configured_on_command_line_;
261 } 269 }
262 270
271 // Returns true if QUIC is enabled for proxies.
272 bool is_quic_enabled_for_proxies_() const {
bengr 2015/02/10 20:18:31 bool IsQUICEnabled() const;
tbansal1 2015/02/10 22:24:39 Done.
273 return quic_enabled_for_proxies_;
274 }
275
263 protected: 276 protected:
264 // Test constructor that optionally won't call Init(); 277 // Test constructor that optionally won't call Init();
265 DataReductionProxyParams(int flags, 278 DataReductionProxyParams(int flags,
266 bool should_call_init); 279 bool should_call_init);
267 280
268 DataReductionProxyParams(const DataReductionProxyParams& params); 281 DataReductionProxyParams(const DataReductionProxyParams& params);
269 282
270 // Initialize the values of the proxies, and probe URL, from command 283 // Initialize the values of the proxies, and probe URL, from command
271 // line flags and preprocessor constants, and check that there are 284 // line flags and preprocessor constants, and check that there are
272 // corresponding definitions for the allowed configurations. 285 // corresponding definitions for the allowed configurations.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 net::ProxyServer alt_fallback_origin_; 327 net::ProxyServer alt_fallback_origin_;
315 GURL probe_url_; 328 GURL probe_url_;
316 GURL warmup_url_; 329 GURL warmup_url_;
317 330
318 bool allowed_; 331 bool allowed_;
319 bool fallback_allowed_; 332 bool fallback_allowed_;
320 bool alt_allowed_; 333 bool alt_allowed_;
321 bool alt_fallback_allowed_; 334 bool alt_fallback_allowed_;
322 bool promo_allowed_; 335 bool promo_allowed_;
323 bool holdback_; 336 bool holdback_;
337 bool quic_enabled_for_proxies_;
338 std::string command_line_origin_;
324 339
325 bool configured_on_command_line_; 340 bool configured_on_command_line_;
326 }; 341 };
327 342
328 } // namespace data_reduction_proxy 343 } // namespace data_reduction_proxy
329 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PAR AMS_H_ 344 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PAR AMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698