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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc

Issue 332313003: Add Finch experiment for selectively bypassing proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address bengr's feedback Created 6 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
index 2ec31e750924280bffa3c74a7e7d0787ca2fccd6..97ee818a78517d08993bf1702c1f2a8fb5a46252 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
@@ -18,6 +18,7 @@
#include "net/url_request/url_request_context.h"
#include "url/gurl.h"
+
namespace {
bool SetProxyServerFromGURL(const GURL& gurl,
net::ProxyServer* proxy_server) {
@@ -85,7 +86,20 @@ bool MaybeBypassProxyAndPrepareToRetry(
return true;
}
-
+void OnResolveProxyHandler(const GURL& url,
+ int load_flags,
+ const DataReductionProxyParams* params,
+ net::ProxyInfo* result) {
+ if ((load_flags & net::LOAD_BYPASS_DATA_REDUCTION_PROXY) &&
+ DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() &&
+ !result->is_empty() &&
+ !result->is_direct() &&
+ params &&
+ params->IsDataReductionProxy(
+ result->proxy_server().host_port_pair(), NULL)) {
+ result->UseDirect();
+ }
+}
bool IsRequestIdempotent(const net::URLRequest* request) {
DCHECK(request);

Powered by Google App Engine
This is Rietveld 408576698