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.
Created attachment 604512 [details] [diff] [review]
Comment on attachment 604512 [details] [diff] [review]
>diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h
>@@ -89,16 +89,18 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptC
> class nsIScriptContext : public nsIScriptContextPrincipal
> /* 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.