| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 : allowed_((flags & kAllowed) == kAllowed), | 61 : allowed_((flags & kAllowed) == kAllowed), |
| 62 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), | 62 fallback_allowed_((flags & kFallbackAllowed) == kFallbackAllowed), |
| 63 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), | 63 alt_allowed_((flags & kAlternativeAllowed) == kAlternativeAllowed), |
| 64 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), | 64 promo_allowed_((flags & kPromoAllowed) == kPromoAllowed), |
| 65 holdback_((flags & kHoldback) == kHoldback), | 65 holdback_((flags & kHoldback) == kHoldback), |
| 66 configured_on_command_line_(false) { | 66 configured_on_command_line_(false) { |
| 67 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); | 67 bool result = Init(allowed_, fallback_allowed_, alt_allowed_); |
| 68 DCHECK(result); | 68 DCHECK(result); |
| 69 } | 69 } |
| 70 | 70 |
| 71 DataReductionProxyParams::DataReductionProxyParams( |
| 72 const DataReductionProxyParams& other) |
| 73 : origin_(other.origin_), |
| 74 fallback_origin_(other.fallback_origin_), |
| 75 ssl_origin_(other.ssl_origin_), |
| 76 alt_origin_(other.alt_origin_), |
| 77 alt_fallback_origin_(other.alt_fallback_origin_), |
| 78 probe_url_(other.probe_url_), |
| 79 warmup_url_(other.warmup_url_), |
| 80 allowed_(other.allowed_), |
| 81 fallback_allowed_(other.fallback_allowed_), |
| 82 alt_allowed_(other.alt_allowed_), |
| 83 promo_allowed_(other.promo_allowed_), |
| 84 holdback_(other.holdback_), |
| 85 configured_on_command_line_(other.configured_on_command_line_) { |
| 86 } |
| 87 |
| 71 DataReductionProxyParams::~DataReductionProxyParams() { | 88 DataReductionProxyParams::~DataReductionProxyParams() { |
| 72 } | 89 } |
| 73 | 90 |
| 74 DataReductionProxyParams::DataReductionProxyList | 91 DataReductionProxyParams::DataReductionProxyList |
| 75 DataReductionProxyParams::GetAllowedProxies() const { | 92 DataReductionProxyParams::GetAllowedProxies() const { |
| 76 DataReductionProxyList list; | 93 DataReductionProxyList list; |
| 77 if (allowed_) { | 94 if (allowed_) { |
| 78 list.push_back(origin_); | 95 list.push_back(origin_); |
| 79 // TODO(bolian): revert this once the proxy PAC fix is ready. | 96 // TODO(bolian): revert this once the proxy PAC fix is ready. |
| 80 if (GURL(GetDefaultDevOrigin()) == origin()) { | 97 if (GURL(GetDefaultDevOrigin()) == origin()) { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 396 } |
| 380 | 397 |
| 381 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { | 398 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { |
| 382 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) | 399 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) |
| 383 return DATA_REDUCTION_PROXY_WARMUP_URL; | 400 return DATA_REDUCTION_PROXY_WARMUP_URL; |
| 384 #endif | 401 #endif |
| 385 return std::string(); | 402 return std::string(); |
| 386 } | 403 } |
| 387 | 404 |
| 388 } // namespace data_reduction_proxy | 405 } // namespace data_reduction_proxy |
| OLD | NEW |