Bug 180383

Summary: Add support for ServiceWorkerContainer.prototype.ready
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Service WorkersAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, commit-queue, ggaren, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready
Bug Depends on: 180360    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Chris Dumez
Reported 2017-12-04 16:19:45 PST
Add support for ServiceWorkerContainer.prototype.ready: - https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready
Attachments
WIP Patch (21.24 KB, patch)
2017-12-05 10:53 PST, Chris Dumez
no flags
Patch (25.69 KB, patch)
2017-12-05 10:57 PST, Chris Dumez
no flags
Patch (25.81 KB, patch)
2017-12-05 11:00 PST, Chris Dumez
no flags
Patch (26.56 KB, patch)
2017-12-05 12:09 PST, Chris Dumez
no flags
Patch (26.56 KB, patch)
2017-12-05 12:24 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-12-05 10:53:54 PST
Created attachment 328468 [details] WIP Patch
Chris Dumez
Comment 2 2017-12-05 10:57:15 PST
Chris Dumez
Comment 3 2017-12-05 11:00:48 PST
youenn fablet
Comment 4 2017-12-05 11:39:14 PST
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&.
Chris Dumez
Comment 5 2017-12-05 12:09:50 PST
WebKit Commit Bot
Comment 6 2017-12-05 12:12:28 PST
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
Chris Dumez
Comment 7 2017-12-05 12:24:16 PST
WebKit Commit Bot
Comment 8 2017-12-05 12:56:17 PST
Comment on attachment 328483 [details] Patch Clearing flags on attachment: 328483 Committed r225531: <https://trac.webkit.org/changeset/225531>
WebKit Commit Bot
Comment 9 2017-12-05 12:56:19 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2017-12-06 16:48:24 PST
Note You need to log in before you can comment on or make changes to this bug.