diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 00:29:51 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 00:29:51 +0000 |
commit | 49cd5dabaf1f0e520c9598a1176c3390091e74a0 (patch) | |
tree | ec5f627d008db3c53508908ff9c38e33922ef609 /webkit/database/database_tracker.h | |
parent | c01631a1fcc2827db01ddaacf4038e284d4af912 (diff) | |
download | chromium_src-49cd5dabaf1f0e520c9598a1176c3390091e74a0.zip chromium_src-49cd5dabaf1f0e520c9598a1176c3390091e74a0.tar.gz chromium_src-49cd5dabaf1f0e520c9598a1176c3390091e74a0.tar.bz2 |
Reapply 43381 - Add some safeguards in DatabaseTracker to prevent writing anything to disk for incognito. This time with more unit tests.
TEST=manual and database_tracker_unittest.cc
BUG=none
Review URL: http://codereview.chromium.org/1572017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database/database_tracker.h')
-rw-r--r-- | webkit/database/database_tracker.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/webkit/database/database_tracker.h b/webkit/database/database_tracker.h index f7468e4..9bad23b 100644 --- a/webkit/database/database_tracker.h +++ b/webkit/database/database_tracker.h @@ -26,6 +26,9 @@ class MetaTable; namespace webkit_database { +extern const FilePath::CharType kDatabaseDirectoryName[]; +extern const FilePath::CharType kTrackerDatabaseFileName[]; + class DatabasesTable; class QuotaTable; @@ -110,8 +113,6 @@ class DatabaseTracker void DatabaseClosed(const string16& origin_identifier, const string16& database_name); void CloseDatabases(const DatabaseConnections& connections); - void DeleteDatabaseIfNeeded(const string16& origin_identifier, - const string16& database_name); void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -120,7 +121,7 @@ class DatabaseTracker const FilePath& DatabaseDirectory() const { return db_dir_; } FilePath GetFullDBFilePath(const string16& origin_identifier, - const string16& database_name) const; + const string16& database_name); bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); void SetOriginQuota(const string16& origin_identifier, int64 new_quota); @@ -188,6 +189,8 @@ class DatabaseTracker bool DeleteClosedDatabase(const string16& origin_identifier, const string16& database_name); bool DeleteOrigin(const string16& origin_identifier); + void DeleteDatabaseIfNeeded(const string16& origin_identifier, + const string16& database_name); bool LazyInit(); bool UpgradeToCurrentVersion(); @@ -200,7 +203,7 @@ class DatabaseTracker CachedOriginInfo* GetCachedOriginInfo(const string16& origin_identifier); int64 GetDBFileSize(const string16& origin_identifier, - const string16& database_name) const; + const string16& database_name); int64 GetOriginSpaceAvailable(const string16& origin_identifier); @@ -213,7 +216,8 @@ class DatabaseTracker void ScheduleDatabasesForDeletion(const DatabaseSet& databases, net::CompletionCallback* callback); - bool initialized_; + bool is_initialized_; + const bool is_incognito_; const FilePath db_dir_; scoped_ptr<sql::Connection> db_; scoped_ptr<DatabasesTable> databases_table_; @@ -234,7 +238,8 @@ class DatabaseTracker // to quota_table_ every time an extention is loaded. std::map<string16, int64> in_memory_quotas_; - FRIEND_TEST(DatabaseTrackerTest, TestIt); + FRIEND_TEST(DatabaseTrackerTest, DatabaseTracker); + FRIEND_TEST(DatabaseTrackerTest, NoInitIncognito); }; } // namespace webkit_database |