Closed
Bug 672266
Opened 15 years ago
Closed 13 years ago
add TypedArray support to nsIVariant
Categories
(Core :: XPConnect, enhancement)
Core
XPConnect
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: fcellier, Assigned: fcellier)
Details
Attachments
(2 files, 3 obsolete files)
|
17.18 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.04 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
Having XPCOM array from TypedArray is not possible right now(wihtout quicstubs).
we can't write :
idl:
#include "nsISupports.idl"
[scriptable, uuid(cd247fc5-472e-4ee9-9bf2-15a22ec9a08a)]
interface nsITest : nsISupports
{ void test(in nsIVariant array);};
js:
var int32View = new Int32Array(buffer);
mITest.test(int32View);
| Assignee | ||
Comment 1•15 years ago
|
||
Attachment #546564 -
Flags: feedback?(mrbkap)
It supports jsvals doesn't it?
| Assignee | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> It supports jsvals doesn't it?
If someone is in gecko, there is no real problem. It's not as simple as it could be (call xpconnect and nsIThreadJSContextStack etc..) and I thought it was nsIvariant purpose to help with that stuff.
Futhermore if somebody make an extension, it can't access to typedArray (error in linkage), am I wrong?
Comment 4•15 years ago
|
||
Comment on attachment 546564 [details] [diff] [review]
add typedArray
Hi Fabien,
This patch looks pretty good. I did just land a couple of changes that changed the API a little (see bug 664249). I do have a couple of nits, though. Would you mind attaching a second patch addressing them?
The PRSize variable shouldn't be named mSize as the m prefix indicates a member of a class. size would work better.
Since XPConnect has the ugliest coding style on earth, please delete the spaces after "if (" and "switch (".
Case TYPE_UINT8 appears to be misindented.
Thanks a lot for your patch!
Attachment #546564 -
Flags: feedback?(mrbkap)
Updated•15 years ago
|
Assignee: nobody → fabien.cellier
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 5•15 years ago
|
||
Sorry for the delay. Some corrections for the patch ( indentation and new TypedArray API etc)
Attachment #546564 -
Attachment is obsolete: true
| Assignee | ||
Comment 6•15 years ago
|
||
With this patch, nsIWritableVariant will use typedArray for the js representation (I don't know if it's a good idea but perf are better for big arrays :) .
Some parts are very ugly and I must find a way to change that.
In fact, 2 things really hurt my eyes:
Some repetitions in XPCVariant and xpcconvert
macro problems with AUTO_MARK_JSVAL and the ugly solution I wrote(perhaps it's better to replace macro by class helper with templates)
If I have time, I'll fix that soon. I attach the patch just in case
| Assignee | ||
Updated•15 years ago
|
Attachment #551595 -
Flags: review?(mrbkap)
Comment 8•15 years ago
|
||
Comment on attachment 551595 [details] [diff] [review]
add typedArray in variant (JS -> C++)
Review of attachment 551595 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good. One small comment to address. r=me with it.
::: js/src/xpconnect/src/xpcvariant.cpp
@@ +405,5 @@
> +
> + if(js_IsTypedArray(jsobj))
> + {
> + JSObject* typedArray = js::TypedArray::getTypedArray(jsobj);
> + if(typedArray)
I don't think this getTypedArray call or the null check are needed after js_IsTypedArray returns true.
Attachment #551595 -
Flags: review?(mrbkap) → review+
| Assignee | ||
Comment 9•15 years ago
|
||
Attachment #551595 -
Attachment is obsolete: true
Attachment #564616 -
Flags: review?(mrbkap)
Updated•15 years ago
|
Attachment #564616 -
Flags: review?(mrbkap) → review+
| Assignee | ||
Comment 10•13 years ago
|
||
It was done in XPCConvert. Don't need it anymore
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•