Adding GetScriptGlobalObject function to nsIScriptContextOwner interface
git-svn-id: svn://10.0.0.236/trunk@6378 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -137,6 +137,7 @@ public:
|
||||
|
||||
// nsIScriptContextOwner
|
||||
NS_IMETHOD GetScriptContext(nsIScriptContext **aContext);
|
||||
NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal);
|
||||
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext);
|
||||
|
||||
// nsWebShell
|
||||
@@ -1051,6 +1052,23 @@ nsWebShell::GetScriptContext(nsIScriptContext** aContext)
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWebShell::GetScriptGlobalObject(nsIScriptGlobalObject** aGlobal)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aGlobal, "null arg");
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (nsnull == mScriptGlobal) {
|
||||
res = NS_NewScriptGlobalObject(&mScriptGlobal);
|
||||
if (NS_OK != res) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
*aGlobal = mScriptGlobal;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWebShell::ReleaseScriptContext(nsIScriptContext *aContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user