Index: components/data_reduction_proxy/common/data_reduction_proxy_headers.h |
diff --git a/components/data_reduction_proxy/common/data_reduction_proxy_headers.h b/components/data_reduction_proxy/common/data_reduction_proxy_headers.h |
index 50aea244124d426967e822902758c962a8cebabe..84cb6f1178899f71959c56f7d123edae79b9222c 100644 |
--- a/components/data_reduction_proxy/common/data_reduction_proxy_headers.h |
+++ b/components/data_reduction_proxy/common/data_reduction_proxy_headers.h |
@@ -16,6 +16,11 @@ using net::ProxyService; |
namespace data_reduction_proxy { |
+extern const char kChromeProxyActionFingerprintChromeProxy[]; |
+extern const char kChromeProxyActionFingerprintVia[]; |
+extern const char kChromeProxyActionFingerprintOtherHeaders[]; |
+extern const char kChromeProxyActionFingerprintContentLength[]; |
+ |
// Contains instructions contained in the Chrome-Proxy header. |
struct DataReductionProxyInfo { |
DataReductionProxyInfo() : bypass_all(false) {} |
@@ -39,8 +44,12 @@ bool GetDataReductionProxyInfo( |
DataReductionProxyInfo* proxy_info); |
// Returns true if the response contain the data reduction proxy Via header |
-// value. Used to check the integrity of data reduction proxy responses. |
-bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers); |
+// value. If non-NULL, sets |has_intermediary| to true if another server added |
+// a Via header after the data reduction proxy, and to false otherwise. Used to |
+// check the integrity of data reduction proxy responses and whether there are |
+// other middleboxes between data reduction proxy and chrome. |
+bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers, |
+ bool* has_intermediary); |
// Returns the reason why the Chrome proxy should be bypassed or not, and |
// populates |proxy_info| with information on how long to bypass if |
@@ -49,6 +58,14 @@ ProxyService::DataReductionProxyBypassType GetDataReductionProxyBypassType( |
const net::HttpResponseHeaders* headers, |
DataReductionProxyInfo* proxy_info); |
+// Searches for the specified Chrome-Proxy action, and if present saves its |
+// value as a string in |action_value|. Only keeps the first one and ignores |
bolian
2014/07/28 22:59:18
s/keeps/returns/
xingx1
2014/07/29 00:47:40
Done.
|
+// the rest if multiple actions match |action_prefix|. |
+bool GetDataReductionProxyActionValue( |
+ const net::HttpResponseHeaders* headers, |
+ const std::string& action_prefix, |
+ std::string* action_value); |
+ |
// Searches for the specified Chrome-Proxy action, and if present interprets |
// its value as a duration in seconds. |
bool GetDataReductionProxyBypassDuration( |