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

Changeset 197057 in webkit


Ignore:
Timestamp:
Feb 24, 2016, 4:23:38 PM (11 years ago)
Author:
beidson@apple.com
Message:

Modern IDB: Some w3c objectstore tests crash under GuardMalloc.
​https://bugs.webkit.org/show_bug.cgi?id=154460

Reviewed by Alex Christensen.

No new tests (Covered by existing tests).

  • Modules/indexeddb/server/UniqueIDBDatabase.cpp:

(WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): Don't delete the UniqueIDBDatabase yet

if there are still any connections pending close.

(WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): It's possible that with this

transaction completing, and a connection finished its close process, that the UniqueIDBDatabase is
now ready to be deleted.

  • Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:

(WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):

  • Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
  • Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:

(WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r197056 r197057  
     12016-02-24  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Some w3c objectstore tests crash under GuardMalloc.
     4        https://bugs.webkit.org/show_bug.cgi?id=154460
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (Covered by existing tests).
     9
     10        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
     11        (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
     12        (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
     13        (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):  Don't delete the UniqueIDBDatabase yet
     14          if there are still any connections pending close.
     15        (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
     16        (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
     17        (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): It's possible that with this
     18          transaction completing, and a connection finished its close process, that the UniqueIDBDatabase is
     19          now ready to be deleted.
     20
     21        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
     22        (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
     23        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
     24
     25        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
     26        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
     27
    1282016-02-24  Konstantin Tokarev  <annulen@yandex.ru>
    229
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

    r196191 r197057  
    6060    ASSERT(m_pendingTransactions.isEmpty());
    6161    ASSERT(m_openDatabaseConnections.isEmpty());
     62    ASSERT(m_closePendingDatabaseConnections.isEmpty());
    6263}
    6364
    … …  
    182183    }
    183184
    184     // Even though we have no open database connections, we might have close-pending database connections
    185     // that are waiting on transactions to complete.
    186     if (!m_inProgressTransactions.isEmpty()) {
    187         ASSERT(!m_closePendingDatabaseConnections.isEmpty());
    188         return;
    189     }
     185    if (!m_inProgressTransactions.isEmpty())
     186        return;
    190187
    191188    ASSERT(!hasAnyPendingCallbacks());
    … …  
    242239    m_deleteBackingStoreInProgress = false;
    243240
    244     if (m_pendingOpenDBRequests.isEmpty())
    245         m_server.deleteUniqueIDBDatabase(*this);
    246     else
    247         invokeOperationAndTransactionTimer();
     241    if (m_closePendingDatabaseConnections.isEmpty()) {
     242        if (m_pendingOpenDBRequests.isEmpty())
     243            m_server.deleteUniqueIDBDatabase(*this);
     244        else
     245            invokeOperationAndTransactionTimer();
     246    }
    248247}
    249248
    … …  
    979978    LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformCommitTransaction");
    980979
     980    performErrorCallback(callbackIdentifier, error);
     981
    981982    inProgressTransactionCompleted(transactionIdentifier);
    982 
    983     performErrorCallback(callbackIdentifier, error);
    984983}
    985984
    … …  
    10291028    }
    10301029
     1030    performErrorCallback(callbackIdentifier, error);
     1031
    10311032    inProgressTransactionCompleted(transactionIdentifier);
    1032 
    1033     performErrorCallback(callbackIdentifier, error);
    10341033}
    10351034
    … …  
    12451244        m_closePendingDatabaseConnections.remove(&transaction->databaseConnection());
    12461245
     1246    // It's possible that this database had its backing store deleted but there were a few outstanding asynchronous operations.
     1247    // If this transaction completing was the last of those operations, we can finally delete this UniqueIDBDatabase.
     1248    if (m_closePendingDatabaseConnections.isEmpty() && m_pendingOpenDBRequests.isEmpty() && !m_databaseInfo) {
     1249        m_server.deleteUniqueIDBDatabase(*this);
     1250        return;
     1251    }
     1252
    12471253    // Previously blocked operations might be runnable.
    12481254    invokeOperationAndTransactionTimer();
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp

    r194496 r197057  
    6565{
    6666    return !m_transactionMap.isEmpty();
     67}
     68
     69void UniqueIDBDatabaseConnection::abortTransactionWithoutCallback(UniqueIDBDatabaseTransaction& transaction)
     70{
     71    ASSERT(m_transactionMap.contains(transaction.info().identifier()));
     72    auto takenTransaction = m_transactionMap.take(transaction.info().identifier());
     73
     74    m_database.abortTransaction(*takenTransaction, [](const IDBError&) { });
    6775}
    6876
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h

    r194452 r197057  
    7474    void didFireVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier);
    7575
     76    void abortTransactionWithoutCallback(UniqueIDBDatabaseTransaction&);
     77
    7678private:
    7779    UniqueIDBDatabaseConnection(UniqueIDBDatabase&, IDBConnectionToClient&);
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp

    r195787 r197057  
    8080    LOG(IndexedDB, "UniqueIDBDatabaseTransaction::abortWithoutCallback");
    8181
    82     m_databaseConnection->database().abortTransaction(*this, [](const IDBError&) { });
     82    m_databaseConnection->abortTransactionWithoutCallback(*this);
    8383}
    8484
Note: See TracChangeset for help on using the changeset viewer.