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

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: ForceClosing connections using iterators to avoid possible infinite loop. Created 6 years, 11 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
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.h ('k') | content/browser/indexed_db/indexed_db_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7dcb931482c5fb0aa301643a464e9df748d20696 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -1589,6 +1589,16 @@ void IndexedDBDatabase::DeleteDatabaseFinal(
factory_->DatabaseDeleted(identifier_);
}
+void IndexedDBDatabase::ForceClose() {
+ // IndexedDBConnection::ForceClose() may delete this database, so hold ref.
+ scoped_refptr<IndexedDBDatabase> protect(this);
+ ConnectionSet::const_iterator it = connections_.begin();
+ while (it != connections_.end()) {
+ IndexedDBConnection* connection = *it++;
+ connection->ForceClose();
+ }
jsbell 2014/01/09 18:09:11 Can you add a DCHECK that connections_ is empty()
cmumford 2014/01/09 18:46:09 Done.
+}
+
void IndexedDBDatabase::Close(IndexedDBConnection* connection, bool forced) {
DCHECK(connections_.count(connection));
DCHECK(connection->IsConnected());
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.h ('k') | content/browser/indexed_db/indexed_db_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698