зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1572782 - Remove external references to js::FreeOp r=mccr8?
Replace external use of js::FreeOp with JSFreeOp. Differential Revision: https://phabricator.services.mozilla.com/D41411 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9d51a35e93
Коммит
68fef4ffb0
|
@ -1764,7 +1764,7 @@ def finalizeHook(descriptor, hookName, freeOp, obj):
|
||||||
if descriptor.wrapperCache:
|
if descriptor.wrapperCache:
|
||||||
finalize += "ClearWrapper(self, self, %s);\n" % obj
|
finalize += "ClearWrapper(self, self, %s);\n" % obj
|
||||||
if descriptor.isGlobal():
|
if descriptor.isGlobal():
|
||||||
finalize += "mozilla::dom::FinalizeGlobal(js::CastToJSFreeOp(%s), %s);\n" % (freeOp, obj)
|
finalize += "mozilla::dom::FinalizeGlobal(%s, %s);\n" % (freeOp, obj)
|
||||||
finalize += fill(
|
finalize += fill(
|
||||||
"""
|
"""
|
||||||
if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
|
if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
|
||||||
|
@ -1783,7 +1783,7 @@ class CGClassFinalizeHook(CGAbstractClassHook):
|
||||||
A hook for finalize, used to release our native object.
|
A hook for finalize, used to release our native object.
|
||||||
"""
|
"""
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
args = [Argument('js::FreeOp*', 'fop'), Argument('JSObject*', 'obj')]
|
args = [Argument('JSFreeOp*', 'fop'), Argument('JSObject*', 'obj')]
|
||||||
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
|
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
|
||||||
'void', args)
|
'void', args)
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SimpleGlobalObject)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
|
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
|
||||||
NS_INTERFACE_MAP_END
|
NS_INTERFACE_MAP_END
|
||||||
|
|
||||||
static void SimpleGlobal_finalize(js::FreeOp* fop, JSObject* obj) {
|
static void SimpleGlobal_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||||
SimpleGlobalObject* globalObject =
|
SimpleGlobalObject* globalObject =
|
||||||
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
|
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
|
||||||
if (globalObject) {
|
if (globalObject) {
|
||||||
|
|
|
@ -36,8 +36,8 @@ bool XPC_WN_NewEnumerate(JSContext* cx, JS::HandleObject obj,
|
||||||
bool XPC_WN_Helper_Resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
|
bool XPC_WN_Helper_Resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
|
||||||
bool* resolvedp);
|
bool* resolvedp);
|
||||||
|
|
||||||
void XPC_WN_Helper_Finalize(js::FreeOp* fop, JSObject* obj);
|
void XPC_WN_Helper_Finalize(JSFreeOp* fop, JSObject* obj);
|
||||||
void XPC_WN_NoHelper_Finalize(js::FreeOp* fop, JSObject* obj);
|
void XPC_WN_NoHelper_Finalize(JSFreeOp* fop, JSObject* obj);
|
||||||
|
|
||||||
bool XPC_WN_Helper_Call(JSContext* cx, unsigned argc, JS::Value* vp);
|
bool XPC_WN_Helper_Call(JSContext* cx, unsigned argc, JS::Value* vp);
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@ static bool SandboxCloneInto(JSContext* cx, unsigned argc, Value* vp) {
|
||||||
return xpc::CloneInto(cx, args[0], args[1], options, args.rval());
|
return xpc::CloneInto(cx, args[0], args[1], options, args.rval());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sandbox_finalize(js::FreeOp* fop, JSObject* obj) {
|
static void sandbox_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||||
nsIScriptObjectPrincipal* sop =
|
nsIScriptObjectPrincipal* sop =
|
||||||
static_cast<nsIScriptObjectPrincipal*>(xpc_GetJSPrivate(obj));
|
static_cast<nsIScriptObjectPrincipal*>(xpc_GetJSPrivate(obj));
|
||||||
if (!sop) {
|
if (!sop) {
|
||||||
|
|
|
@ -563,7 +563,7 @@ bool XPC_WN_Shared_Enumerate(JSContext* cx, HandleObject obj) {
|
||||||
|
|
||||||
enum WNHelperType { WN_NOHELPER, WN_HELPER };
|
enum WNHelperType { WN_NOHELPER, WN_HELPER };
|
||||||
|
|
||||||
static void WrappedNativeFinalize(js::FreeOp* fop, JSObject* obj,
|
static void WrappedNativeFinalize(JSFreeOp* fop, JSObject* obj,
|
||||||
WNHelperType helperType) {
|
WNHelperType helperType) {
|
||||||
const js::Class* clazz = js::GetObjectClass(obj);
|
const js::Class* clazz = js::GetObjectClass(obj);
|
||||||
if (clazz->flags & JSCLASS_DOM_GLOBAL) {
|
if (clazz->flags & JSCLASS_DOM_GLOBAL) {
|
||||||
|
@ -576,7 +576,7 @@ static void WrappedNativeFinalize(js::FreeOp* fop, JSObject* obj,
|
||||||
|
|
||||||
XPCWrappedNative* wrapper = static_cast<XPCWrappedNative*>(p);
|
XPCWrappedNative* wrapper = static_cast<XPCWrappedNative*>(p);
|
||||||
if (helperType == WN_HELPER) {
|
if (helperType == WN_HELPER) {
|
||||||
wrapper->GetScriptable()->Finalize(wrapper, js::CastToJSFreeOp(fop), obj);
|
wrapper->GetScriptable()->Finalize(wrapper, fop, obj);
|
||||||
}
|
}
|
||||||
wrapper->FlatJSObjectFinalized();
|
wrapper->FlatJSObjectFinalized();
|
||||||
}
|
}
|
||||||
|
@ -592,7 +592,7 @@ static size_t WrappedNativeObjectMoved(JSObject* obj, JSObject* old) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPC_WN_NoHelper_Finalize(js::FreeOp* fop, JSObject* obj) {
|
void XPC_WN_NoHelper_Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||||
WrappedNativeFinalize(fop, obj, WN_NOHELPER);
|
WrappedNativeFinalize(fop, obj, WN_NOHELPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,7 +759,7 @@ bool XPC_WN_Helper_HasInstance(JSContext* cx, HandleObject obj,
|
||||||
POST_HELPER_STUB
|
POST_HELPER_STUB
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPC_WN_Helper_Finalize(js::FreeOp* fop, JSObject* obj) {
|
void XPC_WN_Helper_Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||||
WrappedNativeFinalize(fop, obj, WN_HELPER);
|
WrappedNativeFinalize(fop, obj, WN_HELPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1019,7 +1019,7 @@ static bool XPC_WN_Proto_Enumerate(JSContext* cx, HandleObject obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void XPC_WN_Proto_Finalize(js::FreeOp* fop, JSObject* obj) {
|
static void XPC_WN_Proto_Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||||
// This can be null if xpc shutdown has already happened
|
// This can be null if xpc shutdown has already happened
|
||||||
XPCWrappedNativeProto* p = (XPCWrappedNativeProto*)xpc_GetJSPrivate(obj);
|
XPCWrappedNativeProto* p = (XPCWrappedNativeProto*)xpc_GetJSPrivate(obj);
|
||||||
if (p) {
|
if (p) {
|
||||||
|
@ -1151,7 +1151,7 @@ static bool XPC_WN_TearOff_Resolve(JSContext* cx, HandleObject obj, HandleId id,
|
||||||
resolvedp);
|
resolvedp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void XPC_WN_TearOff_Finalize(js::FreeOp* fop, JSObject* obj) {
|
static void XPC_WN_TearOff_Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||||
XPCWrappedNativeTearOff* p = (XPCWrappedNativeTearOff*)xpc_GetJSPrivate(obj);
|
XPCWrappedNativeTearOff* p = (XPCWrappedNativeTearOff*)xpc_GetJSPrivate(obj);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -63,7 +63,7 @@ bool XPCWrappedNativeProto::Init(JSContext* cx, nsIXPCScriptable* scriptable) {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPCWrappedNativeProto::JSProtoObjectFinalized(js::FreeOp* fop,
|
void XPCWrappedNativeProto::JSProtoObjectFinalized(JSFreeOp* fop,
|
||||||
JSObject* obj) {
|
JSObject* obj) {
|
||||||
MOZ_ASSERT(obj == mJSProtoObject, "huh?");
|
MOZ_ASSERT(obj == mJSProtoObject, "huh?");
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче