Fix bug 300756. Make sure we can find a JS context when tearing down plugins

even with fastback enabled. Patch by jst, r=shaver@mozilla.org, sr=brendan@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@180462 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-09-17 03:40:08 +00:00
parent 44f06dde36
commit 46732657ad
2 changed files with 4 additions and 4 deletions

View File

@@ -234,7 +234,8 @@ GetJSContext(NPP npp)
owner->GetDocument(getter_AddRefs(doc));
NS_ENSURE_TRUE(doc, nsnull);
nsIScriptGlobalObject *sgo = doc->GetScriptGlobalObject();
nsCOMPtr<nsISupports> documentContainer = doc->GetContainer();
nsCOMPtr<nsIScriptGlobalObject> sgo(do_GetInterface(documentContainer));
NS_ENSURE_TRUE(sgo, nsnull);
nsIScriptContext *scx = sgo->GetContext();

View File

@@ -108,8 +108,7 @@
// for the dialog
#include "nsIStringBundle.h"
#include "nsIWindowWatcher.h"
#include "nsIDOMWindow.h"
#include "nsIDOMWindowInternal.h"
#include "nsPIDOMWindow.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptGlobalObjectOwner.h"
@@ -2820,7 +2819,7 @@ nsresult nsPluginHostImpl:: GetPrompt(nsIPluginInstanceOwner *aOwner, nsIPrompt
nsCOMPtr<nsIDocument> document;
aOwner->GetDocument(getter_AddRefs(document));
if (document) {
domWindow = do_QueryInterface(document->GetScriptGlobalObject());
domWindow = document->GetWindow();
}
}