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 "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" | 10 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 : allowed_((flags & kAllowed) == kAllowed), | 66 : allowed_((flags & kAllowed) == kAllowed), |
67 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), | 67 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), |
68 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), | 68 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), |
69 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), | 69 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), |
70 holdback_((flags & kHoldback) == kHoldback), | 70 holdback_((flags & kHoldback) == kHoldback), |
71 configured_on_command_line_(false) { | 71 configured_on_command_line_(false) { |
72 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); | 72 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); |
73 DCHECK(result); | 73 DCHECK(result); |
74 } | 74 } |
75 | 75 |
| 76 DataReductionProxyParams* DataReductionProxyParams::Clone() { |
| 77 return new DataReductionProxyParams(*this); |
| 78 } |
| 79 |
| 80 DataReductionProxyParams::DataReductionProxyParams( |
| 81 const DataReductionProxyParams& other) |
| 82 : origin_(other.origin_), |
| 83 fallback_origin_(other.fallback_origin_), |
| 84 ssl_origin_(other.ssl_origin_), |
| 85 alt_origin_(other.alt_origin_), |
| 86 alt_fallback_origin_(other.alt_fallback_origin_), |
| 87 probe_url_(other.probe_url_), |
| 88 warmup_url_(other.warmup_url_), |
| 89 allowed_(other.allowed_), |
| 90 fallback_allowed_(other.fallback_allowed_), |
| 91 alt_allowed_(other.alt_allowed_), |
| 92 promo_allowed_(other.promo_allowed_), |
| 93 holdback_(other.holdback_), |
| 94 configured_on_command_line_(other.configured_on_command_line_) { |
| 95 } |
| 96 |
76 DataReductionProxyParams::~DataReductionProxyParams() { | 97 DataReductionProxyParams::~DataReductionProxyParams() { |
77 } | 98 } |
78 | 99 |
79 DataReductionProxyParams::DataReductionProxyList | 100 DataReductionProxyParams::DataReductionProxyList |
80 DataReductionProxyParams::GetAllowedProxies() const { | 101 DataReductionProxyParams::GetAllowedProxies() const { |
81 DataReductionProxyList list; | 102 DataReductionProxyList list; |
82 if (allowed_) { | 103 if (allowed_) { |
83 list.push_back(origin_); | 104 list.push_back(origin_); |
84 // TODO(bolian): revert this once the proxy PAC fix is ready. | 105 // TODO(bolian): revert this once the proxy PAC fix is ready. |
85 if (GURL(GetDefaultDevOrigin()) == origin()) { | 106 if (GURL(GetDefaultDevOrigin()) == origin()) { |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } | 477 } |
457 | 478 |
458 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { | 479 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { |
459 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) | 480 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) |
460 return DATA_REDUCTION_PROXY_WARMUP_URL; | 481 return DATA_REDUCTION_PROXY_WARMUP_URL; |
461 #endif | 482 #endif |
462 return std::string(); | 483 return std::string(); |
463 } | 484 } |
464 | 485 |
465 } // namespace data_reduction_proxy | 486 } // namespace data_reduction_proxy |
OLD | NEW |