Closed
Bug 929609
Opened 11 years ago
Closed 10 years ago
WebIDL JS implemented Uint8Array not working
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: dgarnerlee, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 3 obsolete files)
6.17 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
25.94 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
Uint8Array in a JS implemented WebIDL appears to be unsupported. Exmaple: [Constructor(Uint8Array payload), JSImplementation="@mozilla.org/nfc/FooRecord;1"] interface FooRecord { readonly attribute Uint8Array payload; }; In generated C++ FooRecordBindings code, on compilation, it will complain that the symbol Uint8Array is missing (Found in TypedArray.h?) On IRC, mccr8 pointed to comments in TestJSImplGen.webidl: // ArrayBuffer is handled differently in callback interfaces and the example generator. // Need to figure out what should be done there. Seems like other typed array stuff is // similarly not working in the JS implemented generator. Probably some other issues // here as well.
Reporter | ||
Comment 1•11 years ago
|
||
WebNFC (Bug 674741) would like to use it, but is not blocked by this.
Updated•11 years ago
|
Blocks: ParisBindings
Component: XPConnect → DOM
Assignee | ||
Comment 2•11 years ago
|
||
I have a patch for this, which I will attach here just for posterity. But Bobby wants us to get the security story here straight before we land such a patch.
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Comment 5•11 years ago
|
||
In particular, we need Xrays for typed arrays before we can land this, as I understand. Bobby, do we have a bug tracking that?
Flags: needinfo?(bobbyholley+bmo)
Blocks: b2g-nfc
Requesting for an update on possibility of using typed arrays in WebIDL on JS implemented interfaces. We are currently proposing interfaces for Secure Element (https://bugzilla.mozilla.org/show_bug.cgi?id=879861 - comment#87 ) that may have to use typed arrays on JS implemented interfaces.
Comment 7•10 years ago
|
||
Yes, we have Xrays to TypedArrays now. They basically just throw and say "hey, you should clone this instead", but things should be secure-by-default with the new wrappers in place.
Comment 9•10 years ago
|
||
Boris, is it possible to fix this now, per comment 7? It sounds like some B2G people would like this for some WebIDL they are working on and they are asking about what kind of timeline etc. there is for fixing this.
Blocks: 879861
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 10•10 years ago
|
||
Hmm. It seems to me like the setup described in 7 will make actually implementing such an API pretty painful. But we can certainly do the codegen bits; life will just suck in the JS implementation. I guess for bug 929609 we just need the typed array return value, not an argument, so maybe it doesn't matter too much. I'll try to get to this in the next few days.
Assignee | ||
Comment 11•10 years ago
|
||
Attachment #8476495 -
Flags: review?(peterv)
Assignee | ||
Updated•10 years ago
|
Attachment #820777 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 12•10 years ago
|
||
Attachment #8476496 -
Flags: review?(peterv)
Assignee | ||
Updated•10 years ago
|
Attachment #820779 -
Attachment is obsolete: true
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8476711 -
Flags: review?(peterv)
Assignee | ||
Updated•10 years ago
|
Attachment #8476496 -
Attachment is obsolete: true
Attachment #8476496 -
Flags: review?(peterv)
Blocks: 979767
Comment 14•10 years ago
|
||
Comment on attachment 8476495 [details] [diff] [review] part 1. Rename "jsObjectsArePtr" to "typedArraysAreStructs" (and invert its meaning, of course), since that's what it's really used for nowadays Review of attachment 8476495 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +12048,3 @@ > """ > + If typedArraysAreStructs is false, typed arrays will be passed as > + JS::Handle<JSObject*>. Maybe also make it clear what true means, since that explains the name :-).
Attachment #8476495 -
Flags: review?(peterv) → review+
Comment 15•10 years ago
|
||
Comment on attachment 8476711 [details] [diff] [review] part 2. Fix passing of typed arrays to JS-implemented WebIDL to actually work Review of attachment 8476711 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +1039,5 @@ > + # Since we can't forward-declare typed array types > + # (because they're typedefs), we have to go ahead and > + # just include their header if we need to have functions > + # taking references to them declared in that header. > + headerSet = declareIncludes Hmm, 'k. Let's hope no one uses headerSet after this to add other headers for the general isInterface() case.
Attachment #8476711 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 16•10 years ago
|
||
> Let's hope no one uses headerSet after this to add other headers for the general
> isInterface() case.
I think we should be ok; I can't think of headers one would want for both SpiderMonkey and Gecko interfaces.
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 17•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dede44b94883 https://hg.mozilla.org/integration/mozilla-inbound/rev/1a3d7ec1a840
Flags: in-testsuite+
Target Milestone: --- → mozilla34
https://hg.mozilla.org/mozilla-central/rev/dede44b94883 https://hg.mozilla.org/mozilla-central/rev/1a3d7ec1a840
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•