Bug 229720

Summary: Add support for ServiceWorkerGlobalScope.serviceWorker
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Service WorkersAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, benjamin, cmarcelo, darin, esprehn+autocc, ews-watchlist, ggaren, japhet, kondapallykalyan, mkwst, sam, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-serviceworker
See Also: https://bugs.webkit.org/show_bug.cgi?id=228755
Attachments:
Description Flags
WIP patch
none
WIP patch
none
WIP patch
none
WIP patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2021-08-31 10:13:36 PDT
Add support for ServiceWorkerGlobalScope.serviceWorker:
- https://w3c.github.io/ServiceWorker/#dom-serviceworkerglobalscope-serviceworker
Comment 1 Chris Dumez 2021-08-31 10:14:08 PDT
Created attachment 436900 [details]
WIP patch
Comment 2 Chris Dumez 2021-08-31 10:48:20 PDT
Created attachment 436910 [details]
WIP patch
Comment 3 Chris Dumez 2021-08-31 10:56:00 PDT
Created attachment 436913 [details]
WIP patch
Comment 4 Chris Dumez 2021-08-31 12:09:24 PDT
Created attachment 436924 [details]
WIP patch
Comment 5 Chris Dumez 2021-08-31 12:40:04 PDT
Created attachment 436929 [details]
Patch
Comment 6 Chris Dumez 2021-08-31 16:45:37 PDT
Created attachment 436965 [details]
Patch
Comment 7 youenn fablet 2021-09-01 00:04:47 PDT
Comment on attachment 436965 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=436965&action=review

> Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:81
> +    , m_workerData(crossThreadCopy(workerData))

We do not really need a ServiceWorkerContextData&& nor a ServiceWorkerData&&, except if we want to add a dedicated isolatedCopy() &&.

> LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt:1
> +CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Load failed

This unhandled promise rejection may cause flakiness according EWS.
Can we update the test to make sure this des not happen?
Comment 8 Chris Dumez 2021-09-01 07:52:28 PDT
Created attachment 437027 [details]
Patch
Comment 9 EWS 2021-09-01 09:30:49 PDT
Committed r281854 (241186@main): <https://commits.webkit.org/241186@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437027 [details].
Comment 10 Radar WebKit Bug Importer 2021-09-01 09:31:17 PDT
<rdar://problem/82632170>