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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc

Issue 467823002: Added support for 'Chrome-Proxy: block-once' header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased on master 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol. h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol. h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_tamper_de tection.h" 10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_tamper_de tection.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const net::ProxyRetryInfoMap& proxy_retry_info = 83 const net::ProxyRetryInfoMap& proxy_retry_info =
84 request->context()->proxy_service()->proxy_retry_info(); 84 request->context()->proxy_service()->proxy_retry_info();
85 if (proxy_retry_info.find(proxy_server.ToURI()) == proxy_retry_info.end()) { 85 if (proxy_retry_info.find(proxy_server.ToURI()) == proxy_retry_info.end()) {
86 DataReductionProxyUsageStats::RecordDataReductionProxyBypassInfo( 86 DataReductionProxyUsageStats::RecordDataReductionProxyBypassInfo(
87 !data_reduction_proxy_type_info.proxy_servers.second.is_empty(), 87 !data_reduction_proxy_type_info.proxy_servers.second.is_empty(),
88 data_reduction_proxy_info.bypass_all, 88 data_reduction_proxy_info.bypass_all,
89 proxy_server, 89 proxy_server,
90 bypass_type); 90 bypass_type);
91 } 91 }
92 92
93 MarkProxiesAsBadUntil(request, 93 if (data_reduction_proxy_info.mark_proxies_as_bad) {
94 data_reduction_proxy_info.bypass_duration, 94 MarkProxiesAsBadUntil(request,
95 data_reduction_proxy_info.bypass_all, 95 data_reduction_proxy_info.bypass_duration,
96 data_reduction_proxy_type_info.proxy_servers); 96 data_reduction_proxy_info.bypass_all,
97 data_reduction_proxy_type_info.proxy_servers);
98 }
97 99
98 // Only retry idempotent methods. 100 // Only retry idempotent methods.
99 if (!IsRequestIdempotent(request)) 101 if (!IsRequestIdempotent(request))
100 return false; 102 return false;
101 103
102 OverrideResponseAsRedirect(request, 104 OverrideResponseAsRedirect(request,
103 original_response_headers, 105 original_response_headers,
104 override_response_headers); 106 override_response_headers);
105 return true; 107 return true;
106 } 108 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 net::ProxyService* proxy_service = request->context()->proxy_service(); 181 net::ProxyService* proxy_service = request->context()->proxy_service();
180 DCHECK(proxy_service); 182 DCHECK(proxy_service);
181 183
182 proxy_service->MarkProxiesAsBadUntil(proxy_info, 184 proxy_service->MarkProxiesAsBadUntil(proxy_info,
183 bypass_duration, 185 bypass_duration,
184 fallback, 186 fallback,
185 request->net_log()); 187 request->net_log());
186 } 188 }
187 189
188 } // namespace data_reduction_proxy 190 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « no previous file | components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698