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

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

Issue 1128823005: Update marking proxies as bad in ProxyList/ProxyService to use a std::vector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test failure Created 5 years, 7 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
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
index b2260502ed8fb5cbe3004fe2764c9c3267b98850..837b4b81320f29657d888cbf1d87d85f9bd47e16 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc
@@ -4,6 +4,8 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.h"
+#include <vector>
+
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
@@ -39,6 +41,7 @@ void MarkProxiesAsBadUntil(
// Synthesize a suitable |ProxyInfo| to add the proxies to the
// |ProxyRetryInfoMap| of the proxy service.
net::ProxyList proxy_list;
+ std::vector<net::ProxyServer> additional_bad_proxies;
net::ProxyServer primary = data_reduction_proxies.first;
if (primary.is_valid())
proxy_list.AddProxyServer(primary);
@@ -47,8 +50,10 @@ void MarkProxiesAsBadUntil(
if (data_reduction_proxies.second.is_valid() &&
!data_reduction_proxies.second.host_port_pair().IsEmpty())
fallback = data_reduction_proxies.second;
- if (fallback.is_valid())
+ if (fallback.is_valid()) {
proxy_list.AddProxyServer(fallback);
+ additional_bad_proxies.push_back(fallback);
+ }
proxy_list.AddProxyServer(net::ProxyServer::Direct());
}
net::ProxyInfo proxy_info;
@@ -57,10 +62,8 @@ void MarkProxiesAsBadUntil(
net::ProxyService* proxy_service = request->context()->proxy_service();
DCHECK(proxy_service);
- proxy_service->MarkProxiesAsBadUntil(proxy_info,
- bypass_duration,
- fallback,
- request->net_log());
+ proxy_service->MarkProxiesAsBadUntil(
+ proxy_info, bypass_duration, additional_bad_proxies, request->net_log());
}
} // namespace
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698