Clean up script global acquisition in CallSetup

RESOLVED FIXED in mozilla28

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

unspecified
mozilla28
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
We do a bunch of QIs right now that aren't actually necessary. I can make this stuff quite a bit faster and simpler. :-)
(Assignee)

Comment 1

4 years ago
Created attachment 8335080 [details] [diff] [review]
Part 1 - Be more direct in GetStaticScriptGlobal. v1

This can all collapse because of the following facts:
* Ever since we introduced SandboxPrivate, we never actually use a Window
  as an SOP for a sandbox.
* nsGlobalWindow is actually the only thing that implements nsIScriptGlobalObject.
Attachment #8335080 - Flags: review?(bzbarsky)
(Assignee)

Comment 2

4 years ago
Created attachment 8335081 [details] [diff] [review]
Part 2 - Stop going through nsIScriptGlobalObject in CallSetup. v2
Attachment #8335081 - Flags: review?(bzbarsky)
Comment on attachment 8335080 [details] [diff] [review]
Part 1 - Be more direct in GetStaticScriptGlobal. v1

Hrm.  We sure used to have code that depended on finding the window via this codepath for sandboxes!  I guess maybe it doesn't anymore.

>+    // This assumes that we only have WN window globals.

Can we just GetISupportsFromJSObject our way to victory here?  Though we'd then need to deal with the nsISupports maybe pointing to an XPCWrappedNative*...

Basically, I'd rather we didn't add pitfalls here for the Window conversion to webidl.

r=me with that fixed.
Attachment #8335080 - Flags: review?(bzbarsky) → review+
Comment on attachment 8335081 [details] [diff] [review]
Part 2 - Stop going through nsIScriptGlobalObject in CallSetup. v2

r=me
Attachment #8335081 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/c8e22393c137
https://hg.mozilla.org/mozilla-central/rev/181e285a7d51
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28

Updated

4 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.