The default bug view has changed. See this FAQ.

Typed array argument codegen for bindings

RESOLVED FIXED in mozilla15

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

unspecified
mozilla15
x86
Mac OS X
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Once bug 742145 is fixed...
Blocks: 749866
Created attachment 619254 [details] [diff] [review]
Codegen for typed array and arraybuffer arguments.

I think this depends on the infrastructure bug 748267.  Also, I didn't do typed array return values yet, because I have no real way to test them.
Attachment #619254 - Flags: review?(peterv)
Depends on: 748267
Summary: Typed array codegen for bindings → Typed array argument codegen for bindings
Whiteboard: [needs review]
Whiteboard: [needs review] → [need review]
Comment on attachment 619254 [details] [diff] [review]
Codegen for typed array and arraybuffer arguments.

Review of attachment 619254 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsXMLHttpRequest.cpp
@@ +2633,5 @@
>    aContentType.SetIsVoid(true);
>    aCharset.Truncate();
>  
> +  PRInt32 length = aArrayBuffer->mLength;
> +  char* data = reinterpret_cast<char*>(aArrayBuffer->mData);

Can this be a static_cast?
No.  Can't static_cast from uint8_t* to char*.  At least not on my compiler.  ;)
Depends on: 747827
Created attachment 626287 [details] [diff] [review]
Updated to be a little simpler
Attachment #626287 - Flags: review?(peterv)
Attachment #619254 - Attachment is obsolete: true
Attachment #619254 - Flags: review?(peterv)
Comment on attachment 626287 [details] [diff] [review]
Updated to be a little simpler

Review of attachment 626287 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/Codegen.py
@@ +1414,5 @@
> +        elif type.isArrayBufferView():
> +            name = "ArrayBufferView"
> +            jsname = "TypedArrayObject"
> +        else:
> +            name = type.name

Can't you always set name to type.name, even for ArrayBuffer and ArrayBufferView?
Attachment #626287 - Flags: review?(peterv) → review+
> Can't you always set name to type.name, even for ArrayBuffer and ArrayBufferView?

I think so, yes.  Will do.
http://hg.mozilla.org/mozilla-central/rev/faa1929dc247
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Whiteboard: [need review]
Target Milestone: --- → mozilla15
Added decent tests in https://hg.mozilla.org/integration/mozilla-inbound/rev/e0d8fa7fe174
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.