diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-08 21:39:23 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-08 21:39:23 +0000 |
commit | 31be98b016611afba449aace847074724f51e22d (patch) | |
tree | 88c7cf441d37d26a4f7eff0182669035aa8ae35c /webkit/appcache/appcache_database.h | |
parent | 349e8d271a90f15a4746412c93706cc9f78e4520 (diff) | |
download | chromium_src-31be98b016611afba449aace847074724f51e22d.zip chromium_src-31be98b016611afba449aace847074724f51e22d.tar.gz chromium_src-31be98b016611afba449aace847074724f51e22d.tar.bz2 |
Add a DeletableResponseIds table to the appcache database schema, groundwork for purging unused responses from the disk cache.
TEST=yes
BUG=none
Review URL: http://codereview.chromium.org/523157
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_database.h')
-rw-r--r-- | webkit/appcache/appcache_database.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_database.h b/webkit/appcache/appcache_database.h index 5f1713e..c492cae 100644 --- a/webkit/appcache/appcache_database.h +++ b/webkit/appcache/appcache_database.h @@ -72,7 +72,8 @@ class AppCacheDatabase { void CloseConnection(); bool FindOriginsWithGroups(std::set<GURL>* origins); bool FindLastStorageIds( - int64* last_group_id, int64* last_cache_id, int64* last_response_id); + int64* last_group_id, int64* last_cache_id, int64* last_response_id, + int64* last_deletable_response_rowid); bool FindGroup(int64 group_id, GroupRecord* record); bool FindGroupForManifestUrl(const GURL& manifest_url, GroupRecord* record); @@ -115,6 +116,11 @@ class AppCacheDatabase { const std::vector<OnlineWhiteListRecord>& records); bool DeleteOnlineWhiteListForCache(int64 cache_id); + bool GetDeletableResponseIds(std::vector<int64>* response_ids, + int64 max_rowid, int limit); + bool InsertDeletableResponseIds(const std::vector<int64>& response_ids); + bool DeleteDeletableResponseIds(const std::vector<int64>& response_ids); + // So our callers can wrap operations in transactions. sql::Connection* db_connection() { LazyOpen(true); @@ -122,6 +128,11 @@ class AppCacheDatabase { } private: + bool RunCachedStatementWithIds( + const sql::StatementID& statement_id, const char* sql, + const std::vector<int64>& ids); + bool RunUniqueStatementWithInt64Result(const char* sql, int64* result); + bool PrepareUniqueStatement(const char* sql, sql::Statement* statement); bool PrepareCachedStatement( const sql::StatementID& id, const char* sql, sql::Statement* statement); @@ -159,6 +170,7 @@ class AppCacheDatabase { FRIEND_TEST(AppCacheDatabaseTest, LazyOpen); FRIEND_TEST(AppCacheDatabaseTest, OnlineWhiteListRecords); FRIEND_TEST(AppCacheDatabaseTest, ReCreate); + FRIEND_TEST(AppCacheDatabaseTest, DeletableResponseIds); DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); }; |