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

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

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 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 4661367b041e1caa3b7075815377f12e2fb77511..e7e530ac5ec6e7a48d44f231db802495f59f9d52 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
@@ -247,7 +247,8 @@ DataReductionProxyConfig::DataReductionProxyConfig(
lofi_off_(false),
last_query_(base::TimeTicks::Now()),
network_quality_at_last_query_(NETWORK_QUALITY_AT_LAST_QUERY_UNKNOWN),
- previous_state_lofi_on_(false) {
+ previous_state_lofi_on_(false),
+ weak_factory_(this) {
DCHECK(configurator);
DCHECK(event_creator);
if (params::IsLoFiDisabledViaFlags())
@@ -548,13 +549,10 @@ bool DataReductionProxyConfig::UsingHTTPTunnel(
return config_values_->UsingHTTPTunnel(proxy_server);
}
-// Returns true if the Data Reduction Proxy configuration may be used.
bool DataReductionProxyConfig::allowed() const {
return config_values_->allowed();
}
-// Returns true if the Data Reduction Proxy promo may be shown. This is not
-// tied to whether the Data Reduction Proxy is enabled.
bool DataReductionProxyConfig::promo_allowed() const {
return config_values_->promo_allowed();
}
@@ -647,6 +645,29 @@ void DataReductionProxyConfig::HandleSecureProxyCheckResponse(
secure_proxy_allowed_ = false;
}
+void DataReductionProxyConfig::GetTrustedSpdyProxy(
+ net::ProxyServer* trusted_spdy_proxy) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ if (!params::IsIncludedInTrustedSpdyProxyFieldTrial())
+ return;
+
+ const std::vector<net::ProxyServer> proxies_for_http =
bengr 2016/01/11 22:29:35 Should this be a const std::vector<net::ProxyServe
tbansal1 2016/01/12 20:50:51 Done.
+ config_values_->proxies_for_http();
+ // Trusted SPDY proxy should be a valid HTTPS proxy.
+ if (enabled_by_user_ && proxies_for_http.size() >= 1 &&
+ proxies_for_http[0].is_valid() && proxies_for_http[0].is_https()) {
+ *trusted_spdy_proxy = proxies_for_http[0];
+ }
+}
+
+base::WeakPtr<net::TrustedSpdyProxyProvider>
+DataReductionProxyConfig::GetWeakPtr() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ return weak_factory_.GetWeakPtr();
+}
+
void DataReductionProxyConfig::OnIPAddressChanged() {
if (enabled_by_user_) {
DCHECK(config_values_->allowed());

Powered by Google App Engine
This is Rietveld 408576698