Followup changes to bzabarsky's review for bug 296639. Reviews pending, a=drivers@mozilla.org

git-svn-id: svn://10.0.0.236/trunk@177635 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.jstenback.com
2005-08-12 04:11:00 +00:00
parent 594eaadf17
commit a9f668bc25
28 changed files with 579 additions and 318 deletions

View File

@@ -1335,6 +1335,9 @@ _getwindowobject(NPP npp)
JSContext *cx = GetJSContextFromNPP(npp);
NS_ENSURE_TRUE(cx, nsnull);
// Using ::JS_GetGlobalObject(cx) is ok here since the window we
// want to return here is the outer window, *not* the inner (since
// we don't know what the plugin will do with it).
return nsJSObjWrapper::GetNewOrUsed(npp, cx, ::JS_GetGlobalObject(cx));
}

View File

@@ -52,6 +52,7 @@
#include "nsIServiceManager.h"
#include "nsIDocument.h"
#include "nsPIDOMWindow.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
#include "nsIDirectoryService.h"
@@ -781,8 +782,9 @@ nsPluginInstancePeerImpl::GetJSWindow(JSObject* *outJSWindow)
rv = mOwner->GetDocument(getter_AddRefs(document));
if (NS_SUCCEEDED(rv) && document) {
nsIScriptGlobalObject *global = document->GetScriptGlobalObject();
nsPIDOMWindow *win = document->GetWindow();
nsCOMPtr<nsIScriptGlobalObject> global = do_QueryInterface(win);
if(global) {
*outJSWindow = global->GetGlobalJSObject();
}