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

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

Issue 578883004: Added flag to enable the data reduction proxy alternative (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use forced enabled group Created 6 years, 3 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 "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/metrics/field_trial.h" 11 #include "base/metrics/field_trial.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h " 13 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h "
14 #include "net/base/host_port_pair.h" 14 #include "net/base/host_port_pair.h"
15 #include "net/proxy/proxy_config.h" 15 #include "net/proxy/proxy_config.h"
16 #include "net/proxy/proxy_info.h" 16 #include "net/proxy/proxy_info.h"
17 #include "net/proxy/proxy_retry_info.h" 17 #include "net/proxy/proxy_retry_info.h"
18 #include "net/proxy/proxy_server.h" 18 #include "net/proxy/proxy_server.h"
19 #include "net/proxy/proxy_service.h" 19 #include "net/proxy/proxy_service.h"
20 #include "net/url_request/url_request.h" 20 #include "net/url_request/url_request.h"
21 #include "net/url_request/url_request_context.h" 21 #include "net/url_request/url_request_context.h"
22 #include "url/url_constants.h" 22 #include "url/url_constants.h"
23 23
24 using base::FieldTrialList; 24 using base::FieldTrialList;
25 25
26 namespace { 26 namespace {
27 const char kEnabled[] = "Enabled"; 27 const char kEnabled[] = "Enabled";
28 const char kForcedEnabled[] = "Forced_Enabled";
28 } 29 }
29 30
30 namespace data_reduction_proxy { 31 namespace data_reduction_proxy {
31 32
32 // static 33 // static
33 bool DataReductionProxyParams::IsIncludedInFieldTrial() { 34 bool DataReductionProxyParams::IsIncludedInFieldTrial() {
34 return base::FieldTrialList::FindFullName( 35 return base::FieldTrialList::FindFullName(
35 "DataCompressionProxyRollout") == kEnabled; 36 "DataCompressionProxyRollout") == kEnabled;
36 } 37 }
37 38
38 // static 39 // static
39 bool DataReductionProxyParams::IsIncludedInAlternativeFieldTrial() { 40 bool DataReductionProxyParams::IsIncludedInAlternativeFieldTrial() {
40 return base::FieldTrialList::FindFullName( 41 return (
41 "DataCompressionProxyAlternativeConfiguration") == kEnabled; 42 base::FieldTrialList::FindFullName(
43 "DataCompressionProxyAlternativeConfiguration") == kEnabled ||
44 base::FieldTrialList::FindFullName(
45 "DataCompressionProxyAlternativeConfiguration") == kForcedEnabled);
Alexei Svitkine (slow) 2014/09/18 17:46:40 The go/finch-and-flags page actually doesn't say t
bengr 2014/09/18 19:28:33 Done. I think.
42 } 46 }
43 47
44 // static 48 // static
45 bool DataReductionProxyParams::IsIncludedInPromoFieldTrial() { 49 bool DataReductionProxyParams::IsIncludedInPromoFieldTrial() {
46 return FieldTrialList::FindFullName( 50 return FieldTrialList::FindFullName(
47 "DataCompressionProxyPromoVisibility") == kEnabled; 51 "DataCompressionProxyPromoVisibility") == kEnabled;
48 } 52 }
49 53
50 // static 54 // static
51 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() { 55 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 } 544 }
541 545
542 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { 546 std::string DataReductionProxyParams::GetDefaultWarmupURL() const {
543 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) 547 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL)
544 return DATA_REDUCTION_PROXY_WARMUP_URL; 548 return DATA_REDUCTION_PROXY_WARMUP_URL;
545 #endif 549 #endif
546 return std::string(); 550 return std::string();
547 } 551 }
548 552
549 } // namespace data_reduction_proxy 553 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698