Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: da007ac59f0dfd9b4de7f11349ea6ae278f29d88
https://github.com/WebKit/WebKit/commit/da007ac59f0dfd9b4de7f11349ea6ae278f29d88
Author: Anne van Kesteren <[email protected]>
Date: 2026-05-30 (Sat, 30 May 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB-deferred-deserialization.https.any-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB-deferred-deserialization.https.any.html
A
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB-deferred-deserialization.https.any.js
A
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB-deferred-deserialization.https.any.worker-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB-deferred-deserialization.https.any.worker.html
M
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB.https.any-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-IndexedDB.https.any.worker-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/fs/w3c-import.log
M Source/WebCore/Headers.cmake
A Source/WebCore/Modules/filesystem/FileSystemHandleRecord.h
A Source/WebCore/Modules/filesystem/FileSystemHandleStorageKeepAlive.cpp
A Source/WebCore/Modules/filesystem/FileSystemHandleStorageKeepAlive.h
M Source/WebCore/Modules/filesystem/FileSystemStorageConnection.h
M Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
M Source/WebCore/Modules/indexeddb/IDBValue.cpp
M Source/WebCore/Modules/indexeddb/IDBValue.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/SQLiteMemoryIDBBackingStore.cpp
M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
M Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp
M Source/WebCore/Modules/indexeddb/shared/IDBResultData.h
M Source/WebCore/Modules/webxr/WebXRRay.cpp
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/bindings/js/SerializedScriptValue.cpp
M Source/WebCore/bindings/js/SerializedScriptValue.h
M Source/WebKit/NetworkProcess/storage/FileSystemStorageManager.cpp
M Source/WebKit/NetworkProcess/storage/FileSystemStorageManager.h
M Source/WebKit/NetworkProcess/storage/IDBStorageConnectionToClient.cpp
M Source/WebKit/NetworkProcess/storage/IDBStorageConnectionToClient.h
M Source/WebKit/NetworkProcess/storage/IDBStorageRegistry.cpp
M Source/WebKit/NetworkProcess/storage/IDBStorageRegistry.h
M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp
M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h
M Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.h
M Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.serialization.in
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp
M Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h
M Source/WebKit/WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp
Log Message:
-----------
FileSystemHandle IndexedDB storage
https://bugs.webkit.org/show_bug.cgi?id=313320
rdar://176102643
Reviewed by Sihui Liu.
Allow FileSystemFileHandle and FileSystemDirectoryHandle to be stored in
IndexedDB.
The wire form is just the FileSystemHandle global identifier; the (kind, path,
name) trio is resolved on the NetworkProcess side from the per-origin
FileSystemStorageManager.
Architecture:
* SQLiteIDBBackingStore gains a FileSystemHandleRecords table that stores
(global identifier, kind, path, name) alongside the existing Records /
BlobRecords tables. The backing store knows nothing about
FileSystemStorageManager.
* NetworkStorageManager is the orchestrator. On putOrAdd it resolves global
identifiers via FileSystemStorageManager::lookupHandles and stashes the
resolved records on the IDBValue (NetworkProcess-internal, not encoded for
IPC) so SQLiteIDBBackingStore::addRecord can read them back without an extra
parameter threaded through five putOrAdd layers. On result delivery
IDBStorageConnectionToClient registers persisted handles and bumps
per-identifier refs via
FileSystemStorageManager::registerPersistedHandlesAndAddReferences.
* Origin flows on IDBResultData (NetworkProcess-internal, [NotSerialized]):
IDBResultData::getRecordSuccess / getAllRecordsSuccess / openCursorSuccess /
iterateCursorSuccess each take the originating origin, supplied by
UniqueIDBDatabaseTransaction from its database identifier.
IDBStorageConnectionToClient reads it off the result and copies it onto
WebIDBResult.clientOrigin (one-way IPC, NetworkProcess→WebProcess) before
sending.
* WebProcess attaches a FileSystemHandleStorageKeepAlive — a thread-safe
refcounted object — to each IDBValue that carries global identifiers. The
keep-alive holds an FSM ref over IPC for the lifetime of the IDBValue and
releases it via a batched RemoveGlobalIdentifierReferences IPC on destruction.
This fixes the async-deserialization race where JS could await an IDB result,
delete the record, then read request.result and find the FSM entry gone.
* WebCore IDB layer (delegate, transaction, IDBValue) stays oblivious to
FileSystemStorageManager. Per-identifier iteration lives in
FileSystemStorageManager via lookupHandles /
registerPersistedHandlesAndAddReferences / removeGlobalIdentifierReferences
batch methods.
Canonical link: https://commits.webkit.org/314229@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications