[webkit-changes] [WebKit/WebKit] 0aa940: imported/w3c/web-platform-tests/IndexedDB/idb-expl...

Sihui noreply at github.com
Tue Aug 6 23:43:14 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0aa9402244d02204000756d26981253ddb6a9578
      https://github.com/WebKit/WebKit/commit/0aa9402244d02204000756d26981253ddb6a9578
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-08-06 (Tue, 06 Aug 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.js
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker_101-last-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any_101-last-expected.txt
    M LayoutTests/inspector/indexeddb/clearObjectStore.html
    M LayoutTests/inspector/indexeddb/requestData.html
    M LayoutTests/platform/mac/TestExpectations
    M Source/WebCore/Modules/indexeddb/IDBRequest.h
    M Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
    M Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
    M Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h
    M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

  Log Message:
  -----------
  imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.html is failing
https://bugs.webkit.org/show_bug.cgi?id=277659
rdar://133254563

Reviewed by Chris Dumez.

To fix test failure, this patch makes following changes:
1. Add support for simultaneous transactions in SQLiteIDBBackingStore, by only creating a SQLite transaction when the
mode of IDBTransaction is readwrite. With this change, the backend can support simultaneous readonly transactions per
spec. Also, update existing checks in operations that expect SQLite transaction to exists, to expect either SQLite
transaction exists or the transaction is read-only.
2. When IDBTransaction.commit() is invoked during event dispatch for a request, consider the request as handled by
incrementing handledRequestResultsCount. Otherwise, the IndexedDB backend will take the request as not handled by
client, and if the event is error, the backend would abort the transaction instead of committing it. According to spec,
if error event is handled, the transaction can commit; if error event is not handled, the transaction should abort.

This patch also updates some tests that start simultaneous read-only transactions and expect the transactions to happen
in order to start transaction in order (i.e. starting a new transaction when the previous one has finished), to make
the result deterministic.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.js:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker_101-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any_101-last-expected.txt:
* LayoutTests/inspector/indexeddb/clearObjectStore.html:
* LayoutTests/inspector/indexeddb/requestData.html:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::isEventBeingDispatched const):
* Source/WebCore/Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commitInternal):
* Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h:
* Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::createSQLiteStatement):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindPreIndexStatementIfNecessary):
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
* Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::begin):
(WebCore::IDBServer::SQLiteIDBTransaction::commit):
(WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
(WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
(WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenCursor):
(WebCore::IDBServer::SQLiteIDBTransaction::notifyCursorsOfChanges):
(WebCore::IDBServer::SQLiteIDBTransaction::inProgressOrReadOnly const):
(WebCore::IDBServer::SQLiteIDBTransaction::addBlobFile):
(WebCore::IDBServer::SQLiteIDBTransaction::addRemovedBlobFile):
(WebCore::IDBServer::SQLiteIDBTransaction::sqliteDatabase const):
* Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h:
(WebCore::IDBServer::SQLiteIDBTransaction::isReadOnly const):
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):

Canonical link: https://commits.webkit.org/281933@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list