RESOLVED FIXED 178839
messageEvent.source can also be a ServiceWorker
https://bugs.webkit.org/show_bug.cgi?id=178839
Summary messageEvent.source can also be a ServiceWorker
Chris Dumez
Reported 2017-10-25 17:46:35 PDT
messageEvent.source can also be a ServiceWorker: - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource
Attachments
Patch (4.80 KB, patch)
2017-10-25 18:13 PDT, Chris Dumez
no flags
Patch (4.79 KB, patch)
2017-10-25 19:35 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-10-25 18:13:11 PDT
Brady Eidson
Comment 2 2017-10-25 19:21:57 PDT
Comment on attachment 324933 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=324933&action=review > Source/WebCore/dom/MessageEvent.h:46 > -using MessageEventSource = Variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>; > +using MessageEventSource = Variant<RefPtr<DOMWindow>, RefPtr<MessagePort> > +#if ENABLE(SERVICE_WORKER) > + , RefPtr<ServiceWorker> > +#endif > + >; This is gross. I'd almost prefer a single line duplicating all 3 possibilities for the #if ENABLE() case. > Source/WebCore/dom/MessageEvent.idl:33 > +#if defined(ENABLE_SERVICE_WORKER) && ENABLE_SERVICE_WORKER > +typedef (DOMWindow or MessagePort or ServiceWorker) MessageEventSource; > +#else > +typedef (DOMWindow or MessagePort) MessageEventSource; > +#endif Like this is what I was alluding to up there ^^^
Chris Dumez
Comment 3 2017-10-25 19:35:39 PDT
WebKit Commit Bot
Comment 4 2017-10-25 19:57:11 PDT
Comment on attachment 324944 [details] Patch Clearing flags on attachment: 324944 Committed r224000: <https://trac.webkit.org/changeset/224000>
WebKit Commit Bot
Comment 5 2017-10-25 19:57:13 PDT
All reviewed patches have been landed. Closing bug.
Sam Weinig
Comment 6 2017-10-25 20:02:50 PDT
:(. I was getting so close to getting rid of the preprocessor for IDL files. Would an alternative approach, where in non-ENABLE(SERVICE_WORKER) we have a dummy ServiceWorker class work in this case (I am considering this for the non-ENABLE(VIDEO) case). Without a way to get a ServiceWorker from script, the fact that it is included in the union should not be observable.
Radar WebKit Bug Importer
Comment 7 2017-11-15 12:44:49 PST
Note You need to log in before you can comment on or make changes to this bug.