diff --git a/js/ipc/ObjectWrapperChild.cpp b/js/ipc/ObjectWrapperChild.cpp index f2bc2bef9ee1..610b9f7ef104 100644 --- a/js/ipc/ObjectWrapperChild.cpp +++ b/js/ipc/ObjectWrapperChild.cpp @@ -152,8 +152,7 @@ ObjectWrapperChild::ObjectWrapperChild(JSContext* cx, JSObject* obj) #ifdef DEBUG bool added = #endif - JS_AddNamedRoot(cx, (void*)&mObj, - "mozilla::jsipc::ObjectWrapperChild-rooted JSObject*"); + JS_AddObjectRoot(cx, &mObj); NS_ASSERTION(added, "ObjectWrapperChild constructor failed to root JSObject*"); } @@ -162,7 +161,7 @@ ObjectWrapperChild::ActorDestroy(ActorDestroyReason why) { JSContext* cx = Manager()->GetContext(); JSAutoRequest request(cx); - JS_RemoveRoot(cx, (void*)&mObj); + JS_RemoveObjectRoot(cx, &mObj); } bool diff --git a/js/ipc/ObjectWrapperChild.h b/js/ipc/ObjectWrapperChild.h index dbf088d2fd92..092007c60515 100644 --- a/js/ipc/ObjectWrapperChild.h +++ b/js/ipc/ObjectWrapperChild.h @@ -67,7 +67,7 @@ public: private: - JSObject* const mObj; + JSObject* mObj; bool JSObject_to_JSVariant(JSContext* cx, JSObject* from, JSVariant* to); bool jsval_to_JSVariant(JSContext* cx, jsval from, JSVariant* to);