Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 808b1c7f159a61619bcf30a61a4df9b69089fc64 https://github.com/WebKit/WebKit/commit/808b1c7f159a61619bcf30a61a4df9b69089fc64 Author: Sihui Liu <sihui_...@apple.com> Date: 2023-04-18 (Tue, 18 Apr 2023)
Changed paths: M LayoutTests/TestExpectations M LayoutTests/platform/wk2/TestExpectations A LayoutTests/storage/storagemanager/nested-dedicated-workers-expected.txt A LayoutTests/storage/storagemanager/nested-dedicated-workers.html A LayoutTests/storage/storagemanager/resources/nested-dedicated-workers.js A LayoutTests/storage/storagemanager/resources/nested-dedicated-workers2.js M Source/WebCore/Modules/storage/WorkerStorageConnection.cpp M Source/WebCore/workers/WorkerLoaderProxy.h M Source/WebCore/workers/WorkerMessagingProxy.cpp M Source/WebCore/workers/WorkerMessagingProxy.h Log Message: ----------- `navigator.storage.getDirectory()` fails in nested workers with an `InvalidStateError` https://bugs.webkit.org/show_bug.cgi?id=255458 rdar://108069396 Reviewed by Chris Dumez. WorkerStorageConnection assumes its Worker's loader is a Document, and thus posts tasks to main thread and asks for StorageConnection from its loader (WorkerLoaderProxy) directly. This is no longer true after nested worker is enabled -- the loader might be another Worker. Therefore it should get StorageConnection from the real main thread loader (via WorkerLoaderProxy::postTaskToLoader). Test: storage/storagemanager/nested-dedicated-workers.html * LayoutTests/TestExpectations: * LayoutTests/platform/wk2/TestExpectations: * LayoutTests/storage/storagemanager/nested-dedicated-workers-expected.txt: Added. * LayoutTests/storage/storagemanager/nested-dedicated-workers.html: Added. * LayoutTests/storage/storagemanager/resources/nested-dedicated-workers.js: Added. (nestedWorker.onmessage): (nestedWorker.onerror): * LayoutTests/storage/storagemanager/resources/nested-dedicated-workers2.js: Added. (navigator.storage.navigator.storage.estimate.then): (navigator.storage.catch): * Source/WebCore/Modules/storage/WorkerStorageConnection.cpp: (WebCore::WorkerStorageConnection::getPersisted): (WebCore::WorkerStorageConnection::getEstimate): (WebCore::WorkerStorageConnection::fileSystemGetDirectory): * Source/WebCore/workers/WorkerLoaderProxy.h: (WebCore::WorkerLoaderProxy::storageConnection): Deleted. * Source/WebCore/workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::storageConnection): Deleted. * Source/WebCore/workers/WorkerMessagingProxy.h: Canonical link: https://commits.webkit.org/263075@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes