зеркало из https://github.com/mozilla/pjs.git
Bug 606371 - Use scopeChain and AccessCheck to determine if a script is chrome [r=mrbkap a=blocking-fennec]
This commit is contained in:
Родитель
c1917fad5f
Коммит
30ea160b50
|
@ -105,6 +105,12 @@
|
||||||
#include "WrapperFactory.h"
|
#include "WrapperFactory.h"
|
||||||
#include "nsGlobalWindow.h"
|
#include "nsGlobalWindow.h"
|
||||||
|
|
||||||
|
#ifdef XP_MACOSX
|
||||||
|
// AssertMacros.h defines 'check' and conflicts with AccessCheck.h
|
||||||
|
#undef check
|
||||||
|
#endif
|
||||||
|
#include "AccessCheck.h"
|
||||||
|
|
||||||
#ifdef MOZ_JSDEBUGGER
|
#ifdef MOZ_JSDEBUGGER
|
||||||
#include "jsdIDebuggerService.h"
|
#include "jsdIDebuggerService.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -947,8 +953,9 @@ nsJSContext::DOMOperationCallback(JSContext *cx)
|
||||||
|
|
||||||
// Check the amount of time this script has been running, or if the
|
// Check the amount of time this script has been running, or if the
|
||||||
// dialog is disabled.
|
// dialog is disabled.
|
||||||
|
JSObject* global = ::JS_GetGlobalForScopeChain(cx);
|
||||||
PRBool isTrackingChromeCodeTime =
|
PRBool isTrackingChromeCodeTime =
|
||||||
::JS_IsSystemObject(cx, ::JS_GetGlobalObject(cx));
|
global && xpc::AccessCheck::isChrome(global->getCompartment());
|
||||||
if (duration < (isTrackingChromeCodeTime ?
|
if (duration < (isTrackingChromeCodeTime ?
|
||||||
sMaxChromeScriptRunTime : sMaxScriptRunTime)) {
|
sMaxChromeScriptRunTime : sMaxScriptRunTime)) {
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче