summaryrefslogtreecommitdiffstats
path: root/webkit/database
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 18:45:45 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 18:45:45 +0000
commit44d6da87c14860edf8350b4af5d66a3cf59dfda5 (patch)
treedff42211837600c4eb0af2eeecce02f278b4909a /webkit/database
parent84e8bdeaaf5c35c0e55dd9eca21422e7bfdc588f (diff)
downloadchromium_src-44d6da87c14860edf8350b4af5d66a3cf59dfda5.zip
chromium_src-44d6da87c14860edf8350b4af5d66a3cf59dfda5.tar.gz
chromium_src-44d6da87c14860edf8350b4af5d66a3cf59dfda5.tar.bz2
Revert r42467: "Clear cookies, local storage and databases when an extension gets uninstalled."
It introduced a memory leak, causing a regression on valgrind test: unit. TBR=jochen Review URL: http://codereview.chromium.org/1295001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database')
-rw-r--r--webkit/database/database_tracker.cc60
-rw-r--r--webkit/database/database_tracker.h10
2 files changed, 10 insertions, 60 deletions
diff --git a/webkit/database/database_tracker.cc b/webkit/database/database_tracker.cc
index ea1994e..bc7dd47 100644
--- a/webkit/database/database_tracker.cc
+++ b/webkit/database/database_tracker.cc
@@ -420,22 +420,6 @@ void DatabaseTracker::ScheduleDatabaseForDeletion(
origin_identifier, database_name));
}
-void DatabaseTracker::ScheduleDatabasesForDeletion(
- const DatabaseSet& databases,
- net::CompletionCallback* callback) {
- DCHECK(!callback ||
- deletion_callbacks_.find(callback) == deletion_callbacks_.end());
- DCHECK(!databases.empty());
- if (callback)
- deletion_callbacks_[callback] = databases;
- for (DatabaseSet::const_iterator ori = databases.begin();
- ori != databases.end(); ++ori) {
- for (std::set<string16>::const_iterator db = ori->second.begin();
- db != ori->second.end(); ++db)
- ScheduleDatabaseForDeletion(ori->first, *db);
- }
-}
-
int DatabaseTracker::DeleteDatabase(const string16& origin_identifier,
const string16& database_name,
net::CompletionCallback* callback) {
@@ -493,42 +477,18 @@ int DatabaseTracker::DeleteDataModifiedSince(
}
}
- if (rv != net::OK)
- return rv;
-
- if (!to_be_deleted.empty()) {
- ScheduleDatabasesForDeletion(to_be_deleted, callback);
- return net::ERR_IO_PENDING;
- }
- return net::OK;
-}
-
-int DatabaseTracker::DeleteDataForOrigin(const string16& origin,
- net::CompletionCallback* callback) {
- if (!LazyInit())
- return net::ERR_FAILED;
-
- DCHECK(!callback ||
- deletion_callbacks_.find(callback) == deletion_callbacks_.end());
- DatabaseSet to_be_deleted;
-
- std::vector<DatabaseDetails> details;
- if (!databases_table_->GetAllDatabaseDetailsForOrigin(origin, &details))
- return net::ERR_FAILED;
- for (std::vector<DatabaseDetails>::const_iterator db = details.begin();
- db != details.end(); ++db) {
- // Check if the database is opened by any renderer.
- if (database_connections_.IsDatabaseOpened(origin, db->database_name))
- to_be_deleted[origin].insert(db->database_name);
- else
- DeleteClosedDatabase(origin, db->database_name);
- }
-
if (!to_be_deleted.empty()) {
- ScheduleDatabasesForDeletion(to_be_deleted, callback);
- return net::ERR_IO_PENDING;
+ if (callback)
+ deletion_callbacks_[callback] = to_be_deleted;
+ for (DatabaseSet::iterator ori = to_be_deleted.begin();
+ ori != to_be_deleted.end(); ++ori) {
+ for (std::set<string16>::iterator db = ori->second.begin();
+ db != ori->second.end(); ++db)
+ ScheduleDatabaseForDeletion(ori->first, *db);
+ }
+ rv = net::ERR_IO_PENDING;
}
- return net::OK;
+ return rv;
}
// static
diff --git a/webkit/database/database_tracker.h b/webkit/database/database_tracker.h
index d1d5a43..90c9ebc 100644
--- a/webkit/database/database_tracker.h
+++ b/webkit/database/database_tracker.h
@@ -148,12 +148,6 @@ class DatabaseTracker
int DeleteDataModifiedSince(const base::Time& cutoff,
net::CompletionCallback* callback);
- // Delete all databases that belong to the given origin. Returns net::OK on
- // success, net::FAILED if not all databases could be deleted, and
- // net::ERR_IO_PENDING and |callback| is invoked upon completion, if non-NULL.
- int DeleteDataForOrigin(const string16& origin_identifier,
- net::CompletionCallback* callback);
-
static void ClearLocalState(const FilePath& profile_path);
private:
@@ -207,10 +201,6 @@ class DatabaseTracker
const string16& database_name);
void ScheduleDatabaseForDeletion(const string16& origin_identifier,
const string16& database_name);
- // Schedule a set of open databases for deletion. If non-null, callback is
- // invoked upon completion.
- void ScheduleDatabasesForDeletion(const DatabaseSet& databases,
- net::CompletionCallback* callback);
bool initialized_;
const FilePath db_dir_;