Fixing bug 408257. Make JS executed from plugins reset the slow script timeout if not called from within JS. r+sr=jonas@sicking.cc

git-svn-id: svn://10.0.0.236/trunk@243647 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.org
2008-01-21 05:34:17 +00:00
parent a1eb60b8dc
commit 456f40ce6c

View File

@@ -42,6 +42,7 @@
#include "nsPIPluginInstancePeer.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
#include "nsDOMJSUtils.h"
#include "nsIDocument.h"
#include "nsIJSRuntimeService.h"
#include "nsIJSContextStack.h"
@@ -265,7 +266,22 @@ struct AutoCXPusher
~AutoCXPusher()
{
sContextStack->Pop(nsnull);
JSContext *cx = nsnull;
sContextStack->Pop(&cx);
JSContext *currentCx = nsnull;
sContextStack->Peek(&currentCx);
if (!currentCx) {
// No JS is running, tell the context we're done executing
// script.
nsIScriptContext *scx = GetScriptContextFromJSContext(cx);
if (scx) {
scx->ScriptEvaluated(PR_TRUE);
}
}
OnWrapperDestroyed();
}