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 id14372
push userrsayre@mozilla.com
push dateWed, 14 Jul 2010 13:02:13 +0000
treeherdermozilla-central@c26c255bade9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b2pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,