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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.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: Added net/base/test_proxy_delegate.{h,cc} 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_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
index b137580aeff3aabaeebaa29b2a64e7271dd4210b..462571bb41c905a94683626f9ba8f5b686b90238 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
@@ -9,9 +9,11 @@
#include "base/metrics/sparse_histogram.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "net/base/host_port_pair.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
+#include "net/proxy/proxy_server.h"
namespace data_reduction_proxy {
@@ -61,6 +63,17 @@ void DataReductionProxyDelegate::OnBeforeTunnelRequest(
proxy_server, extra_headers);
}
+bool DataReductionProxyDelegate::IsTrustedSpdyProxy(
+ const net::ProxyServer& proxy_server) {
+ if (!proxy_server.is_https() ||
+ !params::IsIncludedInTrustedSpdyProxyFieldTrial() ||
+ !proxy_server.is_valid()) {
+ return false;
+ }
+ return config_ &&
+ config_->IsDataReductionProxy(proxy_server.host_port_pair(), nullptr);
+}
+
void DataReductionProxyDelegate::OnTunnelHeadersReceived(
const net::HostPortPair& origin,
const net::HostPortPair& proxy_server,

Powered by Google App Engine
This is Rietveld 408576698