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_COMMON_DATA_REDUCTION_PROXY_HEADERS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_COMMON_DATA_REDUCTION_PROXY_HEADERS_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_COMMON_DATA_REDUCTION_PROXY_HEADERS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_COMMON_DATA_REDUCTION_PROXY_HEADERS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 // delay. Sets |proxy_info->bypass_duration| to the specified delay if greater | 30 // delay. Sets |proxy_info->bypass_duration| to the specified delay if greater |
31 // than 0, and to 0 otherwise to indicate that the default proxy delay | 31 // than 0, and to 0 otherwise to indicate that the default proxy delay |
32 // (as specified in |ProxyList::UpdateRetryInfoOnFallback|) should be used. | 32 // (as specified in |ProxyList::UpdateRetryInfoOnFallback|) should be used. |
33 // If all available data reduction proxies should by bypassed, |bypass_all| is | 33 // If all available data reduction proxies should by bypassed, |bypass_all| is |
34 // set to true. |proxy_info| must be non-NULL. | 34 // set to true. |proxy_info| must be non-NULL. |
35 bool GetDataReductionProxyInfo( | 35 bool GetDataReductionProxyInfo( |
36 const net::HttpResponseHeaders* headers, | 36 const net::HttpResponseHeaders* headers, |
37 DataReductionProxyInfo* proxy_info); | 37 DataReductionProxyInfo* proxy_info); |
38 | 38 |
39 // Returns true if the response contain the data reduction proxy Via header | 39 // Returns true if the response contain the data reduction proxy Via header |
40 // value. Used to check the integrity of data reduction proxy responses. | 40 // value. If data reduction proxy Via header value exists, set |is_the_last| |
bengr
2014/07/16 19:23:56
I can't parse this comment. How about:
// Returns
xingx
2014/07/16 21:22:33
Done.
| |
41 bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers); | 41 // as whether it occurs at the last if |is_the_last| is not NULL. Used to check |
42 // the integrity of data reduction proxy responses and whether there are other | |
43 // middleboxes between data reduction proxy and chrome. | |
44 bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers, | |
45 bool* is_the_last); | |
42 | 46 |
43 // Returns the reason why the Chrome proxy should be bypassed or not, and | 47 // Returns the reason why the Chrome proxy should be bypassed or not, and |
44 // populates |proxy_info| with information on how long to bypass if | 48 // populates |proxy_info| with information on how long to bypass if |
45 // applicable. | 49 // applicable. |
46 net::ProxyService::DataReductionProxyBypassEventType | 50 net::ProxyService::DataReductionProxyBypassEventType |
47 GetDataReductionProxyBypassEventType( | 51 GetDataReductionProxyBypassEventType( |
48 const net::HttpResponseHeaders* headers, | 52 const net::HttpResponseHeaders* headers, |
49 DataReductionProxyInfo* proxy_info); | 53 DataReductionProxyInfo* proxy_info); |
50 | 54 |
55 // Searches for the specified Chrome-Proxy action, and if present saves its | |
56 // value as a string in |action_value|. Only keeps the first one and ignores | |
57 // the rest if multiple actions match |action_prefix|. | |
58 bool GetDataReductionProxyActionValue( | |
59 const net::HttpResponseHeaders* headers, | |
60 const std::string& action_prefix, | |
61 std::string* action_value); | |
62 | |
51 // Searches for the specified Chrome-Proxy action, and if present interprets | 63 // Searches for the specified Chrome-Proxy action, and if present interprets |
52 // its value as a duration in seconds. | 64 // its value as a duration in seconds. |
53 bool GetDataReductionProxyBypassDuration( | 65 bool GetDataReductionProxyBypassDuration( |
54 const net::HttpResponseHeaders* headers, | 66 const net::HttpResponseHeaders* headers, |
55 const std::string& action_prefix, | 67 const std::string& action_prefix, |
56 base::TimeDelta* duration); | 68 base::TimeDelta* duration); |
57 | 69 |
58 } // namespace data_reduction_proxy | 70 } // namespace data_reduction_proxy |
59 #endif // COMPONENTS_DATA_REDUCTION_PROXY_COMMON_DATA_REDUCTION_PROXY_HEADERS_H _ | 71 #endif // COMPONENTS_DATA_REDUCTION_PROXY_COMMON_DATA_REDUCTION_PROXY_HEADERS_H _ |
OLD | NEW |