Fix ObjectWrapperChild bustage
authorRobert Sayre <sayrer@gmail.com>
Fri, 02 Jul 2010 18:17:06 -0700
changeset 47581 7776d91475505a4a5fa5094130ffd331f3cb39dd
parent 47580 22b0c91759137257c70d0bceda9d567a81566b2b
child 47582 facc00b50d21e0ab9890e1e046e4eb5cc216249f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-esr52@a95d42642281 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b2pre
Fix ObjectWrapperChild bustage
js/ipc/ObjectWrapperChild.cpp
js/ipc/ObjectWrapperChild.h
--- a/js/ipc/ObjectWrapperChild.cpp
+++ b/js/ipc/ObjectWrapperChild.cpp
@@ -147,27 +147,26 @@ ObjectWrapperChild::CheckOperation(JSCon
 
 ObjectWrapperChild::ObjectWrapperChild(JSContext* cx, JSObject* obj)
     : mObj(obj)
 {
     JSAutoRequest request(cx);
 #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*");
 }
 
 void
 ObjectWrapperChild::ActorDestroy(ActorDestroyReason why)
 {
     JSContext* cx = Manager()->GetContext();
     JSAutoRequest request(cx);
-    JS_RemoveRoot(cx, (void*)&mObj);
+    JS_RemoveObjectRoot(cx, &mObj);
 }
 
 bool
 ObjectWrapperChild::JSObject_to_JSVariant(JSContext* cx, JSObject* from,
                                           JSVariant* to)
 {
     *to = Manager()->GetOrCreateWrapper(from);
     return true;
--- a/js/ipc/ObjectWrapperChild.h
+++ b/js/ipc/ObjectWrapperChild.h
@@ -62,17 +62,17 @@ public:
     ObjectWrapperChild(JSContext* cx, JSObject* obj);
 
     JSObject* GetJSObject() const { return mObj; }
 
     void CheckOperation(JSContext* cx, OperationStatus* status);
     
 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);
 
     static bool JSObject_from_PObjectWrapperChild(JSContext* cx,
                                                   const PObjectWrapperChild* from,
                                                   JSObject** to);
     static bool JSObject_from_JSVariant(JSContext* cx, const JSVariant& from,