summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_database.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 03:50:42 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 03:50:42 +0000
commitee3cd175f8592b2b1f2ccd14b071d56ca733a5c6 (patch)
tree87a1e45bb6e93e1140a8719681fb653464bcea5e /webkit/appcache/appcache_database.cc
parentfd4882e6faab19e1de6d791acebfa3b34faf5701 (diff)
downloadchromium_src-ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6.zip
chromium_src-ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6.tar.gz
chromium_src-ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6.tar.bz2
Revert 35609 - AppCache quota tracking groundwork, store response sizes in the SQL database.
TEST=updated existing unittests BUG=none Review URL: http://codereview.chromium.org/523046 TBR=michaeln@chromium.org Review URL: http://codereview.chromium.org/525059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35610 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_database.cc')
-rw-r--r--webkit/appcache/appcache_database.cc30
1 files changed, 11 insertions, 19 deletions
diff --git a/webkit/appcache/appcache_database.cc b/webkit/appcache/appcache_database.cc
index 606d6c1..fd2a9e9 100644
--- a/webkit/appcache/appcache_database.cc
+++ b/webkit/appcache/appcache_database.cc
@@ -38,15 +38,13 @@ const struct {
"(cache_id INTEGER PRIMARY KEY,"
" group_id INTEGER,"
" online_wildcard INTEGER CHECK(online_wildcard IN (0, 1)),"
- " update_time INTEGER,"
- " cache_size INTEGER)" }, // intentionally not normalized
+ " update_time INTEGER)" },
{ kEntriesTable,
"(cache_id INTEGER,"
" url TEXT,"
" flags INTEGER,"
- " response_id INTEGER,"
- " response_size INTEGER)" },
+ " response_id INTEGER)" },
{ kFallbackNameSpacesTable,
"(cache_id INTEGER,"
@@ -317,7 +315,7 @@ bool AppCacheDatabase::FindCache(int64 cache_id, CacheRecord* record) {
return false;
const char* kSql =
- "SELECT cache_id, group_id, online_wildcard, update_time, cache_size"
+ "SELECT cache_id, group_id, online_wildcard, update_time"
" FROM Caches WHERE cache_id = ?";
sql::Statement statement;
@@ -338,7 +336,7 @@ bool AppCacheDatabase::FindCacheForGroup(int64 group_id, CacheRecord* record) {
return false;
const char* kSql =
- "SELECT cache_id, group_id, online_wildcard, update_time, cache_size"
+ "SELECT cache_id, group_id, online_wildcard, update_time"
" FROM Caches WHERE group_id = ?";
sql::Statement statement;
@@ -359,8 +357,8 @@ bool AppCacheDatabase::InsertCache(const CacheRecord* record) {
const char* kSql =
"INSERT INTO Caches (cache_id, group_id, online_wildcard,"
- " update_time, cache_size)"
- " VALUES(?, ?, ?, ?, ?)";
+ " update_time)"
+ " VALUES(?, ?, ?, ?)";
sql::Statement statement;
if (!PrepareCachedStatement(SQL_FROM_HERE, kSql, &statement))
@@ -376,8 +374,6 @@ bool AppCacheDatabase::InsertCache(const CacheRecord* record) {
statement.BindInt64(3,
(record->update_time - base::TimeTicks()).InMicroseconds());
- statement.BindInt64(4, record->cache_size);
-
return statement.Run();
}
@@ -403,7 +399,7 @@ bool AppCacheDatabase::FindEntriesForCache(
return false;
const char* kSql =
- "SELECT cache_id, url, flags, response_id, response_size FROM Entries"
+ "SELECT cache_id, url, flags, response_id FROM Entries"
" WHERE cache_id = ?";
sql::Statement statement;
@@ -427,7 +423,7 @@ bool AppCacheDatabase::FindEntriesForUrl(
return false;
const char* kSql =
- "SELECT cache_id, url, flags, response_id, response_size FROM Entries"
+ "SELECT cache_id, url, flags, response_id FROM Entries"
" WHERE url = ?";
sql::Statement statement;
@@ -452,7 +448,7 @@ bool AppCacheDatabase::FindEntry(
return false;
const char* kSql =
- "SELECT cache_id, url, flags, response_id, response_size FROM Entries"
+ "SELECT cache_id, url, flags, response_id FROM Entries"
" WHERE cache_id = ? AND url = ?";
sql::Statement statement;
@@ -475,8 +471,8 @@ bool AppCacheDatabase::InsertEntry(const EntryRecord* record) {
return false;
const char* kSql =
- "INSERT INTO Entries (cache_id, url, flags, response_id, response_size)"
- " VALUES(?, ?, ?, ?, ?)";
+ "INSERT INTO Entries (cache_id, url, flags, response_id)"
+ " VALUES(?, ?, ?, ?)";
sql::Statement statement;
if (!PrepareCachedStatement(SQL_FROM_HERE, kSql, &statement))
@@ -486,7 +482,6 @@ bool AppCacheDatabase::InsertEntry(const EntryRecord* record) {
statement.BindString(1, record->url.spec());
statement.BindInt(2, record->flags);
statement.BindInt64(3, record->response_id);
- statement.BindInt64(4, record->response_size);
return statement.Run();
}
@@ -733,8 +728,6 @@ void AppCacheDatabase::ReadCacheRecord(
// as an intermediary step.
record->update_time = base::TimeTicks() +
base::TimeDelta::FromMicroseconds(statement.ColumnInt64(3));
-
- record->cache_size = statement.ColumnInt64(4);
}
void AppCacheDatabase::ReadEntryRecord(
@@ -743,7 +736,6 @@ void AppCacheDatabase::ReadEntryRecord(
record->url = GURL(statement.ColumnString(1));
record->flags = statement.ColumnInt(2);
record->response_id = statement.ColumnInt64(3);
- record->response_size = statement.ColumnInt64(4);
}
void AppCacheDatabase::ReadFallbackNameSpaceRecord(