Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc

Issue 2910723002: DRProxyDelegate should source it's proxy config from configurator
Patch Set: build fix Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698