Closed
Bug 574299
Opened 15 years ago
Closed 15 years ago
TM: implement a runtime-wide wrap hook
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gal, Assigned: gal)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
33.61 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
Add a wrap hook that the engine invokes every time an object crosses a compartment boundary. This can be used to wrap objects into specialized JSCrossCompartmentWrappers that implement an access policy in addition to the mere cross compartment functionality.
virtual bool filter(JSContext *cx, JSObject *proxy, jsval id = JSVAL_VOID);
virtual bool enter(JSContext *cx, JSObject *proxy, void **statep);
virtual void leave(JSContext *cx, JSObject *proxy, void *state);
filter() can be used to filter out properties. enter() and leave() are called around wrapper operations (PIERCE).
For-each iterator objects are censored since there is no good way to filter them. A specific wrapper can overwrite this behavior by providing its own implementations for this derived API:
virtual bool filterProps(JSContext *cx, JSObject *proxy, js::AutoValueVector &props);
virtual bool filterIterator(JSContext *cx, JSObject *proxy, jsval *vp);
A highly transparent wrapper might want to overwrite filterIterator() and always permit it (just return "true", don't filter).
![]() |
Assignee | |
Comment 1•15 years ago
|
||
Assignee: general → gal
Attachment #453678 -
Flags: review?(jorendorff)
![]() |
Assignee | |
Comment 2•15 years ago
|
||
Attachment #453678 -
Attachment is obsolete: true
Attachment #453678 -
Flags: review?(jorendorff)
![]() |
Assignee | |
Updated•15 years ago
|
Attachment #453807 -
Attachment is patch: true
Attachment #453807 -
Attachment mime type: application/octet-stream → text/plain
Attachment #453807 -
Flags: review?(jorendorff)
![]() |
||
Comment 3•15 years ago
|
||
Comment on attachment 453807 [details] [diff] [review]
patch
Good first cut.
Attachment #453807 -
Flags: review?(jorendorff) → review+
![]() |
Assignee | |
Comment 4•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 5•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•