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

Unified Diff: net/http/http_response_headers.h

Issue 187583002: Cleanup: have common HttpResponseHeaders routine to update with range (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 6 years, 10 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
« no previous file with comments | « no previous file | net/http/http_response_headers.cc » ('j') | net/http/http_response_headers.cc » ('J')
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 deba3b6d974fd45c42f20d8b7f94b14182d1573f..dabc10aefa0305585cdafcf4908121003c1a78dc 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -26,6 +26,8 @@ class TimeDelta;
namespace net {
+class HttpByteRange;
+
// HttpResponseHeaders: parses and holds HTTP response headers.
class NET_EXPORT HttpResponseHeaders
: public base::RefCountedThreadSafe<HttpResponseHeaders> {
@@ -83,6 +85,14 @@ class NET_EXPORT HttpResponseHeaders
// not have any EOL).
void ReplaceStatusLine(const std::string& new_status);
+ // Updates headers (Content-Length and Content-Range) in the |headers| to
+ // include the right content length and range for |byte_range|. This also
+ // updates HTTP status line if |replace_status_line| is true. It is not valid
+ // to give invalid |byte_range|.
mmenke 2014/03/06 18:18:48 This also doesn't work for suffix byte ranges, or
rvargas (doing something else) 2014/03/06 19:24:00 Maybe the right message is that byte_range should
kinuko 2014/03/07 05:05:14 I tried to improve the comment... I'm still learni
+ void UpdateWithNewRange(const HttpByteRange& byte_range,
+ int64 resource_size,
+ bool replace_status_line);
+
// Creates a normalized header string. The output will be formatted exactly
// like so:
// HTTP/<version> <status_code> <status_text>\n
« no previous file with comments | « no previous file | net/http/http_response_headers.cc » ('j') | net/http/http_response_headers.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698