Last Comment Bug 768050 - Make TypedArray::Create take a wrapper cache and create JS objects in the compartment of the cache's wrapper
: Make TypedArray::Create take a wrapper cache and create JS objects in the com...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Peter Van der Beken [:peterv]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-25 09:47 PDT by Peter Van der Beken [:peterv]
Modified: 2012-06-28 01:11 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (6.33 KB, patch)
2012-06-25 09:47 PDT, Peter Van der Beken [:peterv]
bzbarsky: review+
Details | Diff | Splinter Review

Description Peter Van der Beken [:peterv] 2012-06-25 09:47:55 PDT
Created attachment 636352 [details] [diff] [review]
v1
Comment 1 Boris Zbarsky [:bz] (TPAC) 2012-06-25 10:57:21 PDT
Comment on attachment 636352 [details] [diff] [review]
v1

r=me
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-06-25 11:00:55 PDT
Comment on attachment 636352 [details] [diff] [review]
v1

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

::: dom/bindings/TypedArray.h
@@ +48,5 @@
> +         T* data = NULL) {
> +    JSObject* creatorWrapper;
> +    JSAutoEnterCompartment ac;
> +    if (creator && (creatorWrapper = creator->GetWrapperPreserveColor())) {
> +      ac.enter(cx, creatorWrapper);

Need to check for failure.
Comment 3 Boris Zbarsky [:bz] (TPAC) 2012-06-25 11:04:12 PDT
Mmm.  Can it fail in a non-insane way?  There's not much we can do about failure in a constructor....
Comment 4 Peter Van der Beken [:peterv] 2012-06-27 07:05:49 PDT
I made it return NULL if enter fails (due to OOM).

https://hg.mozilla.org/integration/mozilla-inbound/rev/ee34f7b36241
Comment 5 Ed Morley [:emorley] 2012-06-28 01:11:26 PDT
https://hg.mozilla.org/mozilla-central/rev/ee34f7b36241

Note You need to log in before you can comment on or make changes to this bug.