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

RESOLVED FIXED in mozilla16

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: peterv, Assigned: peterv)

Tracking

Trunk
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 636352 [details] [diff] [review]
v1
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....
(Assignee)

Comment 4

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.