Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Unified Diff: content/browser/indexed_db/indexed_db_database.cc

Issue 93873017: IndexedDBFactory now ForceCloses databases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up iterator usage, removed local copy of conns. Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_database.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index ba53e662159375769f86f070d8fec6f560022555..2067ba6f6818149e32759c68957a6a12f51075d4 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -1589,6 +1589,13 @@ void IndexedDBDatabase::DeleteDatabaseFinal(
factory_->DatabaseDeleted(identifier_);
}
+void IndexedDBDatabase::ForceClose() {
+ // IndexedDBConnection::ForceClose() may delete this database, so hold ref.
+ scoped_refptr<IndexedDBDatabase> protect(this);
+ while (!connections_.empty())
jsbell 2014/01/06 22:33:50 If we ever break IndexedDBConnect::ForceClose() so
cmumford 2014/01/09 00:48:25 Done.
+ (*connections_.begin())->ForceClose();
+}
+
void IndexedDBDatabase::Close(IndexedDBConnection* connection, bool forced) {
DCHECK(connections_.count(connection));
DCHECK(connection->IsConnected());

Powered by Google App Engine
This is Rietveld 408576698