WebKit Bugzilla
Attachment 358224 Details for
Bug 193093
: IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193093-20190102165822.patch (text/plain), 3.34 KB, created by
Sihui Liu
on 2019-01-02 16:58:23 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2019-01-02 16:58:23 PST
Size:
3.34 KB
patch
obsolete
>Subversion Revision: 239578 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 081d6d7062e77f984d7a0a9e2db2e95e9c7a64a5..1fbdc0e11a41b2f7a33d5caeb0909641a1f4e2f1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-01-02 Sihui Liu <sihui_liu@apple.com> >+ >+ IndexedDB: UniqueIDBDatabase should be freed after database task queue is empty >+ https://bugs.webkit.org/show_bug.cgi?id=193093 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor >+ task may be scheduled behind performUnconditionalDeleteBackingStore on database thread. >+ >+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp: >+ (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose): >+ (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): >+ (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose): >+ > 2019-01-02 Simon Fraser <simon.fraser@apple.com> > > Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class >diff --git a/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp >index 4e2a2df6b7a37777229cc8f2d5a44985b668c673..a3bb04c50541ee7ed1b852d631029e084270de0e 100644 >--- a/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp >+++ b/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp >@@ -294,7 +294,10 @@ void UniqueIDBDatabase::shutdownForClose() > m_backingStoreSupportsSimultaneousTransactions = false; > m_backingStoreIsEphemeral = false; > >- ASSERT(m_databaseQueue.isEmpty()); >+ if (!m_databaseQueue.isEmpty()) { >+ postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::shutdownForClose)); >+ return; >+ } > m_databaseQueue.kill(); > > postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didShutdownForClose)); >@@ -1278,10 +1281,10 @@ void UniqueIDBDatabase::performPrefetchCursor(const IDBResourceIdentifier& trans > ASSERT(m_cursorPrefetches.contains(cursorIdentifier)); > LOG(IndexedDB, "(db) UniqueIDBDatabase::performPrefetchCursor"); > >- if (m_backingStore->prefetchCursor(transactionIdentifier, cursorIdentifier)) >- postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performPrefetchCursor, transactionIdentifier, cursorIdentifier)); >- else >+ if (m_hardClosedForUserDelete || !m_backingStore->prefetchCursor(transactionIdentifier, cursorIdentifier)) > m_cursorPrefetches.remove(cursorIdentifier); >+ else >+ postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performPrefetchCursor, transactionIdentifier, cursorIdentifier)); > } > > void UniqueIDBDatabase::didPerformIterateCursor(uint64_t callbackIdentifier, const IDBError& error, const IDBGetResult& result) >@@ -1791,7 +1794,7 @@ void UniqueIDBDatabase::maybeFinishHardClose() > > bool UniqueIDBDatabase::isDoneWithHardClose() > { >- return m_databaseQueue.isKilled() && m_clientClosePendingDatabaseConnections.isEmpty() && m_serverClosePendingDatabaseConnections.isEmpty(); >+ return m_databaseReplyQueue.isKilled() && m_clientClosePendingDatabaseConnections.isEmpty() && m_serverClosePendingDatabaseConnections.isEmpty(); > } > > static void errorOpenDBRequestForUserDelete(ServerOpenDBRequest& request)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193093
:
358224
|
359313
|
359319