New issue
Advanced search Search tips

Issue 617877 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 602693



Sign in to add a comment

frame.contentWindow.navigator.serviceWorker.controller.postMessage doesn't work

Project Member Reported by shimazu@chromium.org, Jun 7 2016

Issue description

This is used by /service-workers/service-worker/fetch-event-async-respond-with.https.html on WPT tests.
frame.contentWindow.navigator.serviceWorker.controller.postMessage cannot post the message, so this test is stuck and the test goes timeout.

Could anyone take a look?

 
Blocking: 602693
In Chromium, postMessage() involves thread hops in a renderer, so there is a possibility that frame.remove() overtakes postMessage() (see c#6 on  issue 608464 ). In the case, postMessage() silently fails.

Our latest test does not hit this issue because it uses add_completion_callback to remove the frame. Maybe we should push it to the W3C repo.

Comment 3 by bke...@mozilla.com, Jun 7 2016

I'm sympathetic since we had issues with this case as well, but as far as I can tell it should work according to the spec.  Getting this postMessage to work helped me fix some real bugs in our code.

I think we should keep this postMessage followed by frame.remove somewhere in the wpt test suite.  If you want to move it to a separate test case so it doesn't interfere with the respondWith test, that would be fine with me.  Does that sound reasonable?
Yes, it sounds good. Could you tell me where the spec is?

I'll send a PR like http://crrev.com/1859343002 and add the test into postmessage.https.html to keep track of the spec.

Comment 5 by bke...@mozilla.com, Jun 8 2016

The spec is here:

  https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-postmessage

AFAICT it should start the SW and queue a task to fire the message event at it before returning.
> In Chromium, postMessage() involves thread hops in a renderer, so there is a possibility that frame.remove() overtakes postMessage() (see c#6 on  issue 608464 ). In the case, postMessage() silently fails.

This thread hop is gone thanks to MessagePort mojofication:
https://codereview.chromium.org/2422793002 (see the diff on web_service_worker_impl.cc)

Comment 8 by falken@chromium.org, Nov 22 2017

Status: WontFix (was: Available)
fetch-event-async-respond-with.https.html looks passing now.

Sign in to add a comment