Closed
Bug 1019163
Opened 11 years ago
Closed 10 years ago
Hold a weak ref to the principal in AutoEntryScript
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8432708 -
Flags: review?(bobbyholley)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
In practice the only caller that sets mWebIDLCallerPrincipal is the CallSetup ctor, and it only does this in the aIsJSImplementedWebIDL case.
Is it possible in this case for the principal we get from SubjectPrincipal() to not be owned by anything on the stack? I don't think so: we came in via a JSNative, and its callee is an object that owns the relevant compartment and principal.
So I think this is in fact safe. I'm open to comments to make the restrictions on setting mWebIDLCallerPrincipal clearer!
Flags: needinfo?(bzbarsky)
Comment 4•11 years ago
|
||
Comment on attachment 8432708 [details] [diff] [review]
Hold a weak ref to the principal in AutoEntryScript, to reduce call overhead
Review of attachment 8432708 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/ScriptSettings.h
@@ +179,5 @@
> private:
> JSAutoCompartment mAc;
> dom::ScriptSettingsStack& mStack;
> + // It's safe to make this a weak pointer, since it's the subject principal
> + // when we go on the stack, so can't go away until after we're gone.
Can you add the aforementioned nuances to this comment?
Attachment #8432708 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla32
Comment 6•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•