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:
@@ -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(¤tCx);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user