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 #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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 "DataCompressionProxyPreconnectHints") == kEnabled; | 59 "DataCompressionProxyPreconnectHints") == kEnabled; |
60 } | 60 } |
61 | 61 |
62 // static | 62 // static |
63 bool DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() { | 63 bool DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() { |
64 return IsIncludedInFieldTrial() && | 64 return IsIncludedInFieldTrial() && |
65 FieldTrialList::FindFullName( | 65 FieldTrialList::FindFullName( |
66 "DataCompressionProxyCriticalBypass") == kEnabled; | 66 "DataCompressionProxyCriticalBypass") == kEnabled; |
67 } | 67 } |
68 | 68 |
| 69 // static |
| 70 bool DataReductionProxyParams::IsIncludedInHoldbackFieldTrial() { |
| 71 return FieldTrialList::FindFullName( |
| 72 "DataCompressionProxyHoldback") == kEnabled; |
| 73 } |
| 74 |
| 75 // static |
| 76 bool DataReductionProxyParams:: |
| 77 IsIncludedInRemoveMissingViaHeaderOtherBypassFieldTrial() { |
| 78 return FieldTrialList::FindFullName( |
| 79 "DataReductionProxyRemoveMissingViaHeaderOtherBypass") == kEnabled; |
| 80 } |
| 81 |
69 DataReductionProxyTypeInfo::DataReductionProxyTypeInfo() | 82 DataReductionProxyTypeInfo::DataReductionProxyTypeInfo() |
70 : proxy_servers(), | 83 : proxy_servers(), |
71 is_fallback(false), | 84 is_fallback(false), |
72 is_alternative(false), | 85 is_alternative(false), |
73 is_ssl(false) { | 86 is_ssl(false) { |
74 } | 87 } |
75 | 88 |
76 DataReductionProxyTypeInfo::~DataReductionProxyTypeInfo(){ | 89 DataReductionProxyTypeInfo::~DataReductionProxyTypeInfo(){ |
77 } | 90 } |
78 | 91 |
79 bool DataReductionProxyParams::IsIncludedInHoldbackFieldTrial() { | |
80 return FieldTrialList::FindFullName( | |
81 "DataCompressionProxyHoldback") == kEnabled; | |
82 } | |
83 | |
84 DataReductionProxyParams::DataReductionProxyParams(int flags) | 92 DataReductionProxyParams::DataReductionProxyParams(int flags) |
85 : allowed_((flags & kAllowed) == kAllowed), | 93 : allowed_((flags & kAllowed) == kAllowed), |
86 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), | 94 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), |
87 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), | 95 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), |
88 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), | 96 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), |
89 holdback_((flags & kHoldback) == kHoldback), | 97 holdback_((flags & kHoldback) == kHoldback), |
90 configured_on_command_line_(false) { | 98 configured_on_command_line_(false) { |
91 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); | 99 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); |
92 DCHECK(result); | 100 DCHECK(result); |
93 } | 101 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 533 } |
526 | 534 |
527 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { | 535 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { |
528 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) | 536 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) |
529 return DATA_REDUCTION_PROXY_WARMUP_URL; | 537 return DATA_REDUCTION_PROXY_WARMUP_URL; |
530 #endif | 538 #endif |
531 return std::string(); | 539 return std::string(); |
532 } | 540 } |
533 | 541 |
534 } // namespace data_reduction_proxy | 542 } // namespace data_reduction_proxy |
OLD | NEW |