Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 4a7cad9d3d392a6dd9784db1f009c7472ee01aca https://github.com/WebKit/WebKit/commit/4a7cad9d3d392a6dd9784db1f009c7472ee01aca Author: Youenn Fablet <youe...@gmail.com> Date: 2023-03-03 (Fri, 03 Mar 2023)
Changed paths: A LayoutTests/http/wpt/background-fetch/background-fetch-abort.window-expected.txt A LayoutTests/http/wpt/background-fetch/background-fetch-abort.window.html A LayoutTests/http/wpt/background-fetch/background-fetch-abort.window.js A LayoutTests/http/wpt/background-fetch/background-fetch-click.window-expected.txt A LayoutTests/http/wpt/background-fetch/background-fetch-click.window.html A LayoutTests/http/wpt/background-fetch/background-fetch-click.window.js M LayoutTests/http/wpt/background-fetch/sw.js M Source/WebCore/workers/service/background-fetch/BackgroundFetchEngine.cpp M Source/WebCore/workers/service/background-fetch/BackgroundFetchEngine.h M Source/WebCore/workers/service/background-fetch/BackgroundFetchStore.h M Source/WebCore/workers/service/context/SWContextManager.cpp M Source/WebCore/workers/service/context/SWContextManager.h M Source/WebCore/workers/service/context/ServiceWorkerThread.cpp M Source/WebCore/workers/service/context/ServiceWorkerThread.h M Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp M Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h M Source/WebCore/workers/service/server/SWServer.cpp M Source/WebCore/workers/service/server/SWServer.h M Source/WebCore/workers/service/server/SWServerDelegate.h M Source/WebCore/workers/service/server/SWServerToContextConnection.h M Source/WebKit/NetworkProcess/NetworkProcess.cpp M Source/WebKit/NetworkProcess/NetworkProcess.h M Source/WebKit/NetworkProcess/NetworkProcess.messages.in M Source/WebKit/NetworkProcess/NetworkSession.cpp M Source/WebKit/NetworkProcess/NetworkSession.h M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h M Source/WebKit/NetworkProcess/storage/BackgroundFetchStoreImpl.cpp M Source/WebKit/NetworkProcess/storage/BackgroundFetchStoreImpl.h M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h M Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm M Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h M Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp M Source/WebKit/UIProcess/Network/NetworkProcessProxy.h M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in M Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h M Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp M Tools/WebKitTestRunner/InjectedBundle/TestRunner.h M Tools/WebKitTestRunner/TestController.cpp M Tools/WebKitTestRunner/TestController.h M Tools/WebKitTestRunner/TestInvocation.cpp M Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm Log Message: ----------- Add API to trigger background fetch click event https://bugs.webkit.org/show_bug.cgi?id=253072 rdar://problem/106026054 Reviewed by Sihui Liu. Expose new WebsiteDataStore API to get a list of background fetch identifiers, click, abort, pause and resume them. Each call sends IPC to network process to do the actual work. The work is done through BackgroundFetchStoreImpl that will identify the background fetch registration from the background fetch identifier. The background fetch identifier is the filename of the persisted background fetch. Once identified, we send the order to the BackgroundFetchEngine. This patch only implements abort and click in BackgroundFetchEngine. We add testRunner API to trigger click, abort, resume and suspend actions. * LayoutTests/http/wpt/background-fetch/background-fetch-abort.window-expected.txt: Added. * LayoutTests/http/wpt/background-fetch/background-fetch-abort.window.html: Added. * LayoutTests/http/wpt/background-fetch/background-fetch-abort.window.js: Added. (promise_test.async t): * LayoutTests/http/wpt/background-fetch/background-fetch-click.window-expected.txt: Added. * LayoutTests/http/wpt/background-fetch/background-fetch-click.window.html: Added. * LayoutTests/http/wpt/background-fetch/background-fetch-click.window.js: Added. (promise_test.async t): * LayoutTests/http/wpt/background-fetch/sw.js: (onmessage): (onbackgroundfetchclick): (onbackgroundfetchabort): * Source/WebCore/workers/service/background-fetch/BackgroundFetchEngine.cpp: (WebCore::BackgroundFetchEngine::startBackgroundFetch): (WebCore::BackgroundFetchEngine::backgroundFetchInformation): (WebCore::BackgroundFetchEngine::backgroundFetchIdentifiers): (WebCore::BackgroundFetchEngine::abortBackgroundFetch): (WebCore::BackgroundFetchEngine::matchBackgroundFetch): (WebCore::BackgroundFetchEngine::pauseBackgroundFetch): (WebCore::BackgroundFetchEngine::resumeBackgroundFetch): (WebCore::BackgroundFetchEngine::clickBackgroundFetch): * Source/WebCore/workers/service/background-fetch/BackgroundFetchEngine.h: * Source/WebCore/workers/service/background-fetch/BackgroundFetchStore.h: * Source/WebCore/workers/service/context/SWContextManager.cpp: (WebCore::SWContextManager::fireBackgroundFetchClickEvent): * Source/WebCore/workers/service/context/SWContextManager.h: * Source/WebCore/workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireBackgroundFetchClickEvent): * Source/WebCore/workers/service/context/ServiceWorkerThread.h: * Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::fireBackgroundFetchClickEvent): * Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h: * Source/WebCore/workers/service/server/SWServer.cpp: (WebCore::SWServer::fireBackgroundFetchEvent): (WebCore::SWServer::fireBackgroundFetchClickEvent): * Source/WebCore/workers/service/server/SWServer.h: * Source/WebCore/workers/service/server/SWServerDelegate.h: * Source/WebCore/workers/service/server/SWServerToContextConnection.h: * Source/WebKit/NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::allBackgroundFetches): (WebKit::NetworkProcess::abortBackgroundFetch): (WebKit::NetworkProcess::pauseBackgroundFetch): (WebKit::NetworkProcess::resumeBackgroundFetch): (WebKit::NetworkProcess::clickBackgroundFetch): * Source/WebKit/NetworkProcess/NetworkProcess.h: * Source/WebKit/NetworkProcess/NetworkProcess.messages.in: * Source/WebKit/NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::createBackgroundFetchStore): (WebKit::NetworkSession::ensureBackgroundFetchStore): (WebKit::NetworkSession::allBackgroundFetches): (WebKit::NetworkSession::abortBackgroundFetch): (WebKit::NetworkSession::pauseBackgroundFetch): (WebKit::NetworkSession::resumeBackgroundFetch): (WebKit::NetworkSession::clickBackgroundFetch): * Source/WebKit/NetworkProcess/NetworkSession.h: * Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::fireBackgroundFetchClickEvent): * Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * Source/WebKit/NetworkProcess/storage/BackgroundFetchStoreImpl.cpp: (WebKit::BackgroundFetchStoreImpl::BackgroundFetchStoreImpl): (WebKit::BackgroundFetchStoreImpl::registerFetch): (WebKit::BackgroundFetchStoreImpl::initializeFetches): (WebKit::BackgroundFetchStoreImpl::storeFetch): (WebKit::BackgroundFetchStoreImpl::fetchInformationFromFilename): (WebKit::BackgroundFetchStoreImpl::loadAllFetches): (WebKit::BackgroundFetchStoreImpl::allBackgroundFetches): (WebKit::BackgroundFetchStoreImpl::abortBackgroundFetch): (WebKit::BackgroundFetchStoreImpl::pauseBackgroundFetch): (WebKit::BackgroundFetchStoreImpl::resumeBackgroundFetch): (WebKit::BackgroundFetchStoreImpl::clickBackgroundFetch): * Source/WebKit/NetworkProcess/storage/BackgroundFetchStoreImpl.h: (WebKit::BackgroundFetchStoreImpl::create): * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::close): (WebKit::NetworkStorageManager::writeOriginToFileIfNecessary): (WebKit::NetworkStorageManager::originStorageManager): (WebKit::NetworkStorageManager::removeOriginStorageManagerIfPossible): (WebKit::NetworkStorageManager::persisted): (WebKit::NetworkStorageManager::persist): (WebKit::NetworkStorageManager::estimate): (WebKit::NetworkStorageManager::resetStoragePersistedState): (WebKit::NetworkStorageManager::clearStorageForWebPage): (WebKit::NetworkStorageManager::cloneSessionStorageForWebPage): (WebKit::NetworkStorageManager::didIncreaseQuota): (WebKit::NetworkStorageManager::getAllOrigins): (WebKit::NetworkStorageManager::suspend): (WebKit::NetworkStorageManager::handleLowMemoryWarning): (WebKit::NetworkStorageManager::syncLocalStorage): (WebKit::NetworkStorageManager::resetQuotaForTesting): (WebKit::NetworkStorageManager::resetQuotaUpdatedBasedOnUsageForTesting): (WebKit::NetworkStorageManager::cancelConnectToStorageArea): (WebKit::NetworkStorageManager::cloneSessionStorageNamespace): (WebKit::NetworkStorageManager::cacheStorageClearMemoryRepresentation): * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getAllBackgroundFetches:]): (-[WKWebsiteDataStore _abortBackgroundFetch:]): (-[WKWebsiteDataStore _pauseBackgroundFetch:]): (-[WKWebsiteDataStore _resumeBackgroundFetch:]): (-[WKWebsiteDataStore _clickBackgroundFetch:]): * Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::allBackgroundFetches): (WebKit::NetworkProcessProxy::abortBackgroundFetch): (WebKit::NetworkProcessProxy::pauseBackgroundFetch): (WebKit::NetworkProcessProxy::resumeBackgroundFetch): (WebKit::NetworkProcessProxy::clickBackgroundFetch): * Source/WebKit/UIProcess/Network/NetworkProcessProxy.h: * Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::fireBackgroundFetchClickEvent): * Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h: * Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in: * Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::getBackgroundFetchIdentifier): * Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h: * Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::getBackgroundFetchIdentifier): (WTR::TestRunner::abortBackgroundFetch): (WTR::TestRunner::pauseBackgroundFetch): (WTR::TestRunner::resumeBackgroundFetch): (WTR::TestRunner::simulateClickBackgroundFetch): * Tools/WebKitTestRunner/InjectedBundle/TestRunner.h: * Tools/WebKitTestRunner/TestController.cpp: (WTR::TestController::getBackgroundFetchIdentifier): (WTR::TestController::abortBackgroundFetch): (WTR::TestController::pauseBackgroundFetch): (WTR::TestController::resumeBackgroundFetch): (WTR::TestController::simulateClickBackgroundFetch): * Tools/WebKitTestRunner/TestController.h: * Tools/WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): * Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::TestController::getBackgroundFetchIdentifier): (WTR::TestController::abortBackgroundFetch): (WTR::TestController::pauseBackgroundFetch): (WTR::TestController::resumeBackgroundFetch): (WTR::TestController::simulateClickBackgroundFetch): Canonical link: https://commits.webkit.org/261136@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes