Closed Bug 1575425 Opened 5 years ago Closed 4 years ago

Support [AllowShared]

Categories

(Core :: DOM: Bindings (WebIDL), enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox70 --- wontfix
firefox74 --- fixed

People

(Reporter: saschanaz, Assigned: edgar)

References

(Blocks 3 open bugs)

Details

Attachments

(5 files, 1 obsolete file)

[AllowShared] allows IDL operations to receive SharedArrayBuffer-backed buffer source types, and thus required for SharedArrayBuffer uses.

In a way this is a duplicate of bug 1231687, but it's also much clearer...

Priority: -- → P3

Edgar, is this something you could take this on? (The priority comes from the duplicate and because this is important for eventually shipping SharedArrayBuffer support.)

Blocks: 1525330, resab
Flags: needinfo?(echen)
Priority: P3 → P2
Version: 70 Branch → Trunk

Yes, I could take this one.

Assignee: nobody → echen
Flags: needinfo?(echen)

Edgar, we should probably also clean up some of the code of https://hg.mozilla.org/mozilla-central/rev/91fe35e7df1fa3124c266c249ad0907320dfd956. E.g., Crypto::GetRandomValues will now be checked at the IDL layer so there's no need for it to throw inline, right? Similarly, the TypedArray bindings setup described there is no longer needed as we get safety from the IDL layer so we know if we can be dealing with shared beyond that and there's no need for two explicit APIs. (Edit: I guess an exception here is APIs that use any, such as postMessage(), but we need to check those either way as treating a SharedArrayBuffer as an empty buffer is wrong too.)

(In reply to Anne (:annevk) from comment #6)

Edgar, we should probably also clean up some of the code of https://hg.mozilla.org/mozilla-central/rev/91fe35e7df1fa3124c266c249ad0907320dfd956. E.g., Crypto::GetRandomValues will now be checked at the IDL layer so there's no need for it to throw inline, right?

Yes, we could drop those inline checks in this bug, I would think.

Similarly, the TypedArray bindings setup described there is no longer needed as we get safety from the IDL layer so we know if we can be dealing with shared beyond that and there's no need for two explicit APIs. (Edit: I guess an exception here is APIs that use any, such as postMessage(), but we need to check those either way as treating a SharedArrayBuffer as an empty buffer is wrong too.)

And I plan to do TypedArray clean up in a follow-up bug.

Depends on: 1603461

(Removing "resab" as blocker to make that bug's immediate dependencies less cluttered. This still remains important for shipping SharedArrayBuffer (without postMessage() support) to release in 75.)

No longer blocks: resab

There is no SharedArrayBuffer type defined in WebIDL spec.

We need this for upcoming change which supports having [AllowShared] on
ArrayBuffer type in WebIDL.

Now we support [AllowShared] in WebIDL, we don't need to manually check shareness
and throw exception if API don't accept SharedArrayBuffer, the binding will handle
it.

There's no need for two explicit APIs as we get safety from the IDL layer. And
treating a SharedArrayBuffer as an empty buffer is wrong too.

Blocks: 1609445
Blocks: 1610399
Attachment #9121004 - Attachment description: Bug 1575425 - Part 3-1: Add support for [AllowShared]; → Bug 1575425 - Part 3: Add support for [AllowShared];
Attachment #9121005 - Attachment is obsolete: true
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/76604cb38aad
Part 1: Remove SharedArrayBuffer type in WebIDL parser; r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/81b22b1796a6
Part 2: Merge ArrayBuffer and SharedArrayBuffer in DOM binding; r=bzbarsky,jwalden
https://hg.mozilla.org/integration/autoland/rev/285f272135f4
Part 3: Add support for [AllowShared]; r=bzbarsky,jwalden
https://hg.mozilla.org/integration/autoland/rev/8cf423865978
Part 4: Remove manually checking shareness in various APIs implmentation; r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/f2b77060cc80
Part 5: Remove DataAllowShared and LengthAllowShared from TypedArray bindings; r=bzbarsky
See Also: → 1854583
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: