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

Unified Diff: Source/modules/indexeddb/IDBDatabase.cpp

Issue 138473004: IndexedDB: Prevent terminated worker from hanging connections (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reword comment 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 | « no previous file | Source/modules/indexeddb/IDBTransaction.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBDatabase.cpp
diff --git a/Source/modules/indexeddb/IDBDatabase.cpp b/Source/modules/indexeddb/IDBDatabase.cpp
index 8106fdc1cfbc22979f067cc5a57ffcf8ec7d7dd2..6fe92a3233285715f9b029a7a76269aaf488227f 100644
--- a/Source/modules/indexeddb/IDBDatabase.cpp
+++ b/Source/modules/indexeddb/IDBDatabase.cpp
@@ -331,8 +331,10 @@ void IDBDatabase::closeConnection()
ASSERT(m_closePending);
ASSERT(m_transactions.isEmpty());
- m_backend->close();
- m_backend.clear();
+ if (m_backend) {
+ m_backend->close();
+ m_backend.clear();
+ }
if (m_contextStopped || !executionContext())
return;
@@ -402,10 +404,15 @@ bool IDBDatabase::hasPendingActivity() const
void IDBDatabase::stop()
{
- // Stop fires at a deterministic time, so we need to call close in it.
- close();
-
m_contextStopped = true;
+
+ // Immediately close the connection to the back end. Don't attempt a
+ // normal close() since that may wait on transactions which require a
+ // round trip to the back-end to abort.
+ if (m_backend) {
+ m_backend->close();
+ m_backend.clear();
+ }
}
const AtomicString& IDBDatabase::interfaceName() const
« no previous file with comments | « no previous file | Source/modules/indexeddb/IDBTransaction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698