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

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

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Created 6 years, 4 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 7d1f92c826ff3f66e48cfe2602cc09060393dea8..9e0a82ccf38ce050a8e70be71908b51e379494d0 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
@@ -11,8 +11,10 @@
#include "components/data_reduction_proxy/common/data_reduction_proxy_headers.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
+#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_info.h"
#include "net/proxy/proxy_list.h"
+#include "net/proxy/proxy_retry_info.h"
#include "net/proxy/proxy_server.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request.h"
@@ -102,8 +104,19 @@ bool MaybeBypassProxyAndPrepareToRetry(
void OnResolveProxyHandler(const GURL& url,
int load_flags,
+ const net::ProxyConfig& data_reduction_proxy_config,
+ const net::ProxyRetryInfoMap& proxy_retry_info,
const DataReductionProxyParams* params,
net::ProxyInfo* result) {
+ if (data_reduction_proxy_config.is_valid() &&
+ result->proxy_server().is_direct()) {
+ net::ProxyInfo data_reduction_proxy_info;
+ data_reduction_proxy_config.proxy_rules().Apply(
+ url, &data_reduction_proxy_info);
+ data_reduction_proxy_info.DeprioritizeBadProxies(proxy_retry_info);
+ result->Use(data_reduction_proxy_info);
+ }
+
if ((load_flags & net::LOAD_BYPASS_DATA_REDUCTION_PROXY) &&
DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() &&
!result->is_empty() &&

Powered by Google App Engine
This is Rietveld 408576698