Bug 952650 (part 16) - Remove JSVAL_TO_PRIVATE. r=till.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 28 Apr 2014 16:01:31 -0700
changeset 181306 697506d9c32459abcbf817fbf54fb793078d49d3
parent 181305 a97a14bb56df42807f0bbb13a379ba75601fc874
child 181307 2f2c7485b6a6b602952b4cb0d884aa756e3d15ef
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerstill
bugs952650
milestone32.0a1
Bug 952650 (part 16) - Remove JSVAL_TO_PRIVATE. r=till.
dom/base/nsDOMClassInfo.cpp
dom/plugins/base/nsJSNPRuntime.cpp
dom/xbl/nsXBLBinding.cpp
js/jsd/jsd_scpt.cpp
js/public/Value.h
js/src/ctypes/CTypes.cpp
js/src/ctypes/Library.cpp
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCWrappedNativeInfo.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -3839,18 +3839,17 @@ nsStorage2SH::NewEnumerate(nsIXPConnectW
     *statep = PRIVATE_TO_JSVAL(keys);
 
     if (idp) {
       *idp = INT_TO_JSID(keys->Length());
     }
     return NS_OK;
   }
 
-  nsTArray<nsString> *keys =
-    (nsTArray<nsString> *)JSVAL_TO_PRIVATE(*statep);
+  nsTArray<nsString> *keys = (nsTArray<nsString> *)statep->toPrivate();
 
   if (enum_op == JSENUMERATE_NEXT && keys->Length() != 0) {
     nsString& key = keys->ElementAt(0);
     JS::Rooted<JSString*> str(cx, JS_NewUCStringCopyN(cx, key.get(), key.Length()));
     NS_ENSURE_TRUE(str, NS_ERROR_OUT_OF_MEMORY);
 
     JS::Rooted<jsid> id(cx);
     JS_StringToId(cx, str, &id);
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -1493,28 +1493,28 @@ NPObjWrapper_newEnumerate(JSContext *cx,
     *statep = PRIVATE_TO_JSVAL(state);
     if (idp) {
       *idp = INT_TO_JSID(length);
     }
 
     break;
 
   case JSENUMERATE_NEXT:
-    state = (NPObjectEnumerateState *)JSVAL_TO_PRIVATE(*statep);
+    state = (NPObjectEnumerateState *)statep->toPrivate();
     enum_value = state->value;
     length = state->length;
     if (state->index != length) {
       *idp = NPIdentifierToJSId(enum_value[state->index++]);
       return true;
     }
 
     // FALL THROUGH
 
   case JSENUMERATE_DESTROY:
-    state = (NPObjectEnumerateState *)JSVAL_TO_PRIVATE(*statep);
+    state = (NPObjectEnumerateState *)statep->toPrivate();
     if (state->value)
       PR_Free(state->value);
     delete state;
     *statep = JSVAL_NULL;
 
     break;
   }
 
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -775,17 +775,17 @@ nsXBLBinding::ChangeDocument(nsIDocument
               static_cast<nsXBLDocumentInfo*>(::JS_GetPrivate(proto));
             if (!docInfo) {
               // Not the proto we seek
               continue;
             }
 
             JS::Value protoBinding = ::JS_GetReservedSlot(proto, 0);
 
-            if (JSVAL_TO_PRIVATE(protoBinding) != mPrototypeBinding) {
+            if (protoBinding.toPrivate() != mPrototypeBinding) {
               // Not the right binding
               continue;
             }
 
             // Alright!  This is the right prototype.  Pull it out of the
             // proto chain.
             JS::Rooted<JSObject*> grandProto(cx);
             if (!JS_GetPrototype(cx, proto, &grandProto)) {
--- a/js/jsd/jsd_scpt.cpp
+++ b/js/jsd/jsd_scpt.cpp
@@ -701,17 +701,17 @@ static bool
 }
 
 
 JSTrapStatus
 jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
                 jsval closure)
 {
     JS::RootedScript script(cx, script_);
-    JSDExecHook* jsdhook = (JSDExecHook*) JSVAL_TO_PRIVATE(closure);
+    JSDExecHook* jsdhook = (JSDExecHook*) closure.toPrivate();
     JSD_ExecutionHookProc hook;
     void* hookData;
     JSDContext*  jsdc;
 
     JSD_LOCK();
 
     if( nullptr == (jsdc = jsd_JSDContextForJSContext(cx)) ||
         ! _isActiveHook(jsdc, script, jsdhook) )
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -1877,23 +1877,16 @@ BOOLEAN_TO_JSVAL(bool b)
 /* To be GC-safe, privates are tagged as doubles. */
 
 static inline jsval
 PRIVATE_TO_JSVAL(void *ptr)
 {
     return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));
 }
 
-static inline void *
-JSVAL_TO_PRIVATE(jsval v)
-{
-    MOZ_ASSERT(v.isDouble());
-    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));
-}
-
 // JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and
 // constructing values from scratch (e.g. Int32Value(0)).  These constants are
 // stored in memory and initialized at startup, so testing against them and
 // using them requires memory loads and will be correspondingly slow.
 extern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;
 extern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;
 extern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;
 extern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1284,17 +1284,17 @@ JSCTypesCallbacks*
 GetCallbacks(JSObject* obj)
 {
   JS_ASSERT(IsCTypesGlobal(obj));
 
   jsval result = JS_GetReservedSlot(obj, SLOT_CALLBACKS);
   if (result.isUndefined())
     return nullptr;
 
-  return static_cast<JSCTypesCallbacks*>(JSVAL_TO_PRIVATE(result));
+  return static_cast<JSCTypesCallbacks*>(result.toPrivate());
 }
 
 // Utility function to access a property of an object as an object
 // returns false and sets the error if the property does not exist
 // or is not an object
 static bool GetObjectProperty(JSContext *cx, HandleObject obj,
                               const char *property, MutableHandleObject result)
 {
@@ -1383,17 +1383,17 @@ SizeOfDataIfCDataObject(mozilla::MallocS
         return 0;
 
     size_t n = 0;
     jsval slot = JS_GetReservedSlot(obj, ctypes::SLOT_OWNS);
     if (!slot.isUndefined()) {
         bool owns = slot.toBoolean();
         slot = JS_GetReservedSlot(obj, ctypes::SLOT_DATA);
         if (!slot.isUndefined()) {
-            char** buffer = static_cast<char**>(JSVAL_TO_PRIVATE(slot));
+            char** buffer = static_cast<char**>(slot.toPrivate());
             n += mallocSizeOf(buffer);
             if (owns)
                 n += mallocSizeOf(*buffer);
         }
     }
     return n;
 }
 
@@ -3294,35 +3294,35 @@ CType::Finalize(JSFreeOp *fop, JSObject*
     return;
 
   // The contents of our slots depends on what kind of type we are.
   switch (TypeCode(slot.toInt32())) {
   case TYPE_function: {
     // Free the FunctionInfo.
     slot = JS_GetReservedSlot(obj, SLOT_FNINFO);
     if (!slot.isUndefined())
-      FreeOp::get(fop)->delete_(static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot)));
+      FreeOp::get(fop)->delete_(static_cast<FunctionInfo*>(slot.toPrivate()));
     break;
   }
 
   case TYPE_struct: {
     // Free the FieldInfoHash table.
     slot = JS_GetReservedSlot(obj, SLOT_FIELDINFO);
     if (!slot.isUndefined()) {
-      void* info = JSVAL_TO_PRIVATE(slot);
+      void* info = slot.toPrivate();
       FreeOp::get(fop)->delete_(static_cast<FieldInfoHash*>(info));
     }
   }
 
     // Fall through.
   case TYPE_array: {
     // Free the ffi_type info.
     slot = JS_GetReservedSlot(obj, SLOT_FFITYPE);
     if (!slot.isUndefined()) {
-      ffi_type* ffiType = static_cast<ffi_type*>(JSVAL_TO_PRIVATE(slot));
+      ffi_type* ffiType = static_cast<ffi_type*>(slot.toPrivate());
       FreeOp::get(fop)->free_(ffiType->elements);
       FreeOp::get(fop)->delete_(ffiType);
     }
 
     break;
   }
   default:
     // Nothing to do here.
@@ -3340,35 +3340,34 @@ CType::Trace(JSTracer* trc, JSObject* ob
 
   // The contents of our slots depends on what kind of type we are.
   switch (TypeCode(slot.toInt32())) {
   case TYPE_struct: {
     slot = obj->getReservedSlot(SLOT_FIELDINFO);
     if (slot.isUndefined())
       return;
 
-    FieldInfoHash* fields =
-      static_cast<FieldInfoHash*>(JSVAL_TO_PRIVATE(slot));
+    FieldInfoHash* fields = static_cast<FieldInfoHash*>(slot.toPrivate());
     for (FieldInfoHash::Enum e(*fields); !e.empty(); e.popFront()) {
       JSString *key = e.front().key();
       JS_CallStringTracer(trc, &key, "fieldName");
       if (key != e.front().key())
           e.rekeyFront(JS_ASSERT_STRING_IS_FLAT(key));
       JS_CallHeapObjectTracer(trc, &e.front().value().mType, "fieldType");
     }
 
     break;
   }
   case TYPE_function: {
     // Check if we have a FunctionInfo.
     slot = obj->getReservedSlot(SLOT_FNINFO);
     if (slot.isUndefined())
       return;
 
-    FunctionInfo* fninfo = static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot));
+    FunctionInfo* fninfo = static_cast<FunctionInfo*>(slot.toPrivate());
     JS_ASSERT(fninfo);
 
     // Identify our objects to the tracer.
     JS_CallHeapObjectTracer(trc, &fninfo->mABI, "abi");
     JS_CallHeapObjectTracer(trc, &fninfo->mReturnType, "returnType");
     for (size_t i = 0; i < fninfo->mArgTypes.length(); ++i)
       JS_CallHeapObjectTracer(trc, &fninfo->mArgTypes[i], "argType");
 
@@ -3534,17 +3533,17 @@ CType::GetAlignment(JSObject* obj)
 ffi_type*
 CType::GetFFIType(JSContext* cx, JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FFITYPE);
 
   if (!slot.isUndefined()) {
-    return static_cast<ffi_type*>(JSVAL_TO_PRIVATE(slot));
+    return static_cast<ffi_type*>(slot.toPrivate());
   }
 
   AutoPtr<ffi_type> result;
   switch (CType::GetTypeCode(obj)) {
   case TYPE_array:
     result = ArrayType::BuildFFIType(cx, obj);
     break;
 
@@ -5085,19 +5084,19 @@ StructType::ConstructData(JSContext* cx,
 
 const FieldInfoHash*
 StructType::GetFieldInfo(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FIELDINFO);
-  JS_ASSERT(!slot.isUndefined() && JSVAL_TO_PRIVATE(slot));
-
-  return static_cast<const FieldInfoHash*>(JSVAL_TO_PRIVATE(slot));
+  JS_ASSERT(!slot.isUndefined() && slot.toPrivate());
+
+  return static_cast<const FieldInfoHash*>(slot.toPrivate());
 }
 
 const FieldInfo*
 StructType::LookupField(JSContext* cx, JSObject* obj, JSFlatString *name)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
 
@@ -5901,19 +5900,19 @@ FunctionType::Call(JSContext* cx,
 
 FunctionInfo*
 FunctionType::GetFunctionInfo(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_function);
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FNINFO);
-  JS_ASSERT(!slot.isUndefined() && JSVAL_TO_PRIVATE(slot));
-
-  return static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot));
+  JS_ASSERT(!slot.isUndefined() && slot.toPrivate());
+
+  return static_cast<FunctionInfo*>(slot.toPrivate());
 }
 
 bool
 FunctionType::IsFunctionType(HandleValue v)
 {
   if (!v.isObject())
     return false;
   JSObject* obj = &v.toObject();
@@ -6084,17 +6083,17 @@ CClosure::Create(JSContext* cx,
 void
 CClosure::Trace(JSTracer* trc, JSObject* obj)
 {
   // Make sure our ClosureInfo slot is legit. If it's not, bail.
   jsval slot = JS_GetReservedSlot(obj, SLOT_CLOSUREINFO);
   if (slot.isUndefined())
     return;
 
-  ClosureInfo* cinfo = static_cast<ClosureInfo*>(JSVAL_TO_PRIVATE(slot));
+  ClosureInfo* cinfo = static_cast<ClosureInfo*>(slot.toPrivate());
 
   // Identify our objects to the tracer. (There's no need to identify
   // 'closureObj', since that's us.)
   JS_CallHeapObjectTracer(trc, &cinfo->typeObj, "typeObj");
   JS_CallHeapObjectTracer(trc, &cinfo->jsfnObj, "jsfnObj");
   if (cinfo->thisObj)
     JS_CallHeapObjectTracer(trc, &cinfo->thisObj, "thisObj");
 }
@@ -6102,17 +6101,17 @@ CClosure::Trace(JSTracer* trc, JSObject*
 void
 CClosure::Finalize(JSFreeOp *fop, JSObject* obj)
 {
   // Make sure our ClosureInfo slot is legit. If it's not, bail.
   jsval slot = JS_GetReservedSlot(obj, SLOT_CLOSUREINFO);
   if (slot.isUndefined())
     return;
 
-  ClosureInfo* cinfo = static_cast<ClosureInfo*>(JSVAL_TO_PRIVATE(slot));
+  ClosureInfo* cinfo = static_cast<ClosureInfo*>(slot.toPrivate());
   FreeOp::get(fop)->delete_(cinfo);
 }
 
 void
 CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData)
 {
   JS_ASSERT(cif);
   JS_ASSERT(result);
@@ -6351,17 +6350,17 @@ CData::Finalize(JSFreeOp *fop, JSObject*
   if (slot.isUndefined())
     return;
 
   bool owns = slot.toBoolean();
 
   slot = JS_GetReservedSlot(obj, SLOT_DATA);
   if (slot.isUndefined())
     return;
-  char** buffer = static_cast<char**>(JSVAL_TO_PRIVATE(slot));
+  char** buffer = static_cast<char**>(slot.toPrivate());
 
   if (owns)
     FreeOp::get(fop)->free_(*buffer);
   FreeOp::get(fop)->delete_(buffer);
 }
 
 JSObject*
 CData::GetCType(JSObject* dataObj)
@@ -6376,17 +6375,17 @@ CData::GetCType(JSObject* dataObj)
 
 void*
 CData::GetData(JSObject* dataObj)
 {
   JS_ASSERT(CData::IsCData(dataObj));
 
   jsval slot = JS_GetReservedSlot(dataObj, SLOT_DATA);
 
-  void** buffer = static_cast<void**>(JSVAL_TO_PRIVATE(slot));
+  void** buffer = static_cast<void**>(slot.toPrivate());
   JS_ASSERT(buffer);
   JS_ASSERT(*buffer);
   return *buffer;
 }
 
 bool
 CData::IsCData(JSObject* obj)
 {
@@ -7295,25 +7294,25 @@ Int64Base::Construct(JSContext* cx,
 
 void
 Int64Base::Finalize(JSFreeOp *fop, JSObject* obj)
 {
   jsval slot = JS_GetReservedSlot(obj, SLOT_INT64);
   if (slot.isUndefined())
     return;
 
-  FreeOp::get(fop)->delete_(static_cast<uint64_t*>(JSVAL_TO_PRIVATE(slot)));
+  FreeOp::get(fop)->delete_(static_cast<uint64_t*>(slot.toPrivate()));
 }
 
 uint64_t
 Int64Base::GetInt(JSObject* obj) {
   JS_ASSERT(Int64::IsInt64(obj) || UInt64::IsUInt64(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_INT64);
-  return *static_cast<uint64_t*>(JSVAL_TO_PRIVATE(slot));
+  return *static_cast<uint64_t*>(slot.toPrivate());
 }
 
 bool
 Int64Base::ToString(JSContext* cx,
                     JSObject* obj,
                     const CallArgs& args,
                     bool isUnsigned)
 {
--- a/js/src/ctypes/Library.cpp
+++ b/js/src/ctypes/Library.cpp
@@ -173,17 +173,17 @@ Library::IsLibrary(JSObject* obj)
 }
 
 PRLibrary*
 Library::GetLibrary(JSObject* obj)
 {
   JS_ASSERT(IsLibrary(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_LIBRARY);
-  return static_cast<PRLibrary*>(JSVAL_TO_PRIVATE(slot));
+  return static_cast<PRLibrary*>(slot.toPrivate());
 }
 
 static void
 UnloadLibrary(JSObject* obj)
 {
   PRLibrary* library = Library::GetLibrary(obj);
   if (library)
     PR_UnloadLibrary(library);
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -759,17 +759,17 @@ nsXPCComponents_Classes::NewEnumerate(ns
             if (idp)
                 *idp = INT_TO_JSID(0); // indicate that we don't know the count
             return NS_OK;
         }
         case JSENUMERATE_NEXT:
         {
             nsCOMPtr<nsISupports> isup;
             bool hasMore;
-            e = (nsISimpleEnumerator*) JSVAL_TO_PRIVATE(*statep);
+            e = (nsISimpleEnumerator*) statep->toPrivate();
 
             if (NS_SUCCEEDED(e->HasMoreElements(&hasMore)) && hasMore &&
                 NS_SUCCEEDED(e->GetNext(getter_AddRefs(isup))) && isup) {
                 nsCOMPtr<nsISupportsCString> holder(do_QueryInterface(isup));
                 if (holder) {
                     nsAutoCString name;
                     if (NS_SUCCEEDED(holder->GetData(name))) {
                         RootedString idstr(cx, JS_NewStringCopyN(cx, name.get(), name.Length()));
@@ -781,17 +781,17 @@ nsXPCComponents_Classes::NewEnumerate(ns
                     }
                 }
             }
             // else... FALL THROUGH
         }
 
         case JSENUMERATE_DESTROY:
         default:
-            e = (nsISimpleEnumerator*) JSVAL_TO_PRIVATE(*statep);
+            e = (nsISimpleEnumerator*) statep->toPrivate();
             NS_IF_RELEASE(e);
             *statep = JSVAL_NULL;
             return NS_OK;
     }
 }
 
 /* bool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval id, out JSObjectPtr objp); */
 NS_IMETHODIMP
@@ -999,17 +999,17 @@ nsXPCComponents_ClassesByID::NewEnumerat
             if (idp)
                 *idp = INT_TO_JSID(0); // indicate that we don't know the count
             return NS_OK;
         }
         case JSENUMERATE_NEXT:
         {
             nsCOMPtr<nsISupports> isup;
             bool hasMore;
-            e = (nsISimpleEnumerator*) JSVAL_TO_PRIVATE(*statep);
+            e = (nsISimpleEnumerator*) statep->toPrivate();
 
             if (NS_SUCCEEDED(e->HasMoreElements(&hasMore)) && hasMore &&
                 NS_SUCCEEDED(e->GetNext(getter_AddRefs(isup))) && isup) {
                 nsCOMPtr<nsISupportsID> holder(do_QueryInterface(isup));
                 if (holder) {
                     char* name;
                     if (NS_SUCCEEDED(holder->ToString(&name)) && name) {
                         RootedString idstr(cx, JS_NewStringCopyZ(cx, name));
@@ -1022,17 +1022,17 @@ nsXPCComponents_ClassesByID::NewEnumerat
                     }
                 }
             }
             // else... FALL THROUGH
         }
 
         case JSENUMERATE_DESTROY:
         default:
-            e = (nsISimpleEnumerator*) JSVAL_TO_PRIVATE(*statep);
+            e = (nsISimpleEnumerator*) statep->toPrivate();
             NS_IF_RELEASE(e);
             *statep = JSVAL_NULL;
             return NS_OK;
     }
 }
 
 static bool
 IsRegisteredCLSID(const char* str)
@@ -1259,31 +1259,31 @@ nsXPCComponents_Results::NewEnumerate(ns
             void** space = (void**) new char[sizeof(void*)];
             *space = nullptr;
             *statep = PRIVATE_TO_JSVAL(space);
             return NS_OK;
         }
         case JSENUMERATE_NEXT:
         {
             const char* name;
-            iter = (const void**) JSVAL_TO_PRIVATE(*statep);
+            iter = (const void**) statep->toPrivate();
             if (nsXPCException::IterateNSResults(nullptr, &name, nullptr, iter)) {
                 RootedString idstr(cx, JS_NewStringCopyZ(cx, name));
                 JS::RootedId id(cx);
                 if (idstr && JS_StringToId(cx, idstr, &id)) {
                     *idp = id;
                     return NS_OK;
                 }
             }
             // else... FALL THROUGH
         }
 
         case JSENUMERATE_DESTROY:
         default:
-            iter = (const void**) JSVAL_TO_PRIVATE(*statep);
+            iter = (const void**) statep->toPrivate();
             delete [] (char*) iter;
             *statep = JSVAL_NULL;
             return NS_OK;
     }
 }
 
 
 /* bool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval id, out JSObjectPtr objp); */
--- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp
@@ -25,18 +25,18 @@ bool
 XPCNativeMember::GetCallInfo(JSObject* funobj,
                              XPCNativeInterface** pInterface,
                              XPCNativeMember**    pMember)
 {
     funobj = js::UncheckedUnwrap(funobj);
     jsval ifaceVal = js::GetFunctionNativeReserved(funobj, 0);
     jsval memberVal = js::GetFunctionNativeReserved(funobj, 1);
 
-    *pInterface = (XPCNativeInterface*) JSVAL_TO_PRIVATE(ifaceVal);
-    *pMember = (XPCNativeMember*) JSVAL_TO_PRIVATE(memberVal);
+    *pInterface = (XPCNativeInterface*) ifaceVal.toPrivate();
+    *pMember = (XPCNativeMember*) memberVal.toPrivate();
 
     return true;
 }
 
 bool
 XPCNativeMember::NewFunctionObject(XPCCallContext& ccx,
                                    XPCNativeInterface* iface, HandleObject parent,
                                    jsval* pval)