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

Unified Diff: net/http/partial_data.cc

Issue 339088: Http cache: Always preserve extra headers when dealing with... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « net/http/partial_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/partial_data.cc
===================================================================
--- net/http/partial_data.cc (revision 30754)
+++ net/http/partial_data.cc (working copy)
@@ -22,8 +22,7 @@
namespace net {
-bool PartialData::Init(const std::string& headers,
- const std::string& new_headers) {
+bool PartialData::Init(const std::string& headers) {
std::vector<HttpByteRange> ranges;
if (!HttpUtil::ParseRanges(headers, &ranges) || ranges.size() != 1)
return false;
@@ -33,13 +32,16 @@
if (!byte_range_.IsValid())
return false;
- extra_headers_ = new_headers;
resource_size_ = 0;
-
current_range_start_ = byte_range_.first_byte_position();
return true;
}
+void PartialData::SetHeaders(const std::string& headers) {
+ DCHECK(extra_headers_.empty());
+ extra_headers_ = headers;
+}
+
void PartialData::RestoreHeaders(std::string* headers) const {
DCHECK(current_range_start_ >= 0 || byte_range_.IsSuffixByteRange());
int64 end = byte_range_.IsSuffixByteRange() ?
« no previous file with comments | « net/http/partial_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698