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

Unified Diff: net/http/http_response_headers.h

Issue 8511063: Improve merging of header modifications in webRequest.OnHeadersReceived (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled browser tests again Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/extension_webrequest_api_unittest.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers.h
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index 2cdc73e0855b806007e6e18a08eb98c563045147..c29964d61c54c3b4eafdef0311810908e511232f 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -63,6 +63,10 @@ class NET_EXPORT HttpResponseHeaders
// Removes all instances of a particular header.
void RemoveHeader(const std::string& name);
+ // Removes a particular header. The header name is compared
+ // case-insensitively.
+ void RemoveHeaderWithValue(const std::string& name, const std::string& value);
+
// Adds a particular header. |header| has to be a single header without any
// EOL termination, just [<header-name>: <header-values>]
// If a header with the same name is already stored, the two headers are not
@@ -300,6 +304,16 @@ class NET_EXPORT HttpResponseHeaders
void MergeWithHeaders(const std::string& raw_headers,
const HeaderSet& headers_to_remove);
+ // Replaces the current headers with the merged version of |raw_headers| and
+ // the current headers with out the header consisting of
+ // |header_to_remove_name| and |header_to_remove_value|. Note that
+ // |header_to_remove_name| is compared case-insensitively.
+ // Note that the header to remove is removed from the current headers (before
+ // the merge), not after the merge.
+ void MergeWithHeadersWithValue(const std::string& raw_headers,
+ const std::string& header_to_remove_name,
+ const std::string& header_to_remove_value);
+
// Adds the values from any 'cache-control: no-cache="foo,bar"' headers.
void AddNonCacheableHeaders(HeaderSet* header_names) const;
« no previous file with comments | « chrome/browser/extensions/extension_webrequest_api_unittest.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698