summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_response.h
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 22:25:33 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 22:25:33 +0000
commit0dfeec38d00d53b6751a937e43394d6036987698 (patch)
treeb8641d3bd07cbe185deb9f1dba29acb551bb92a2 /webkit/appcache/appcache_response.h
parentf1002ee286ad56e2b80736661e89989b650aad6e (diff)
downloadchromium_src-0dfeec38d00d53b6751a937e43394d6036987698.zip
chromium_src-0dfeec38d00d53b6751a937e43394d6036987698.tar.gz
chromium_src-0dfeec38d00d53b6751a937e43394d6036987698.tar.bz2
AppCache quota tracking groundwork, store response sizes in the SQL database.
TEST=updated existing unittests BUG=none Review URL: http://codereview.chromium.org/525060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_response.h')
-rw-r--r--webkit/appcache/appcache_response.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_response.h b/webkit/appcache/appcache_response.h
index 419e739..f8ffcc6 100644
--- a/webkit/appcache/appcache_response.h
+++ b/webkit/appcache/appcache_response.h
@@ -184,6 +184,9 @@ class AppCacheResponseWriter : public AppCacheResponseIO {
// Returns true if there is a write pending.
bool IsWritePending() { return IsIOPending(); }
+ // Returns the amount written, info and data.
+ int64 amount_written() { return info_size_ + write_position_; }
+
private:
friend class AppCacheStorageImpl;
friend class MockAppCacheStorage;
@@ -191,11 +194,12 @@ class AppCacheResponseWriter : public AppCacheResponseIO {
// Should only be constructed by the storage class.
AppCacheResponseWriter(int64 response_id, disk_cache::Backend* disk_cache)
: AppCacheResponseIO(response_id, disk_cache),
- write_position_(0), write_amount_(0) {}
+ info_size_(0), write_position_(0), write_amount_(0) {}
virtual void OnIOComplete(int result);
bool CreateEntryIfNeeded();
+ int info_size_;
int write_position_;
int write_amount_;
};