mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1558098 - postMessage to a redundant service worker should drop silently r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D162596
This commit is contained in:
parent
1fc6ac5d91
commit
aa87b835c9
@ -236,8 +236,14 @@ void ServiceWorker::GetScriptURL(nsString& aURL) const {
|
||||
void ServiceWorker::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const Sequence<JSObject*>& aTransferable,
|
||||
ErrorResult& aRv) {
|
||||
// Step 6.1 of
|
||||
// https://w3c.github.io/ServiceWorker/#service-worker-postmessage-options
|
||||
// invokes
|
||||
// https://w3c.github.io/ServiceWorker/#run-service-worker
|
||||
// which returns failure in step 3 if the ServiceWorker state is redundant.
|
||||
// This will result in the "in parallel" step 6.1 of postMessage itself early
|
||||
// returning without starting the ServiceWorker and without throwing an error.
|
||||
if (State() == ServiceWorkerState::Redundant) {
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
[postmessage.https.html]
|
||||
expected:
|
||||
if (os == "android") and fission: [OK, TIMEOUT]
|
||||
[postMessage to a redundant worker]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user