Bug 195195 - Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
Summary: Make sure to correctly notify of end of a ServiceWorkerJob when the context i...
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: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-28 17:07 PST by youenn fablet
Modified: 2019-03-04 12:40 PST (History)
4 users (show)

See Also:


Attachments
Patch (8.96 KB, patch)
2019-02-28 17:18 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (9.47 KB, patch)
2019-03-01 12:06 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2019-02-28 17:07:22 PST
Make sure to correctly notify of end of job when the context is stopped
Comment 1 youenn fablet 2019-02-28 17:18:16 PST
Created attachment 363279 [details]
Patch
Comment 2 Alex Christensen 2019-03-01 11:39:20 PST
Comment on attachment 363279 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        Make sure to correctly notify of end of job when the context is stopped

This title should mention ServiceWorkerJob.  Otherwise it's way too vague.

> Source/WebCore/ChangeLog:14
> +        Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.

Should we unskip this test?

> Source/WebCore/workers/service/ServiceWorkerJob.cpp:-172
> -    if (!m_scriptLoader)

Why can this no longer be null?
Comment 3 youenn fablet 2019-03-01 11:41:13 PST
(In reply to Alex Christensen from comment #2)
> Comment on attachment 363279 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=363279&action=review
> 
> > Source/WebCore/ChangeLog:3
> > +        Make sure to correctly notify of end of job when the context is stopped
> 
> This title should mention ServiceWorkerJob.  Otherwise it's way too vague.
> 
> > Source/WebCore/ChangeLog:14
> > +        Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
> 
> Should we unskip this test?
> 
> > Source/WebCore/workers/service/ServiceWorkerJob.cpp:-172
> > -    if (!m_scriptLoader)
> 
> Why can this no longer be null?
Comment 4 youenn fablet 2019-03-01 11:42:10 PST
> > > Source/WebCore/ChangeLog:3
> > > +        Make sure to correctly notify of end of job when the context is stopped
> > 
> > This title should mention ServiceWorkerJob.  Otherwise it's way too vague.

OK

> > > Source/WebCore/ChangeLog:14
> > > +        Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
> > 
> > Should we unskip this test?

It is unskilled but crashes in debug sometimes.

> > > Source/WebCore/workers/service/ServiceWorkerJob.cpp:-172
> > > -    if (!m_scriptLoader)
> > 
> > Why can this no longer be null?

It is called in one place and we check for this before calling this method.
Comment 5 Chris Dumez 2019-03-01 11:46:13 PST
Comment on attachment 363279 [details]
Patch

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

> Source/WebCore/workers/service/ServiceWorkerContainer.h:151
> +    uint64_t m_ongoingSettledRegistrationCount { 0 };

Bad name, when I saw it I was wondering why you needed this member and did not rely on m_ongoingSettledRegistrations.size() instead.
We probably want to call it m_lastOngoingSettledRegistrationIdentifier, like the data member above.
Comment 6 youenn fablet 2019-03-01 12:06:51 PST
Created attachment 363352 [details]
Patch
Comment 7 WebKit Commit Bot 2019-03-04 12:31:03 PST
Comment on attachment 363352 [details]
Patch

Clearing flags on attachment: 363352

Committed r242372: <https://trac.webkit.org/changeset/242372>
Comment 8 WebKit Commit Bot 2019-03-04 12:31:05 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-03-04 12:40:47 PST
<rdar://problem/48572995>