summaryrefslogtreecommitdiffstats
path: root/net/http/http_response_headers.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 21:30:40 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 21:30:40 +0000
commit95792eb13df32a536a13a5e8b712be06fb059457 (patch)
tree8c568f35dfa05071fb0e19d00fbb830791950468 /net/http/http_response_headers.h
parentf145b5a019b9a082ff0ce94ba94342bbd73f88b2 (diff)
downloadchromium_src-95792eb13df32a536a13a5e8b712be06fb059457.zip
chromium_src-95792eb13df32a536a13a5e8b712be06fb059457.tar.gz
chromium_src-95792eb13df32a536a13a5e8b712be06fb059457.tar.bz2
Http cache: Return valid Content-Range headers for a byte range request.
BUG=12258 TEST=unittests Review URL: http://codereview.chromium.org/140015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers.h')
-rw-r--r--net/http/http_response_headers.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index 1989d07..0552904 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -61,6 +61,16 @@ class HttpResponseHeaders :
// Performs header merging as described in 13.5.3 of RFC 2616.
void Update(const HttpResponseHeaders& new_headers);
+ // Removes all instances of a particular header.
+ void RemoveHeader(const std::string& name);
+
+ // 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
+ // merged together by this method; the one provided is simply put at the
+ // end of the list.
+ void AddHeader(const std::string& header);
+
// Creates a normalized header string. The output will be formatted exactly
// like so:
// HTTP/<version> <status_code> <status_text>\n
@@ -219,6 +229,8 @@ class HttpResponseHeaders :
private:
friend class base::RefCountedThreadSafe<HttpResponseHeaders>;
+ typedef base::hash_set<std::string> HeaderSet;
+
HttpResponseHeaders() {}
~HttpResponseHeaders() {}
@@ -260,7 +272,12 @@ class HttpResponseHeaders :
std::string::const_iterator value_begin,
std::string::const_iterator value_end);
- typedef base::hash_set<std::string> HeaderSet;
+ // Replaces the current headers with the merged version of |raw_headers| and
+ // the current headers without the headers in |headers_to_remove|. Note that
+ // |headers_to_remove| are removed from the current headers (before the
+ // merge), not after the merge.
+ void MergeWithHeaders(const std::string& raw_headers,
+ const HeaderSet& headers_to_remove);
// Adds the values from any 'cache-control: no-cache="foo,bar"' headers.
void AddNonCacheableHeaders(HeaderSet* header_names) const;