Closed Bug 1469882 Opened 6 years ago Closed 6 years ago

don't consult SWM in current process when populating client MessageEvent.source with e10s pref flipped

Categories

(Core :: DOM: Service Workers, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: bkelly, Assigned: bkelly)

References

Details

Attachments

(1 file)

When client.postMessage() is used from a service worker the event.source holds a ServiceWorker binding object.  Currently we consult the SWM to ensure that the given service worker exists in the current process.  Due to propagation it can sometimes not actually exist.

With the e10s pref flipped, though, we should not be looking at the SWM in the current process.  Instead we should just create the binding object and let it attach to the parent process as normal.
Comment on attachment 8986476 [details] [diff] [review]
Don't consult child process ServiceWorkerManager when populating MessageEvent.source with the e10s pref flipped. r=mrbkap

Blake, when a service worker calls Client.postMessage() the resulting MessageEvent.source is automatically populated with a ServiceWorker binding object pointing back to the caller.

In our legacy child-process model we would consult the local process SWM to determine if it new about the given source ServiceWorker yet or not.  Due to async propagation there were races that meant a postMessage() could arrive before the SWM learned of the new service worker.

In our new parent-process model, though, we cannot directly consult the SWM because its not running in the child.  Also, we shouldn't need to consult it since there is no SWM propagation that we can race with.

This patch makes the new parent-based mode just create the binding object without consulting the SWM.
Attachment #8986476 - Flags: review?(mrbkap)
Attachment #8986476 - Flags: review?(mrbkap) → review+
Pushed by bkelly@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c208fc0cd931
Don't consult child process ServiceWorkerManager when populating MessageEvent.source with the e10s pref flipped. r=mrbkap
https://hg.mozilla.org/mozilla-central/rev/c208fc0cd931
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: