Closed Bug 890729 Opened 6 years ago Closed 6 years ago

Implement the missing CPOW traps

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: evilpie, Assigned: evilpie)

References

Details

(Whiteboard: [e10s])

Attachments

(2 files, 1 obsolete file)

This patch implement the traps that currently just crash. We don't need implement iterate, because the BaseProxyHandler version already does what we want. getOwnPropertyNames, keys and enumerate are very simliar, they are refactored to use only one IPDL method and pass the right flags. This is based on a similar implementation in jsproxy.cpp. I a going to write an other patch that reorders the traps and adds a few comments. I will also add tests for these traps once the message manager lands.
Attached patch v1 (obsolete) — Splinter Review
Assignee: general → evilpies
Status: NEW → ASSIGNED
Attachment #771863 - Flags: review?(dvander)
Attached patch v2Splinter Review
Removed some dead names
Attachment #771863 - Attachment is obsolete: true
Attachment #771863 - Flags: review?(dvander)
Attachment #772091 - Flags: review?(dvander)
Attachment #772074 - Flags: review?
Attachment #772074 - Flags: review? → review?(dvander)
Oh dammit just realized that I based this patch on larch and not central.
Comment on attachment 772074 [details] [diff] [review]
v2

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

::: js/ipc/JavaScriptChild.cpp
@@ +603,5 @@
> +{
> +    AutoSafeJSContext cx;
> +    JSAutoRequest request(cx);
> +
> +    JSObject *obj = findObject(objId);

RootedObject

@@ +609,5 @@
> +        return false;
> +
> +    JSAutoCompartment comp(cx, obj);
> +
> +    jsid internedId;

RootedId
Attachment #772074 - Flags: review?(dvander) → review+
https://hg.mozilla.org/mozilla-central/rev/5b1d4377a538
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 772091 [details] [diff] [review]
Reorder the proxy traps.

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

I know you didn't write these but if you're here, might as well fix some rooting issues :)

::: js/ipc/JavaScriptChild.cpp
@@ +143,5 @@
> +{
> +    AutoSafeJSContext cx;
> +    JSAutoRequest request(cx);
> +
> +    JS::RootedObject obj(cx, findObject(objId));

^-- Don't need JS:: here

@@ +175,5 @@
> +{
> +    AutoSafeJSContext cx;
> +    JSAutoRequest request(cx);
> +
> +    JSObject *obj = findObject(objId);

RootedObject

@@ +181,5 @@
> +        return false;
> +
> +    JSAutoCompartment comp(cx, obj);
> +
> +    jsid internedId;

RootedId

@@ +210,5 @@
> +{
> +    AutoSafeJSContext cx;
> +    JSAutoRequest request(cx);
> +
> +    JSObject *obj = findObject(objId);

RootedObject

@@ +216,5 @@
> +        return false;
> +
> +    JSAutoCompartment comp(cx, obj);
> +
> +    jsid internedId;

RootedId

@@ +275,5 @@
> +{
> +    AutoSafeJSContext cx;
> +    JSAutoRequest request(cx);
> +
> +    JSObject *obj = findObject(objId);

RootedObject

@@ +281,5 @@
> +        return false;
> +
> +    JSAutoCompartment comp(cx, obj);
> +
> +    jsid internedId;

RootedId
Attachment #772091 - Flags: review?(dvander) → review+
https://hg.mozilla.org/mozilla-central/rev/3d3141bc3598
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.