| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" | 9 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" |
| 10 #include "net/proxy/proxy_info.h" | 10 #include "net/proxy/proxy_info.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 "DataCompressionProxyPromoVisibility") == kEnabled; | 38 "DataCompressionProxyPromoVisibility") == kEnabled; |
| 39 } | 39 } |
| 40 | 40 |
| 41 // static | 41 // static |
| 42 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() { | 42 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() { |
| 43 return IsIncludedInFieldTrial() && | 43 return IsIncludedInFieldTrial() && |
| 44 FieldTrialList::FindFullName( | 44 FieldTrialList::FindFullName( |
| 45 "DataCompressionProxyPreconnectHints") == kEnabled; | 45 "DataCompressionProxyPreconnectHints") == kEnabled; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // static |
| 49 bool DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() { |
| 50 return IsIncludedInFieldTrial() && |
| 51 FieldTrialList::FindFullName( |
| 52 "DataCompressionProxyCriticalBypass") == kEnabled; |
| 53 } |
| 54 |
| 48 DataReductionProxyParams::DataReductionProxyParams(int flags) | 55 DataReductionProxyParams::DataReductionProxyParams(int flags) |
| 49 : allowed_((flags & kAllowed) == kAllowed), | 56 : allowed_((flags & kAllowed) == kAllowed), |
| 50 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), | 57 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), |
| 51 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), | 58 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), |
| 52 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), | 59 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), |
| 53 configured_on_command_line_(false) { | 60 configured_on_command_line_(false) { |
| 54 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); | 61 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); |
| 55 DCHECK(result); | 62 DCHECK(result); |
| 56 } | 63 } |
| 57 | 64 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 372 } |
| 366 | 373 |
| 367 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { | 374 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { |
| 368 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) | 375 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) |
| 369 return DATA_REDUCTION_PROXY_WARMUP_URL; | 376 return DATA_REDUCTION_PROXY_WARMUP_URL; |
| 370 #endif | 377 #endif |
| 371 return std::string(); | 378 return std::string(); |
| 372 } | 379 } |
| 373 | 380 |
| 374 } // namespace data_reduction_proxy | 381 } // namespace data_reduction_proxy |
| OLD | NEW |