summaryrefslogtreecommitdiffstats
path: root/webkit/database/database_tracker.h
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 19:24:04 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 19:24:04 +0000
commit2b0ec8bb8b1d5e113ad072b27c3f157d985c6b21 (patch)
tree7fd39372550d1bbb60dba7483151344a06c3ca60 /webkit/database/database_tracker.h
parentd84ac11ef8abf2366f8544fe76db3cb0e645e177 (diff)
downloadchromium_src-2b0ec8bb8b1d5e113ad072b27c3f157d985c6b21.zip
chromium_src-2b0ec8bb8b1d5e113ad072b27c3f157d985c6b21.tar.gz
chromium_src-2b0ec8bb8b1d5e113ad072b27c3f157d985c6b21.tar.bz2
Ask renderers to immediately close all DB handles to a database file
when the file needs to be deleted. TEST=none BUG=none Review URL: http://codereview.chromium.org/594002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database/database_tracker.h')
-rw-r--r--webkit/database/database_tracker.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/webkit/database/database_tracker.h b/webkit/database/database_tracker.h
index 93a60e5..a6c7720 100644
--- a/webkit/database/database_tracker.h
+++ b/webkit/database/database_tracker.h
@@ -6,6 +6,7 @@
#define WEBKIT_DATABASE_DATABASE_TRACKER_H_
#include <map>
+#include <set>
#include "base/file_path.h"
#include "base/observer_list.h"
@@ -92,6 +93,9 @@ class DatabaseTracker
const string16& database_name,
int64 database_size,
int64 space_available) = 0;
+ virtual void OnDatabaseScheduledForDeletion(
+ const string16& origin_identifier,
+ const string16& database_name) = 0;
virtual ~Observer() {}
};
@@ -111,6 +115,8 @@ 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);
@@ -126,6 +132,8 @@ class DatabaseTracker
bool DeleteDatabase(const string16& origin_identifier,
const string16& database_name);
bool DeleteOrigin(const string16& origin_identifier);
+ bool IsDatabaseScheduledForDeletion(const string16& origin_identifier,
+ const string16& database_name);
// Delete any databases that have been touched since the cutoff date that's
// supplied. Returns net::OK on success, net::FAILED if not all databases
@@ -178,6 +186,8 @@ class DatabaseTracker
int64 UpdateCachedDatabaseFileSize(const string16& origin_identifier,
const string16& database_name);
+ void ScheduleDatabaseForDeletion(const string16& origin_identifier,
+ const string16& database_name);
bool initialized_;
const FilePath db_dir_;
@@ -189,6 +199,10 @@ class DatabaseTracker
std::map<string16, CachedOriginInfo> origins_info_map_;
DatabaseConnections database_connections_;
+ // The set of databases that should be deleted but are still opened
+ std::map<string16, std::set<string16> > dbs_to_be_deleted_;
+ net::CompletionCallback* dbs_deleted_callback_;
+
// Default quota for all origins; changed only by tests
int64 default_quota_;