Move nsJSContext::{Set,Create}OuterObject to nsGlobalWindow

RESOLVED FIXED in mozilla14

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
CreateOuterObject only has one caller, nsGlobalWindow::SetNewDocument. SetOuterObject has two, CreateOuterObject and SetNewDocument. It seems better to just move that code to nsGlobalWindow.cpp.

The only nsJSContext state these functions use is mContext, which we can get through GetNativeContext().

This will also allow us to make NS_NewOuterWindowProxy private to nsGlobalWindow.cpp.
(Assignee)

Updated

5 years ago
Depends on: 733606
(Assignee)

Updated

5 years ago
Assignee: nobody → Ms2ger
(Assignee)

Comment 1

5 years ago
Created attachment 604512 [details] [diff] [review]
Patch v1

https://tbpl.mozilla.org/?tree=Try&rev=0e78df4b474c
Attachment #604512 - Flags: review?(bobbyholley+bmo)
Comment on attachment 604512 [details] [diff] [review]
Patch v1

>diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h
>--- a/dom/base/nsIScriptContext.h
>+++ b/dom/base/nsIScriptContext.h
>@@ -89,16 +89,18 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptC
> class nsIScriptContext : public nsIScriptContextPrincipal
> {
> public:
>   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXT_IID)
> 
>   /* Get the ID of this language. */
>   virtual PRUint32 GetScriptTypeID() = 0;
> 
>+  virtual void SetGlobalObject(nsIScriptGlobalObject* aGlobalObject) = 0;
>+

It would be nice if this didn't have to be virtual, but maybe that de-agnostification is a task for another day. 

Nice patch - sorry for the delay. I wanted to take some time to really grok this stuff.

r=bholley
Attachment #604512 - Flags: review?(bobbyholley+bmo) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/53ed280cc94b
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.