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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc

Issue 2575323002: Store data reduction proxy server in a separate class (Closed)
Patch Set: ryansturm comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
index 5a9628821df15138e09fe33efcc30cfa03d8d6b6..d0974d90d6235fa9f75d0d7b747b3e88dcc1572a 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -28,6 +28,7 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_config_values.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_server.h"
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "components/variations/variations_associated_data.h"
#include "net/base/host_port_pair.h"
@@ -409,8 +410,9 @@ void DataReductionProxyConfig::ReloadConfig() {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(configurator_);
- const std::vector<net::ProxyServer>& proxies_for_http =
- config_values_->proxies_for_http();
+ const std::vector<net::ProxyServer> proxies_for_http =
+ DataReductionProxyServer::ConvertToNetProxyServers(
+ config_values_->proxies_for_http());
if (enabled_by_user_ && !config_values_->holdback() &&
!proxies_for_http.empty()) {
configurator_->Enable(!secure_proxy_allowed_ || is_captive_portal_,
@@ -436,8 +438,9 @@ bool DataReductionProxyConfig::IsDataReductionProxy(
if (!proxy_server.is_valid() || proxy_server.is_direct())
return false;
- const std::vector<net::ProxyServer>& proxy_list =
- config_values_->proxies_for_http();
+ const std::vector<net::ProxyServer> proxy_list =
+ DataReductionProxyServer::ConvertToNetProxyServers(
+ config_values_->proxies_for_http());
net::HostPortPair host_port_pair = proxy_server.host_port_pair();
const auto proxy_it =
@@ -1042,7 +1045,8 @@ base::TimeTicks DataReductionProxyConfig::GetTicksNow() const {
net::ProxyConfig DataReductionProxyConfig::ProxyConfigIgnoringHoldback() const {
std::vector<net::ProxyServer> proxies_for_http =
- config_values_->proxies_for_http();
+ DataReductionProxyServer::ConvertToNetProxyServers(
+ config_values_->proxies_for_http());
if (!enabled_by_user_ || proxies_for_http.empty())
return net::ProxyConfig::CreateDirect();
return configurator_->CreateProxyConfig(!secure_proxy_allowed_,

Powered by Google App Engine
This is Rietveld 408576698