| 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/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() { | 39 bool DataReductionProxyParams::IsIncludedInPreconnectHintingFieldTrial() { |
| 40 return IsIncludedInFieldTrial() && | 40 return IsIncludedInFieldTrial() && |
| 41 FieldTrialList::FindFullName( | 41 FieldTrialList::FindFullName( |
| 42 "DataCompressionProxyPreconnectHints") == kEnabled; | 42 "DataCompressionProxyPreconnectHints") == kEnabled; |
| 43 } | 43 } |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 bool DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() { |
| 47 return IsIncludedInFieldTrial() && |
| 48 FieldTrialList::FindFullName( |
| 49 "DataCompressionProxyCriticalBypass") == kEnabled; |
| 50 } |
| 51 |
| 52 // static |
| 46 bool DataReductionProxyParams::IsKeySetOnCommandLine() { | 53 bool DataReductionProxyParams::IsKeySetOnCommandLine() { |
| 47 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 54 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 48 return command_line.HasSwitch( | 55 return command_line.HasSwitch( |
| 49 data_reduction_proxy::switches::kEnableDataReductionProxy); | 56 data_reduction_proxy::switches::kEnableDataReductionProxy); |
| 50 } | 57 } |
| 51 | 58 |
| 52 DataReductionProxyParams::DataReductionProxyParams(int flags) | 59 DataReductionProxyParams::DataReductionProxyParams(int flags) |
| 53 : allowed_((flags & kAllowed) == kAllowed), | 60 : allowed_((flags & kAllowed) == kAllowed), |
| 54 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), | 61 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), |
| 55 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), | 62 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 } | 348 } |
| 342 | 349 |
| 343 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { | 350 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { |
| 344 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) | 351 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) |
| 345 return DATA_REDUCTION_PROXY_WARMUP_URL; | 352 return DATA_REDUCTION_PROXY_WARMUP_URL; |
| 346 #endif | 353 #endif |
| 347 return std::string(); | 354 return std::string(); |
| 348 } | 355 } |
| 349 | 356 |
| 350 } // namespace data_reduction_proxy | 357 } // namespace data_reduction_proxy |
| OLD | NEW |