Changeset 279686 in webkit


Ignore:
Timestamp:
Jul 7, 2021 4:57:58 PM (13 months ago)
Author:
Chris Dumez
Message:

[IndexedDB] Transaction should be inactive during structured clone
https://bugs.webkit.org/show_bug.cgi?id=227773

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

  • web-platform-tests/IndexedDB/structured-clone-transaction-state.any-expected.txt:
  • web-platform-tests/IndexedDB/structured-clone-transaction-state.any.worker-expected.txt:

Source/WebCore:

Transaction should be inactive during structured clone, as per:

Gecko and Blink match the specification.

No new tests, rebaselined existing tests.

  • Modules/indexeddb/IDBObjectStore.cpp:

(WebCore::IDBObjectStore::putOrAdd):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r279683 r279686  
     12021-07-07  Chris Dumez  <cdumez@apple.com>
     2
     3        [IndexedDB] Transaction should be inactive during structured clone
     4        https://bugs.webkit.org/show_bug.cgi?id=227773
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Rebaseline WPT tests now that more checks are passing.
     9
     10        * web-platform-tests/IndexedDB/structured-clone-transaction-state.any-expected.txt:
     11        * web-platform-tests/IndexedDB/structured-clone-transaction-state.any.worker-expected.txt:
     12
    1132021-07-07  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone-transaction-state.any-expected.txt

    r263437 r279686  
    11
    2 FAIL Transaction inactive during structured clone in IDBObjectStore.add() assert_throws_dom: transaction should not be active during structured clone function "() => {
    3         objectStore.get('key');
    4       }" did not throw
    5 FAIL Transaction inactive during structured clone in IDBObjectStore.put() assert_throws_dom: transaction should not be active during structured clone function "() => {
    6         objectStore.get('key');
    7       }" did not throw
    8 FAIL Transaction inactive during structured clone in IDBCursor.update() assert_throws_dom: transaction should not be active during structured clone function "() => {
    9         objectStore.get('key');
    10       }" did not throw
     2PASS Transaction inactive during structured clone in IDBObjectStore.add()
     3PASS Transaction inactive during structured clone in IDBObjectStore.put()
     4PASS Transaction inactive during structured clone in IDBCursor.update()
    115
  • trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone-transaction-state.any.worker-expected.txt

    r263437 r279686  
    11
    2 FAIL Transaction inactive during structured clone in IDBObjectStore.add() assert_throws_dom: transaction should not be active during structured clone function "() => {
    3         objectStore.get('key');
    4       }" did not throw
    5 FAIL Transaction inactive during structured clone in IDBObjectStore.put() assert_throws_dom: transaction should not be active during structured clone function "() => {
    6         objectStore.get('key');
    7       }" did not throw
    8 FAIL Transaction inactive during structured clone in IDBCursor.update() assert_throws_dom: transaction should not be active during structured clone function "() => {
    9         objectStore.get('key');
    10       }" did not throw
     2PASS Transaction inactive during structured clone in IDBObjectStore.add()
     3PASS Transaction inactive during structured clone in IDBObjectStore.put()
     4PASS Transaction inactive during structured clone in IDBCursor.update()
    115
  • trunk/Source/WebCore/ChangeLog

    r279685 r279686  
     12021-07-07  Chris Dumez  <cdumez@apple.com>
     2
     3        [IndexedDB] Transaction should be inactive during structured clone
     4        https://bugs.webkit.org/show_bug.cgi?id=227773
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Transaction should be inactive during structured clone, as per:
     9        - https://w3c.github.io/IndexedDB/#clone
     10
     11        Gecko and Blink match the specification.
     12
     13        No new tests, rebaselined existing tests.
     14
     15        * Modules/indexeddb/IDBObjectStore.cpp:
     16        (WebCore::IDBObjectStore::putOrAdd):
     17
    1182021-07-07  Cameron McCormack  <heycam@apple.com>
    219
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp

    r278253 r279686  
    336336        return Exception { ReadonlyError, "Failed to store record in an IDBObjectStore: The transaction is read-only."_s };
    337337
     338    // Transaction should be inactive during structured clone.
     339    m_transaction.deactivate();
    338340    auto serializedValue = SerializedScriptValue::create(state, value);
     341    m_transaction.activate();
     342
    339343    if (UNLIKELY(scope.exception()))
    340344        return Exception { DataCloneError, "Failed to store record in an IDBObjectStore: An object could not be cloned."_s };
Note: See TracChangeset for help on using the changeset viewer.