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

Changeset 194275 in webkit


Ignore:
Timestamp:
Dec 18, 2015, 10:31:34 AM (11 years ago)
Author:
beidson@apple.com
Message:

Modern IDB: Refactor when opening the backing store takes place.
​https://bugs.webkit.org/show_bug.cgi?id=152405

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least one failing test now passes).

  • Modules/indexeddb/server/UniqueIDBDatabase.cpp:

(WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Move the "open backing store" logic

from here to performCurrentOpenOperation.

(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): If the database backing store is

not open yet, kick off opening it here.

(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): Rework this stuff to be better.

LayoutTests:

  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194271 r194275  
     12015-12-18  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Refactor when opening the backing store takes place.
     4        https://bugs.webkit.org/show_bug.cgi?id=152405
     5
     6        Reviewed by Alex Christensen.
     7
     8        * platform/mac-wk1/TestExpectations:
     9
    1102015-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
    211
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r194256 r194275  
    100100storage/indexeddb/odd-strings.html [ Failure ]
    101101storage/indexeddb/open-db-private-browsing.html [ Failure ]
    102 storage/indexeddb/open-ordering.html [ Failure ]
    103102storage/indexeddb/properties-disabled-at-runtime.html [ Failure ]
    104103storage/indexeddb/setversion-blocked-by-versionchange-close.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r194263 r194275  
     12015-12-18  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Refactor when opening the backing store takes place.
     4        https://bugs.webkit.org/show_bug.cgi?id=152405
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (At least one failing test now passes).
     9
     10        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
     11        (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Move the "open backing store" logic
     12          from here to performCurrentOpenOperation.
     13        (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): If the database backing store is
     14          not open yet, kick off opening it here.
     15        (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): Rework this stuff to be better.
     16
    1172015-12-17  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

    r194263 r194275  
    7676        return;
    7777
    78     if (m_databaseInfo) {
    79         handleDatabaseOperations();
    80         return;
    81     }
    82 
    83     m_isOpeningBackingStore = true;
    84     m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::openBackingStore, m_identifier));
     78    handleDatabaseOperations();
    8579}
    8680
    … …  
    109103    ASSERT(m_currentOperation);
    110104    ASSERT(m_currentOperation->isOpenRequest());
     105
     106    if (!m_databaseInfo) {
     107        m_isOpeningBackingStore = true;
     108        m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::openBackingStore, m_identifier));
     109        return;
     110    }
    111111
    112112    // If we previously started a version change operation but were blocked by having open connections,
    … …  
    207207    LOG(IndexedDB, "(main) UniqueIDBDatabase::handleDatabaseOperations - There are %zu pending", m_pendingDatabaseOperations.size());
    208208
    209     if (m_pendingDatabaseOperations.isEmpty())
    210         return;
    211 
    212209    if (m_versionChangeDatabaseConnection || m_currentOperation) {
    213210        // We can't start the next database operation quite yet, but we might need to notify all open connections
    214211        // about a pending delete.
    215         if (m_pendingDatabaseOperations.first()->isDeleteRequest() && !m_hasNotifiedConnectionsOfDelete) {
     212        if (!m_pendingDatabaseOperations.isEmpty() && m_pendingDatabaseOperations.first()->isDeleteRequest() && !m_hasNotifiedConnectionsOfDelete) {
    216213            m_hasNotifiedConnectionsOfDelete = true;
    217214            notifyConnectionsOfVersionChange(0);
    218215        }
    219     }
     216
     217        // Some operations (such as the first open operation after a delete) require multiple passes to completely handle
     218        if (m_currentOperation)
     219            handleCurrentOperation();
     220
     221        return;
     222    }
     223
     224    if (m_pendingDatabaseOperations.isEmpty())
     225        return;
    220226
    221227    m_currentOperation = m_pendingDatabaseOperations.takeFirst();
Note: See TracChangeset for help on using the changeset viewer.