Keep the service worker alive while the promise passed to FetchEvent.respondWith() settles

RESOLVED FIXED in Firefox 44

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

unspecified
mozilla44
Points:
---

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

4 years ago
Follow-up from bug 1214772.
Assignee

Updated

4 years ago
Attachment #8679222 - Flags: review?(catalin.badea392)
Comment on attachment 8679222 [details] [diff] [review]
Keep the service worker alive while the promise passed to FetchEvent.respondWith() settles

Review of attachment 8679222 [details] [diff] [review]:
-----------------------------------------------------------------

I also have a nit request, rename the variable where we use FetchEvent.GetPromise in ServiceWorkerPrivate.cpp:
https://dxr.mozilla.org/mozilla-central/source/dom/workers/ServiceWorkerPrivate.cpp#1180

::: dom/workers/ServiceWorkerEvents.cpp
@@ +61,5 @@
>  FetchEvent::FetchEvent(EventTarget* aOwner)
> +  : ExtendableEvent(aOwner)
> +  , mIsReload(false)
> +  , mWaitToRespond(false)
> +  , mRespondWithEntered(false)

mRespondWithEntered and mWaitToRespond are used for the same thing, we don't need both.

@@ +438,5 @@
>    }
>  
>    // 4.5.3.2 If the respond-with entered flag is set, then:
>    // Throw an "InvalidStateError" exception.
> +  if (mRespondWithEntered) {

This check is redundant with the one above that uses mWaitToRespond, please remove it.
Attachment #8679222 - Flags: review?(catalin.badea392) → review+
https://hg.mozilla.org/mozilla-central/rev/1a1d5630602c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.