Closed
Bug 1474273
Opened 8 years ago
Closed 8 years ago
Add xpc::CurrentNativeGlobal(cx) helper function
Categories
(Core :: XPConnect, enhancement, P2)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file)
|
14.73 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
16 callers of NativeGlobal pass in JS::CurrentGlobalOrNull(cx) so let's add xpc::CurrentNativeGlobal(cx) for this so we don't have to worry about these callers anymore in bug 1474272.
| Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8990689 -
Flags: review?(bzbarsky)
Comment 2•8 years ago
|
||
Comment on attachment 8990689 [details] [diff] [review]
Add xpc::CurrentNativeGlobal and use it instead of NativeGlobal(JS::CurrentGlobalOrNull(cx))
>+++ b/dom/script/ScriptSettings.cpp
> nsCOMPtr<nsPIDOMWindowInner> window =
>- do_QueryInterface(xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx)));
>+ do_QueryInterface(xpc::CurrentNativeGlobal(aCx));
This could use xpc::CurrentWindowOrNull to be a bit quicker (no QI).
>+CurrentNativeGlobal(JSContext* cx);
We should probably document that this must not be called when cx is not in a Realm, right?
r=me
Attachment #8990689 -
Flags: review?(bzbarsky) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4c72dc399004
Add xpc::CurrentNativeGlobal and use it instead of NativeGlobal(JS::CurrentGlobalOrNull(cx)). r=bz
| Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #2)
> >+ do_QueryInterface(xpc::CurrentNativeGlobal(aCx));
>
> This could use xpc::CurrentWindowOrNull to be a bit quicker (no QI).
Ah thanks, done.
> We should probably document that this must not be called when cx is not in a
> Realm, right?
Done.
Updated•8 years ago
|
Priority: -- → P2
Comment 5•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•