Add support for ServiceWorkerContainer.prototype.ready: - https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready
Created attachment 328468 [details] WIP Patch
Created attachment 328469 [details] Patch
Created attachment 328472 [details] Patch
Comment on attachment 328472 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328472&action=review > Source/WebCore/workers/service/SWClientConnection.h:65 > + using WhenRegistrationReadyCallback = WTF::Function<void(ServiceWorkerRegistrationData&&)>; If this cannot be a CompletionHandler, probably the other callbacks cannot be either. > Source/WebCore/workers/service/ServiceWorkerContainer.cpp:93 > + return; I wonder whether ScriptExecutionContext::postTaskTo would be able to prevent these kind of checks in the future. > Source/WebCore/workers/service/server/SWServer.cpp:650 > + connection->resolveRegistrationReadyRequests(registration); Since we already expose Connection through getConnection, maybe it is fine to allow iterating in some ways inside SWServerRegistration directly. > Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp:212 > + m_registrationReadyRequests.append({ topOrigin, clientURL, WTFMove(callback) }); If we want to keep good WK2/WebCore layering, we should probably add this vector somewhere else, maybe at SWServerConnection level. WebSWServerConnection::resolveRegistrationReadyRequests would also move up there. In preexisting code, we should probably add an SWServerConnection::matchRegistration that would return an optional so that we would do less WebCore stuff in WebSWServerConnection::matchRegistration. The same could apply there as well maybe. > Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp:158 > +void WebSWClientConnection::whenRegistrationReady(Ref<SecurityOrigin>&& topOrigin, const URL& clientURL, WhenRegistrationReadyCallback&& callback) Could probably take a const SecurityOrigin&.
Created attachment 328480 [details] Patch
Comment on attachment 328480 [details] Patch Rejecting attachment 328480 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 328480, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!. Full output: http://webkit-queues.webkit.org/results/5504306
Created attachment 328483 [details] Patch
Comment on attachment 328483 [details] Patch Clearing flags on attachment: 328483 Committed r225531: <https://trac.webkit.org/changeset/225531>
All reviewed patches have been landed. Closing bug.
<rdar://problem/35896620>