summaryrefslogtreecommitdiffstats
path: root/net/http/partial_data.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 00:53:41 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 00:53:41 +0000
commite5dad137bfa58430440138fbd76699d176fabc74 (patch)
tree2153c280bd7b6978b1c50456f415e5ee29cf8884 /net/http/partial_data.h
parent28b6b9a8ca66f94390e78214c2ad7acfa11f6b78 (diff)
downloadchromium_src-e5dad137bfa58430440138fbd76699d176fabc74.zip
chromium_src-e5dad137bfa58430440138fbd76699d176fabc74.tar.gz
chromium_src-e5dad137bfa58430440138fbd76699d176fabc74.tar.bz2
Http Cache: Additional byte-range support.
* Now we can serve byte range requests from cached 200s. * When we receive 304 we make sure that we were expecting it. * A range request that doesn't fit the currently stored entry only deletes the entry if the server confirms that it has changed. * Make sure that LOAD_ONLY_FROM_CACHE causes cache misses for byte range requests. BUG=12258 TEST=unittests Review URL: http://codereview.chromium.org/165479 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/partial_data.h')
-rw-r--r--net/http/partial_data.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/http/partial_data.h b/net/http/partial_data.h
index ade720d..460ff21 100644
--- a/net/http/partial_data.h
+++ b/net/http/partial_data.h
@@ -31,7 +31,8 @@ class IOBuffer;
// of those individual network / cache requests.
class PartialData {
public:
- PartialData() : range_present_(false), final_range_(false) {}
+ PartialData()
+ : range_present_(false), final_range_(false), sparse_entry_(true) {}
~PartialData() {}
// Performs initialization of the object by parsing the request |headers|
@@ -61,10 +62,13 @@ class PartialData {
bool IsLastRange() const;
// Extracts info from headers already stored in the cache. Returns false if
- // there is any problem with the headers or the requested range.
+ // there is any problem with the headers.
bool UpdateFromStoredHeaders(const HttpResponseHeaders* headers,
disk_cache::Entry* entry);
+ // Returns true if the requested range is valid given the stored data.
+ bool IsRequestedRangeOK();
+
// Returns true if the response headers match what we expect, false otherwise.
bool ResponseHeadersOK(const HttpResponseHeaders* headers);
@@ -106,6 +110,7 @@ class PartialData {
std::string extra_headers_; // The clean set of extra headers (no ranges).
bool range_present_; // True if next range entry is already stored.
bool final_range_;
+ bool sparse_entry_;
DISALLOW_COPY_AND_ASSIGN(PartialData);
};