Last Comment Bug 734029 - Move nsJSContext::{Set,Create}OuterObject to nsGlobalWindow
: Move nsJSContext::{Set,Create}OuterObject to nsGlobalWindow
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on: 733606
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-08 01:48 PST by :Ms2ger (⌚ UTC+1/+2)
Modified: 2012-03-24 05:23 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (14.31 KB, patch)
2012-03-09 13:24 PST, :Ms2ger (⌚ UTC+1/+2)
bobbyholley: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2012-03-08 01:48:33 PST
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.
Comment 1 :Ms2ger (⌚ UTC+1/+2) 2012-03-09 13:24:47 PST
Created attachment 604512 [details] [diff] [review]
Patch v1

https://tbpl.mozilla.org/?tree=Try&rev=0e78df4b474c
Comment 2 Bobby Holley (:bholley) (busy with Stylo) 2012-03-18 22:35:41 PDT
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
Comment 3 :Ms2ger (⌚ UTC+1/+2) 2012-03-24 05:23:03 PDT
https://hg.mozilla.org/mozilla-central/rev/53ed280cc94b

Note You need to log in before you can comment on or make changes to this bug.