зеркало из https://github.com/mozilla/gecko-dev.git
Bug 899367 - Remove xpc_UnmarkGrayContext. r=mccr8
Default compartment objects are never gray anymore.
This commit is contained in:
Родитель
9ea45e61e6
Коммит
666aaa00ac
|
@ -1158,7 +1158,7 @@ nsJSContext::GetNativeGlobal()
|
|||
JSContext*
|
||||
nsJSContext::GetNativeContext()
|
||||
{
|
||||
return xpc_UnmarkGrayContext(mContext);
|
||||
return mContext;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -1152,7 +1152,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
|
|||
return retval;
|
||||
|
||||
XPCContext *xpcc = ccx.GetXPCContext();
|
||||
JSContext *cx = xpc_UnmarkGrayContext(ccx.GetJSContext());
|
||||
JSContext *cx = ccx.GetJSContext();
|
||||
|
||||
if (!cx || !xpcc || !IsReflectable(methodIndex))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -124,9 +124,6 @@ AutoCxPusher::AutoCxPusher(JSContext* cx, bool allowNull)
|
|||
|
||||
// Enter a request and a compartment for the duration that the cx is on the
|
||||
// stack if non-null.
|
||||
//
|
||||
// NB: We call UnmarkGrayContext so that this can obsolete the need for the
|
||||
// old XPCAutoRequest as well.
|
||||
if (cx) {
|
||||
mAutoRequest.construct(cx);
|
||||
|
||||
|
@ -135,7 +132,6 @@ AutoCxPusher::AutoCxPusher(JSContext* cx, bool allowNull)
|
|||
: js::DefaultObjectForContextOrNull(cx);
|
||||
if (compartmentObject)
|
||||
mAutoCompartment.construct(cx, compartmentObject);
|
||||
xpc_UnmarkGrayContext(cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1315,8 +1315,7 @@ xpc_ActivateDebugMode()
|
|||
JSContext*
|
||||
nsXPConnect::GetCurrentJSContext()
|
||||
{
|
||||
JSContext *cx = GetRuntime()->GetJSContextStack()->Peek();
|
||||
return xpc_UnmarkGrayContext(cx);
|
||||
return GetRuntime()->GetJSContextStack()->Peek();
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "nsStringBuffer.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
|
||||
class nsIPrincipal;
|
||||
class nsIXPConnectWrappedJS;
|
||||
|
@ -164,25 +163,6 @@ xpc_UnmarkGrayScript(JSScript *script)
|
|||
return script;
|
||||
}
|
||||
|
||||
inline JSContext *
|
||||
xpc_UnmarkGrayContext(JSContext *cx)
|
||||
{
|
||||
// There's no default compartment object for DOM JSContexts, so we have
|
||||
// nothing to do in that case. In fact, this whole function is obsolete,
|
||||
// because nothing else is ever gray. But for now let's be deliberate.
|
||||
// We'll remove this thing in the next patch.
|
||||
if (cx && !GetScriptContextFromJSContext(cx)) {
|
||||
JSObject *global = js::DefaultObjectForContextOrNull(cx);
|
||||
xpc_UnmarkGrayObject(global);
|
||||
if (global && JS_IsInRequest(JS_GetRuntime(cx))) {
|
||||
JSObject *scope = JS::CurrentGlobalOrNull(cx);
|
||||
if (scope != global)
|
||||
xpc_UnmarkGrayObject(scope);
|
||||
}
|
||||
}
|
||||
return cx;
|
||||
}
|
||||
|
||||
// If aVariant is an XPCVariant, this marks the object to be in aGeneration.
|
||||
// This also unmarks the gray JSObject.
|
||||
extern void
|
||||
|
|
Загрузка…
Ссылка в новой задаче