⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 240090 in webkit


Ignore:
Timestamp:
Jan 16, 2019, 3:52:36 PM (8 years ago)
Author:
sihui_liu@apple.com
Message:

IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
​https://bugs.webkit.org/show_bug.cgi?id=193093

Reviewed by Brady Eidson.

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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r240054 r240090  
     12019-01-16  Sihui Liu  <sihui_liu@apple.com>
     2
     3        IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
     4        https://bugs.webkit.org/show_bug.cgi?id=193093
     5
     6        Reviewed by Brady Eidson.
     7
     8        performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
     9        task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.
     10
     11        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
     12        (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
     13        (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
     14        (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
     15
    1162019-01-16  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

    r239872 r240090  
    293293    m_backingStoreIsEphemeral = false;
    294294
    295     ASSERT(m_databaseQueue.isEmpty());
     295    if (!m_databaseQueue.isEmpty()) {
     296        postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::shutdownForClose));
     297        return;
     298    }
    296299    m_databaseQueue.kill();
    297300
    … …  
    12721275    LOG(IndexedDB, "(db) UniqueIDBDatabase::performPrefetchCursor");
    12731276
    1274     if (m_backingStore->prefetchCursor(transactionIdentifier, cursorIdentifier))
     1277    if (m_hardClosedForUserDelete || !m_backingStore->prefetchCursor(transactionIdentifier, cursorIdentifier))
     1278        m_cursorPrefetches.remove(cursorIdentifier);
     1279    else
    12751280        postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performPrefetchCursor, transactionIdentifier, cursorIdentifier));
    1276     else
    1277         m_cursorPrefetches.remove(cursorIdentifier);
    12781281}
    12791282
    … …  
    17851788bool UniqueIDBDatabase::isDoneWithHardClose()
    17861789{
    1787     return m_databaseQueue.isKilled() && m_clientClosePendingDatabaseConnections.isEmpty() && m_serverClosePendingDatabaseConnections.isEmpty();
     1790    return m_databaseReplyQueue.isKilled() && m_clientClosePendingDatabaseConnections.isEmpty() && m_serverClosePendingDatabaseConnections.isEmpty();
    17881791}
    17891792
Note: See TracChangeset for help on using the changeset viewer.