Skip to content

Commit 4f45eff

Browse files
committed
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
1 parent a00726d commit 4f45eff

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

dom/bindings/Codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@ def finalizeHook(descriptor, hookName, freeOp, obj):
17641764
if descriptor.wrapperCache:
17651765
finalize += "ClearWrapper(self, self, %s);\n" % obj
17661766
if descriptor.isGlobal():
1767-
finalize += "mozilla::dom::FinalizeGlobal(js::CastToJSFreeOp(%s), %s);\n" % (freeOp, obj)
1767+
finalize += "mozilla::dom::FinalizeGlobal(%s, %s);\n" % (freeOp, obj)
17681768
finalize += fill(
17691769
"""
17701770
if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
@@ -1783,7 +1783,7 @@ class CGClassFinalizeHook(CGAbstractClassHook):
17831783
A hook for finalize, used to release our native object.
17841784
"""
17851785
def __init__(self, descriptor):
1786-
args = [Argument('js::FreeOp*', 'fop'), Argument('JSObject*', 'obj')]
1786+
args = [Argument('JSFreeOp*', 'fop'), Argument('JSObject*', 'obj')]
17871787
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
17881788
'void', args)
17891789

dom/bindings/SimpleGlobalObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SimpleGlobalObject)
4141
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
4242
NS_INTERFACE_MAP_END
4343

44-
static void SimpleGlobal_finalize(js::FreeOp* fop, JSObject* obj) {
44+
static void SimpleGlobal_finalize(JSFreeOp* fop, JSObject* obj) {
4545
SimpleGlobalObject* globalObject =
4646
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
4747
if (globalObject) {

js/xpconnect/public/xpc_make_class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ bool XPC_WN_NewEnumerate(JSContext* cx, JS::HandleObject obj,
3636
bool XPC_WN_Helper_Resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
3737
bool* resolvedp);
3838

39-
void XPC_WN_Helper_Finalize(js::FreeOp* fop, JSObject* obj);
40-
void XPC_WN_NoHelper_Finalize(js::FreeOp* fop, JSObject* obj);
39+
void XPC_WN_Helper_Finalize(JSFreeOp* fop, JSObject* obj);
40+
void XPC_WN_NoHelper_Finalize(JSFreeOp* fop, JSObject* obj);
4141

4242
bool XPC_WN_Helper_Call(JSContext* cx, unsigned argc, JS::Value* vp);
4343

js/xpconnect/src/Sandbox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static bool SandboxCloneInto(JSContext* cx, unsigned argc, Value* vp) {
411411
return xpc::CloneInto(cx, args[0], args[1], options, args.rval());
412412
}
413413

414-
static void sandbox_finalize(js::FreeOp* fop, JSObject* obj) {
414+
static void sandbox_finalize(JSFreeOp* fop, JSObject* obj) {
415415
nsIScriptObjectPrincipal* sop =
416416
static_cast<nsIScriptObjectPrincipal*>(xpc_GetJSPrivate(obj));
417417
if (!sop) {

js/xpconnect/src/XPCWrappedNativeJSOps.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ bool XPC_WN_Shared_Enumerate(JSContext* cx, HandleObject obj) {
563563

564564
enum WNHelperType { WN_NOHELPER, WN_HELPER };
565565

566-
static void WrappedNativeFinalize(js::FreeOp* fop, JSObject* obj,
566+
static void WrappedNativeFinalize(JSFreeOp* fop, JSObject* obj,
567567
WNHelperType helperType) {
568568
const js::Class* clazz = js::GetObjectClass(obj);
569569
if (clazz->flags & JSCLASS_DOM_GLOBAL) {
@@ -576,7 +576,7 @@ static void WrappedNativeFinalize(js::FreeOp* fop, JSObject* obj,
576576

577577
XPCWrappedNative* wrapper = static_cast<XPCWrappedNative*>(p);
578578
if (helperType == WN_HELPER) {
579-
wrapper->GetScriptable()->Finalize(wrapper, js::CastToJSFreeOp(fop), obj);
579+
wrapper->GetScriptable()->Finalize(wrapper, fop, obj);
580580
}
581581
wrapper->FlatJSObjectFinalized();
582582
}
@@ -592,7 +592,7 @@ static size_t WrappedNativeObjectMoved(JSObject* obj, JSObject* old) {
592592
return 0;
593593
}
594594

595-
void XPC_WN_NoHelper_Finalize(js::FreeOp* fop, JSObject* obj) {
595+
void XPC_WN_NoHelper_Finalize(JSFreeOp* fop, JSObject* obj) {
596596
WrappedNativeFinalize(fop, obj, WN_NOHELPER);
597597
}
598598

@@ -759,7 +759,7 @@ bool XPC_WN_Helper_HasInstance(JSContext* cx, HandleObject obj,
759759
POST_HELPER_STUB
760760
}
761761

762-
void XPC_WN_Helper_Finalize(js::FreeOp* fop, JSObject* obj) {
762+
void XPC_WN_Helper_Finalize(JSFreeOp* fop, JSObject* obj) {
763763
WrappedNativeFinalize(fop, obj, WN_HELPER);
764764
}
765765

@@ -1019,7 +1019,7 @@ static bool XPC_WN_Proto_Enumerate(JSContext* cx, HandleObject obj) {
10191019
return true;
10201020
}
10211021

1022-
static void XPC_WN_Proto_Finalize(js::FreeOp* fop, JSObject* obj) {
1022+
static void XPC_WN_Proto_Finalize(JSFreeOp* fop, JSObject* obj) {
10231023
// This can be null if xpc shutdown has already happened
10241024
XPCWrappedNativeProto* p = (XPCWrappedNativeProto*)xpc_GetJSPrivate(obj);
10251025
if (p) {
@@ -1151,7 +1151,7 @@ static bool XPC_WN_TearOff_Resolve(JSContext* cx, HandleObject obj, HandleId id,
11511151
resolvedp);
11521152
}
11531153

1154-
static void XPC_WN_TearOff_Finalize(js::FreeOp* fop, JSObject* obj) {
1154+
static void XPC_WN_TearOff_Finalize(JSFreeOp* fop, JSObject* obj) {
11551155
XPCWrappedNativeTearOff* p = (XPCWrappedNativeTearOff*)xpc_GetJSPrivate(obj);
11561156
if (!p) {
11571157
return;

js/xpconnect/src/XPCWrappedNativeProto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bool XPCWrappedNativeProto::Init(JSContext* cx, nsIXPCScriptable* scriptable) {
6363
return success;
6464
}
6565

66-
void XPCWrappedNativeProto::JSProtoObjectFinalized(js::FreeOp* fop,
66+
void XPCWrappedNativeProto::JSProtoObjectFinalized(JSFreeOp* fop,
6767
JSObject* obj) {
6868
MOZ_ASSERT(obj == mJSProtoObject, "huh?");
6969

0 commit comments

Comments
 (0)