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/core/browser/data_reduction_proxy_dele
gate.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_dele
gate.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 DCHECK(thread_checker_.CalledOnValidThread()); | 79 DCHECK(thread_checker_.CalledOnValidThread()); |
80 | 80 |
81 ResourceTypeProvider::ContentType content_type = | 81 ResourceTypeProvider::ContentType content_type = |
82 ResourceTypeProvider::CONTENT_TYPE_UNKNOWN; | 82 ResourceTypeProvider::CONTENT_TYPE_UNKNOWN; |
83 | 83 |
84 if (io_data_ && io_data_->resource_type_provider()) { | 84 if (io_data_ && io_data_->resource_type_provider()) { |
85 content_type = io_data_->resource_type_provider()->GetContentType(url); | 85 content_type = io_data_->resource_type_provider()->GetContentType(url); |
86 } | 86 } |
87 | 87 |
88 std::vector<DataReductionProxyServer> proxies_for_http = | 88 std::vector<DataReductionProxyServer> proxies_for_http = |
89 config_->GetProxiesForHttp(); | 89 params::IsIncludedInHoldbackFieldTrial() |
| 90 ? std::vector<DataReductionProxyServer>() |
| 91 : config_->GetProxiesForHttp(); |
90 | 92 |
91 // Remove the proxies that are unsupported for this request. | 93 // Remove the proxies that are unsupported for this request. |
92 proxies_for_http.erase( | 94 proxies_for_http.erase( |
93 std::remove_if(proxies_for_http.begin(), proxies_for_http.end(), | 95 std::remove_if(proxies_for_http.begin(), proxies_for_http.end(), |
94 [content_type](const DataReductionProxyServer& proxy) { | 96 [content_type](const DataReductionProxyServer& proxy) { |
95 return !proxy.SupportsResourceType(content_type); | 97 return !proxy.SupportsResourceType(content_type); |
96 }), | 98 }), |
97 proxies_for_http.end()); | 99 proxies_for_http.end()); |
98 | 100 |
99 net::ProxyConfig proxy_config = configurator_->CreateProxyConfig( | 101 net::ProxyConfig proxy_config = configurator_->CreateProxyConfig( |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if (data_reduction_proxy_config.enabled_by_user_and_reachable() && | 278 if (data_reduction_proxy_config.enabled_by_user_and_reachable() && |
277 url.SchemeIs(url::kHttpScheme) && !net::IsLocalhost(url.host_piece()) && | 279 url.SchemeIs(url::kHttpScheme) && !net::IsLocalhost(url.host_piece()) && |
278 !params::IsIncludedInHoldbackFieldTrial()) { | 280 !params::IsIncludedInHoldbackFieldTrial()) { |
279 UMA_HISTOGRAM_BOOLEAN( | 281 UMA_HISTOGRAM_BOOLEAN( |
280 "DataReductionProxy.ConfigService.HTTPRequests", | 282 "DataReductionProxy.ConfigService.HTTPRequests", |
281 !data_reduction_proxy_config.GetProxiesForHttp().empty()); | 283 !data_reduction_proxy_config.GetProxiesForHttp().empty()); |
282 } | 284 } |
283 } | 285 } |
284 | 286 |
285 } // namespace data_reduction_proxy | 287 } // namespace data_reduction_proxy |
OLD | NEW |