Bug 238860 - ServiceWorkerDownloadTask starts listening for IPC in constructor
Summary: ServiceWorkerDownloadTask starts listening for IPC in constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-06 04:04 PDT by Kimmo Kinnunen
Modified: 2022-04-06 09:02 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.88 KB, patch)
2022-04-06 04:10 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch (6.88 KB, patch)
2022-04-06 04:12 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2022-04-06 04:04:06 PDT
ServiceWorkerDownloadTask starts listening for IPC in constructor
Comment 1 Kimmo Kinnunen 2022-04-06 04:10:07 PDT
Created attachment 456803 [details]
Patch
Comment 2 Kimmo Kinnunen 2022-04-06 04:12:05 PDT
Created attachment 456804 [details]
Patch
Comment 3 youenn fablet 2022-04-06 04:48:07 PDT
Comment on attachment 456804 [details]
Patch

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

> Source/WebKit/ChangeLog:10
> +        virtual function table of the `this` object has not been constructed fully yet. This means

I am not sure this is entirely exact, ServiceWorkerDownloadTask is the derived class.
In any case, calling virtual methods in constructor is probably best be avoided.
Comment 4 Kimmo Kinnunen 2022-04-06 06:06:10 PDT
(In reply to youenn fablet from comment #3)
> > Source/WebKit/ChangeLog:10
> > +        virtual function table of the `this` object has not been constructed fully yet. This means
> 
> I am not sure this is entirely exact, ServiceWorkerDownloadTask is the
> derived class.
> In any case, calling virtual methods in constructor is probably best be
> avoided.

This is exactly the case with the derived classes.
vptr is not thread-safe -- it will be correct only after all constructors have returned.
Comment 5 EWS 2022-04-06 09:01:24 PDT
Committed r292471 (249322@main): <https://commits.webkit.org/249322@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456804 [details].
Comment 6 Radar WebKit Bug Importer 2022-04-06 09:02:26 PDT
<rdar://problem/91356880>