Changeset 193970 in webkit


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

Modern IDB: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html fails.
https://bugs.webkit.org/show_bug.cgi?id=152177

Reviewed by Alex Christensen.

Source/WebCore:

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

  • Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:

(WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionDidFinish): Renamed from below.
(WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Deleted.

  • Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
  • Modules/indexeddb/client/IDBRequestImpl.cpp:

(WebCore::IDBClient::IDBRequest::setVersionChangeTransaction): OpenDBRequests usually don't have transactions,

unless they end up being upgrade requests.

  • Modules/indexeddb/client/IDBRequestImpl.h:
  • Modules/indexeddb/client/IDBTransactionImpl.cpp:

(WebCore::IDBClient::IDBTransaction::IDBTransaction): Call setVersionChangeTransaction on the request if appropriate.
(WebCore::IDBClient::IDBTransaction::dispatchEvent): Call versionChangeTransactionDidFinish after the

abort/complete events fire.

(WebCore::IDBClient::IDBTransaction::abort): Deleted.
(WebCore::IDBClient::IDBTransaction::commit): Deleted.

LayoutTests:

  • platform/mac-wk1/TestExpectations:
  • platform/wk2/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt: Copied from LayoutTests/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt.
  • storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt:
  • storage/indexeddb/resources/intversion-abort-in-initial-upgradeneeded.js:
Location:
trunk
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r193969 r193970  
     12015-12-11  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html fails.
     4        https://bugs.webkit.org/show_bug.cgi?id=152177
     5
     6        Reviewed by Alex Christensen.
     7
     8        * platform/mac-wk1/TestExpectations:
     9        * platform/wk2/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt: Copied from LayoutTests/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt.
     10        * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt:
     11        * storage/indexeddb/resources/intversion-abort-in-initial-upgradeneeded.js:
     12
    1132015-12-11  Jiewen Tan  <jiewen_tan@apple.com>
    214
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r193968 r193970  
    9898storage/indexeddb/index-basics.html [ Failure ]
    9999storage/indexeddb/index-duplicate-keypaths.html [ Failure ]
    100 storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html [ Failure ]
    101100storage/indexeddb/intversion-close-in-oncomplete.html [ Failure ]
    102101storage/indexeddb/intversion-close-in-upgradeneeded.html [ Failure ]
  • trunk/LayoutTests/platform/wk2/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt

    r193969 r193970  
    2121
    2222onError():
    23 PASS db is event.target.result
     23FAIL event.target.result should be undefined (of type undefined). Was [object IDBDatabase] (of type object).
    2424PASS request is event.target
    2525PASS event.target.error.name is "AbortError"
    26 PASS event.target.result.version is 0
    2726PASS request.transaction is null
    2827PASS successfullyParsed is true
  • trunk/LayoutTests/storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt

    r136475 r193970  
    2121
    2222onError():
    23 PASS db is event.target.result
     23PASS event.target.result is undefined
    2424PASS request is event.target
    2525PASS event.target.error.name is "AbortError"
    26 PASS event.target.result.version is 0
    2726PASS request.transaction is null
    2827PASS successfullyParsed is true
  • trunk/LayoutTests/storage/indexeddb/resources/intversion-abort-in-initial-upgradeneeded.js

    r163963 r193970  
    4545{
    4646    preamble(evt);
    47     shouldBe("db", "event.target.result");
     47    shouldBe("event.target.result", "undefined");
    4848    shouldBe("request", "event.target");
    4949    shouldBeEqualToString("event.target.error.name", "AbortError");
    50     shouldBe("event.target.result.version", "0");
    5150    shouldBeNull("request.transaction");
    5251    finishJSTest();
  • trunk/Source/WebCore/ChangeLog

    r193968 r193970  
     12015-12-11  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html fails.
     4        https://bugs.webkit.org/show_bug.cgi?id=152177
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (At least one failing test now passes).
     9
     10        * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
     11        (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionDidFinish): Renamed from below.
     12        (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Deleted.
     13        * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
     14       
     15        * Modules/indexeddb/client/IDBRequestImpl.cpp:
     16        (WebCore::IDBClient::IDBRequest::setVersionChangeTransaction): OpenDBRequests usually don't have transactions,
     17          unless they end up being upgrade requests.
     18        * Modules/indexeddb/client/IDBRequestImpl.h:
     19       
     20        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
     21        (WebCore::IDBClient::IDBTransaction::IDBTransaction): Call setVersionChangeTransaction on the request if appropriate.
     22        (WebCore::IDBClient::IDBTransaction::dispatchEvent): Call versionChangeTransactionDidFinish after the
     23          abort/complete events fire.
     24        (WebCore::IDBClient::IDBTransaction::abort): Deleted.
     25        (WebCore::IDBClient::IDBTransaction::commit): Deleted.
     26
    1272015-12-11  Brady Eidson  <beidson@apple.com>
    228
  • trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp

    r193936 r193970  
    6868}
    6969
    70 void IDBOpenDBRequest::versionChangeTransactionWillFinish()
     70void IDBOpenDBRequest::versionChangeTransactionDidFinish()
    7171{
    7272    // 3.3.7 "versionchange" transaction steps
    73     // When the transaction is finished, immediately set request's transaction property to null.
     73    // When the transaction is finished, after firing complete/abort on the transaction, immediately set request's transaction property to null.
    7474    m_shouldExposeTransactionToDOM = false;
    7575}
  • trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h

    r193936 r193970  
    5454    void requestBlocked(uint64_t oldVersion, uint64_t newVersion);
    5555
    56     void versionChangeTransactionWillFinish();
     56    void versionChangeTransactionDidFinish();
    5757    void fireSuccessAfterVersionChangeCommit();
    5858    void fireErrorAfterVersionChangeCompletion();
  • trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp

    r193936 r193970  
    156156}
    157157
     158void IDBRequest::setVersionChangeTransaction(IDBTransaction& transaction)
     159{
     160    ASSERT(!m_transaction);
     161    ASSERT(transaction.isVersionChange());
     162    ASSERT(!transaction.isFinishedOrFinishing());
     163
     164    m_transaction = &transaction;
     165}
     166
    158167RefPtr<WebCore::IDBTransaction> IDBRequest::transaction() const
    159168{
  • trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h

    r193487 r193970  
    9999
    100100    void setSource(IDBCursor&);
     101    void setVersionChangeTransaction(IDBTransaction&);
    101102
    102103protected:
  • trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp

    r193936 r193970  
    7272    if (m_info.mode() == IndexedDB::TransactionMode::VersionChange) {
    7373        ASSERT(m_openDBRequest);
     74        m_openDBRequest->setVersionChangeTransaction(*this);
    7475        m_startedOnServer = true;
    7576    } else {
     
    191192        for (auto& objectStore : m_referencedObjectStores.values())
    192193            objectStore->rollbackInfoForVersionChangeAbort();
    193 
    194         ASSERT(m_openDBRequest);
    195         m_openDBRequest->versionChangeTransactionWillFinish();
    196194    }
    197195   
     
    309307    m_state = IndexedDB::TransactionState::Committing;
    310308    m_database->willCommitTransaction(*this);
    311 
    312     if (isVersionChange()) {
    313         ASSERT(m_openDBRequest);
    314         m_openDBRequest->versionChangeTransactionWillFinish();
    315     }
    316309
    317310    auto operation = createTransactionOperation(*this, nullptr, &IDBTransaction::commitOnServer);
     
    426419    bool result = IDBEventDispatcher::dispatch(event, targets);
    427420
    428     if (isVersionChange() && event.type() == eventNames().completeEvent) {
     421    if (isVersionChange()) {
    429422        ASSERT(m_openDBRequest);
    430 
    431         if (m_database->isClosingOrClosed())
    432             m_openDBRequest->fireErrorAfterVersionChangeCompletion();
    433         else
    434             m_openDBRequest->fireSuccessAfterVersionChangeCommit();
     423        m_openDBRequest->versionChangeTransactionDidFinish();
     424
     425        if (event.type() == eventNames().completeEvent) {
     426            if (m_database->isClosingOrClosed())
     427                m_openDBRequest->fireErrorAfterVersionChangeCompletion();
     428            else
     429                m_openDBRequest->fireSuccessAfterVersionChangeCommit();
     430        }
    435431    }
    436432
Note: See TracChangeset for help on using the changeset viewer.