diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 23:36:33 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 23:36:33 +0000 |
commit | 28accfe389231216b005650593fb81857a788b50 (patch) | |
tree | f498a178308fad6b261b9123e3afb758dcb0d63e /net/http/http_cache.h | |
parent | 4ec516851c4f8990c048e6ffa9886dc6074d874a (diff) | |
download | chromium_src-28accfe389231216b005650593fb81857a788b50.zip chromium_src-28accfe389231216b005650593fb81857a788b50.tar.gz chromium_src-28accfe389231216b005650593fb81857a788b50.tar.bz2 |
Http Cache: Add support for resuming downloading a
resource after the original request was interrupted.
BUG=8995
TEST=unittests
Review URL: http://codereview.chromium.org/197016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache.h')
-rw-r--r-- | net/http/http_cache.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/http/http_cache.h b/net/http/http_cache.h index f1807b7..b6599b2 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -97,18 +97,23 @@ class HttpCache : public HttpTransactionFactory { virtual HttpCache* GetCache(); virtual void Suspend(bool suspend); - // Helper function for reading response info from the disk cache. + // Helper function for reading response info from the disk cache. If the + // cache doesn't have the whole resource *|request_truncated| is set to true. static bool ReadResponseInfo(disk_cache::Entry* disk_entry, - HttpResponseInfo* response_info); + HttpResponseInfo* response_info, + bool* response_truncated); - // Helper function for writing response info into the disk cache. + // Helper function for writing response info into the disk cache. If the + // cache doesn't have the whole resource |request_truncated| should be true. static bool WriteResponseInfo(disk_cache::Entry* disk_entry, const HttpResponseInfo* response_info, - bool skip_transient_headers); + bool skip_transient_headers, + bool response_truncated); // Given a header data blob, convert it to a response info object. static bool ParseResponseInfo(const char* data, int len, - HttpResponseInfo* response_info); + HttpResponseInfo* response_info, + bool* response_truncated); // Get/Set the cache's mode. void set_mode(Mode value) { mode_ = value; } @@ -162,7 +167,7 @@ class HttpCache : public HttpTransactionFactory { ActiveEntry* CreateEntry(const std::string& cache_key); void DestroyEntry(ActiveEntry* entry); int AddTransactionToEntry(ActiveEntry* entry, Transaction* trans); - void DoneWithEntry(ActiveEntry* entry, Transaction* trans); + void DoneWithEntry(ActiveEntry* entry, Transaction* trans, bool cancel); void DoneWritingToEntry(ActiveEntry* entry, bool success); void DoneReadingFromEntry(ActiveEntry* entry, Transaction* trans); void ConvertWriterToReader(ActiveEntry* entry); |