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

Unified Diff: components/data_reduction_proxy/common/data_reduction_proxy_headers.h

Issue 387353003: Modify data_reduction_proxy_header to support tamper detection logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@work
Patch Set: Modify HasDataReductionProxyViaHeader to tell whether data reduction proxy occurs at last or not. Created 6 years, 5 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
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 88b0cd054b8423d83d01beeb78fe7d0be5a6ce6d..f356df6d164681bf3949d156714aa9c63b5ede32 100644
--- a/components/data_reduction_proxy/common/data_reduction_proxy_headers.h
+++ b/components/data_reduction_proxy/common/data_reduction_proxy_headers.h
@@ -37,8 +37,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 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.
+// as whether it occurs at the last if |is_the_last| is not NULL. 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* is_the_last);
// Returns the reason why the Chrome proxy should be bypassed or not, and
// populates |proxy_info| with information on how long to bypass if
@@ -48,6 +52,14 @@ GetDataReductionProxyBypassEventType(
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
+// 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(

Powered by Google App Engine
This is Rietveld 408576698