Closed Bug 1640606 Opened 4 years ago Closed 4 years ago

Throw while de-serializing instead of serializing if message contains a shared memory object

Categories

(Core :: DOM: Service Workers, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: tt, Assigned: tt)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

I found this while checking https://searchfox.org/mozilla-central/source/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html

This test is marked to be expected to fail, but it should be expected to time out.

It fails because ServiceWorker::PostMessage throws if the message object contains a shared memory object in the current implementation. So we failed at this line.

The correct behavior, for now, is to make this test timeout before we supported letting a ServiceWorker or SharedWorker lives in a cross-origin isolated environment.

I say time out because we hide the constructor of SharedArrayBuffer when it's not in the cross-origin isolated environment. So, we should fail at here and thus cause the test to time out.

I will update patches to update the expectation of the test and to fix this.

Anything I can help with to land this?

Flags: needinfo?(ttung)
Flags: needinfo?(amarchesini)

It's probably my fault that I didn't request review again after replying to :baku's question. (and I just did that).

Flags: needinfo?(ttung)
Flags: needinfo?(amarchesini)
Priority: P3 → P2
Pushed by ttung@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3a5540f2c69a
Throw while de-serializing instead of serializing if message contains a shared memory object; r=baku,dom-workers-and-storage-reviewers,edenchuang
https://hg.mozilla.org/integration/autoland/rev/49ec39152921
Update some tests to reflect the correct behaviors; r=annevk
https://hg.mozilla.org/integration/autoland/rev/23f6ce8ab4ce
Expected two test cases for extendable message event to pass; r=dom-workers-and-storage-reviewers,edenchuang
You need to log in before you can comment on or make changes to this bug.