Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "net/proxy/proxy_service.h" | |
| 10 | 11 |
| 11 namespace base { | 12 namespace base { |
| 12 class TimeDelta; | 13 class TimeDelta; |
| 13 } | 14 } |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 class HttpResponseHeaders; | 17 class HttpResponseHeaders; |
| 17 class ProxyInfo; | 18 class ProxyInfo; |
| 18 class ProxyServer; | 19 class ProxyServer; |
| 19 class URLRequest; | 20 class URLRequest; |
| 20 } | 21 } |
| 21 | 22 |
| 22 class GURL; | 23 class GURL; |
| 23 | 24 |
| 24 namespace data_reduction_proxy { | 25 namespace data_reduction_proxy { |
| 25 | 26 |
| 26 class DataReductionProxyParams; | 27 class DataReductionProxyParams; |
| 27 | 28 |
| 28 // Decides whether to mark the data reduction proxy as temporarily bad and | 29 // Decides whether to mark the data reduction proxy as temporarily bad and |
| 29 // put it on the proxy retry list. Returns true if the request should be | 30 // put it on the proxy retry list. Returns true if the request should be |
| 30 // retried. Sets |override_response_headers| to redirect if so. | 31 // retried. Sets |override_response_headers| to redirect if so. |
| 31 bool MaybeBypassProxyAndPrepareToRetry( | 32 bool MaybeBypassProxyAndPrepareToRetry( |
| 33 net::ProxyService::DataReductionProxyBypassType* proxy_bypass_type, | |
|
bengr
2014/07/16 01:40:10
Explain in the comment what this new paramater is
megjablon
2014/07/16 23:07:14
Done.
| |
| 32 const DataReductionProxyParams* params, | 34 const DataReductionProxyParams* params, |
| 33 net::URLRequest* request, | 35 net::URLRequest* request, |
| 34 const net::HttpResponseHeaders* original_response_headers, | 36 const net::HttpResponseHeaders* original_response_headers, |
| 35 scoped_refptr<net::HttpResponseHeaders>* override_response_headers); | 37 scoped_refptr<net::HttpResponseHeaders>* override_response_headers); |
| 36 | 38 |
| 37 // Configure |result| to proceed directly to the origin if |result|'s current | 39 // Configure |result| to proceed directly to the origin if |result|'s current |
| 38 // proxy is the data reduction proxy, the | 40 // proxy is the data reduction proxy, the |
| 39 // |net::LOAD_BYPASS_DATA_REDUCTION_PROXY| |load_flag| is set, and the | 41 // |net::LOAD_BYPASS_DATA_REDUCTION_PROXY| |load_flag| is set, and the |
| 40 // DataCompressionProxyCriticalBypass Finch trial is set. | 42 // DataCompressionProxyCriticalBypass Finch trial is set. |
| 41 // This handler is intended to be invoked only by | 43 // This handler is intended to be invoked only by |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 62 // maintained by the proxy service of the request. Adds | 64 // maintained by the proxy service of the request. Adds |
| 63 // |data_reduction_proxies.second| to the retry list only if |bypass_all| is | 65 // |data_reduction_proxies.second| to the retry list only if |bypass_all| is |
| 64 // true. Visible as part of the public API for testing. | 66 // true. Visible as part of the public API for testing. |
| 65 void MarkProxiesAsBadUntil(net::URLRequest* request, | 67 void MarkProxiesAsBadUntil(net::URLRequest* request, |
| 66 base::TimeDelta& bypass_duration, | 68 base::TimeDelta& bypass_duration, |
| 67 bool bypass_all, | 69 bool bypass_all, |
| 68 const std::pair<GURL, GURL>& data_reduction_proxies); | 70 const std::pair<GURL, GURL>& data_reduction_proxies); |
| 69 | 71 |
| 70 } // namespace data_reduction_proxy | 72 } // namespace data_reduction_proxy |
| 71 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL _H_ | 73 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL _H_ |
| OLD | NEW |