Closed Bug 1218621 Opened 5 years ago Closed 5 years ago

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

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

Details

Attachments

(1 file)

Follow-up from bug 1214772.
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: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.