Closed
Bug 985472
Opened 10 years ago
Closed 10 years ago
Adding Cu.cloneInto to the exportHelpers toolset for sandboxes
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: gkrizsanits, Assigned: gkrizsanits)
Details
Attachments
(2 files)
1.80 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
7.61 KB,
patch
|
bholley
:
review+
lsblakk
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
I think this would be useful for content-scripts too.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → gkrizsanits
Assignee | ||
Comment 1•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=0380f5dd0474
Assignee | ||
Comment 2•10 years ago
|
||
Sigh... I still found some leftover...
Attachment #8396285 -
Flags: review?(bobbyholley)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8396287 -
Flags: review?(bobbyholley)
Updated•10 years ago
|
Attachment #8396285 -
Flags: review?(bobbyholley) → review+
Comment 4•10 years ago
|
||
Comment on attachment 8396287 [details] [diff] [review] part2: cloneInto for sandbox. v1 Review of attachment 8396287 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the fixes below. ::: js/xpconnect/src/Sandbox.cpp @@ +1144,5 @@ > if (options.wantExportHelpers && > (!JS_DefineFunction(cx, sandbox, "exportFunction", ExportFunction, 3, 0) || > !JS_DefineFunction(cx, sandbox, "evalInWindow", EvalInWindow, 2, 0) || > !JS_DefineFunction(cx, sandbox, "createObjectIn", CreateObjectIn, 2, 0) || > + !JS_DefineFunction(cx, sandbox, "cloneInto", CloneInto, 3, 0) || I _think_ that nargs should probably be the minimum number of args, not including the options object. At least that's what the others do here, so we might as well be consistent. ::: js/xpconnect/src/XPCComponents.cpp @@ +3627,5 @@ > + return false; > + > + RootedObject scope(aCx, &aScope.toObject()); > + scope = js::CheckedUnwrap(scope); > + NS_ENSURE_TRUE(scope, false); Given that this can fail now, we need an explicit JS_ReportError here, otherwise this will be misinterpretted as OOM. Please add a test to make sure we throw something that passes /denied|insecure/.test(exn).
Attachment #8396287 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 5•10 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #4) > I _think_ that nargs should probably be the minimum number of args, not > including the options object. At least that's what the others do here, so we > might as well be consistent. The others are including the options object too if they have any. So either all are consistently good or bad. Where can I double check that?
Comment 6•10 years ago
|
||
(In reply to Gabor Krizsanits [:krizsa :gabor] from comment #5) > The others are including the options object too if they have any. So either > all are consistently good or bad. Where can I double check that? Oh you're right. In that case just leave it for now. :-)
Assignee | ||
Comment 7•10 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/eb71b9829f50 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/7b56ebbcdef7
https://hg.mozilla.org/mozilla-central/rev/eb71b9829f50 https://hg.mozilla.org/mozilla-central/rev/7b56ebbcdef7
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Assignee | ||
Comment 9•10 years ago
|
||
Comment on attachment 8396287 [details] [diff] [review] part2: cloneInto for sandbox. v1 [Approval Request Comment] Bug caused by (feature/regressing bug #): It's a new feature. Add-on developers have a new set of API to overcome the difficulties that comes with running content-scripts with nsExpandedPrincipal. I was supposed to land this one on ff30 but it seems like it made into 31 only, which I overlooked... User impact if declined: Add-on developers will have a missing API which make their life harder while migrating to the new world (content-scripts running with nsExpandedPrincipal) Testing completed (on m-c, etc.): it's on mc and aurora Risk to taking this patch (and alternatives if risky): it's not risky String or IDL/UUID changes made by this patch: none
Attachment #8396287 -
Flags: approval-mozilla-beta?
Updated•10 years ago
|
Attachment #8396287 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 10•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/b955f950df88 https://hg.mozilla.org/releases/mozilla-beta/rev/4c244576343b
status-firefox30:
--- → fixed
status-firefox31:
--- → fixed
Comment 11•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g30_v1_4/rev/b955f950df88 https://hg.mozilla.org/releases/mozilla-b2g30_v1_4/rev/4c244576343b
Flags: in-testsuite+
Updated•10 years ago
|
status-b2g-v1.4:
--- → fixed
status-b2g-v2.0:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•