Closed Bug 768050 Opened 9 years ago Closed 9 years ago

Make TypedArray::Create take a wrapper cache and create JS objects in the compartment of the cache's wrapper

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: peterv, Assigned: peterv)

Details

Attachments

(1 file)

Attached patch v1Splinter Review
No description provided.
Attachment #636352 - Flags: review?(bzbarsky)
Comment on attachment 636352 [details] [diff] [review]
v1

r=me
Attachment #636352 - Flags: review?(bzbarsky) → review+
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.
Mmm.  Can it fail in a non-insane way?  There's not much we can do about failure in a constructor....
I made it return NULL if enter fails (due to OOM).

https://hg.mozilla.org/integration/mozilla-inbound/rev/ee34f7b36241
https://hg.mozilla.org/mozilla-central/rev/ee34f7b36241
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.