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

Unified Diff: net/http/partial_data.h

Issue 1604011: Use HttpRequestHeaders for extra_headers. (Closed)
Patch Set: Address eroman comments. Created 10 years, 8 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 | « net/http/http_vary_data_unittest.cc ('k') | net/http/partial_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/partial_data.h
diff --git a/net/http/partial_data.h b/net/http/partial_data.h
index 3a30e0a064c2cb4db09cac09ee27bb2eced6ad38..51e6d7dbb51889971a0c9608ae080a575c6f4fae 100644
--- a/net/http/partial_data.h
+++ b/net/http/partial_data.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "net/base/completion_callback.h"
#include "net/http/http_byte_range.h"
+#include "net/http/http_request_headers.h"
namespace disk_cache {
class Entry;
@@ -36,19 +37,19 @@ class PartialData {
truncated_(false) {}
~PartialData() {}
- // Performs initialization of the object by parsing the request |headers|
+ // Performs initialization of the object by examining the request |headers|
// and verifying that we can process the requested range. Returns true if
// we can process the requested range, and false otherwise.
- bool Init(const std::string& headers);
+ bool Init(const HttpRequestHeaders& headers);
// Sets the headers that we should use to make byte range requests. This is a
// subset of the request extra headers, with byte-range related headers
// removed.
- void SetHeaders(const std::string& headers);
+ void SetHeaders(const HttpRequestHeaders& headers);
// Restores the byte-range headers, by appending the byte range to the headers
// provided to SetHeaders().
- void RestoreHeaders(std::string* headers) const;
+ void RestoreHeaders(HttpRequestHeaders* headers) const;
// Builds the required |headers| to perform the proper cache validation for
// the next range to be fetched. Returns 0 when there is no need to perform
@@ -56,7 +57,8 @@ class PartialData {
// should be actually returned to the user), a positive number to indicate
// that |headers| should be used to validate the cache, or an appropriate
// error code.
- int PrepareCacheValidation(disk_cache::Entry* entry, std::string* headers);
+ int PrepareCacheValidation(disk_cache::Entry* entry,
+ HttpRequestHeaders* headers);
// Returns true if the current range is stored in the cache.
bool IsCurrentRangeCached() const;
@@ -105,14 +107,13 @@ class PartialData {
void OnNetworkReadCompleted(int result);
private:
- static void AddRangeHeader(int64 start, int64 end, std::string* headers);
-
int64 current_range_start_;
int64 cached_start_;
int64 resource_size_;
int cached_min_len_;
HttpByteRange byte_range_; // The range requested by the user.
- std::string extra_headers_; // The clean set of extra headers (no ranges).
+ // The clean set of extra headers (no ranges).
+ HttpRequestHeaders extra_headers_;
bool range_present_; // True if next range entry is already stored.
bool final_range_;
bool sparse_entry_;
« no previous file with comments | « net/http/http_vary_data_unittest.cc ('k') | net/http/partial_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698