зеркало из https://github.com/mozilla/pjs.git
Fixing bug 408257. Make JS executed from plugins reset the slow script timeout if not called from within JS. r+sr=jonas@sicking.cc
This commit is contained in:
Родитель
0e7f93e216
Коммит
c110ebe9d6
|
@ -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();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче