Bug 712858 - Remove lingering XPT_TDP_POINTER uses in XPConnect. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Fri, 23 Dec 2011 16:22:44 -0800
changeset 84523 f39d6016cbb4b9fa978b7efbe6f6814e613f6c83
parent 84522 cd2a9f299bc12140fbd2ee675a70da69cc9e38fa
child 84524 c4033a3d158efea487688db70e69a894cde1d50d
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs712858
milestone12.0a1
Bug 712858 - Remove lingering XPT_TDP_POINTER uses in XPConnect. r=mrbkap
js/xpconnect/src/XPCVariant.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
js/xpconnect/src/XPCWrappedNative.cpp
--- a/js/xpconnect/src/XPCVariant.cpp
+++ b/js/xpconnect/src/XPCVariant.cpp
@@ -266,29 +266,29 @@ XPCArrayHomogenizer::GetTypeForArray(XPC
             break;
         case tDbl :
             *resultType = nsXPTType((uint8)TD_DOUBLE);
             break;
         case tBool:
             *resultType = nsXPTType((uint8)TD_BOOL);
             break;
         case tStr :
-            *resultType = nsXPTType((uint8)(TD_PWSTRING | XPT_TDP_POINTER));
+            *resultType = nsXPTType((uint8)TD_PWSTRING);
             break;
         case tID  :
-            *resultType = nsXPTType((uint8)(TD_PNSIID | XPT_TDP_POINTER));
+            *resultType = nsXPTType((uint8)TD_PNSIID);
             break;
         case tISup:
-            *resultType = nsXPTType((uint8)(TD_INTERFACE_IS_TYPE | XPT_TDP_POINTER));
+            *resultType = nsXPTType((uint8)TD_INTERFACE_IS_TYPE);
             *resultID = NS_GET_IID(nsISupports);
             break;
         case tNull:
             // FALL THROUGH
         case tVar :
-            *resultType = nsXPTType((uint8)(TD_INTERFACE_IS_TYPE | XPT_TDP_POINTER));
+            *resultType = nsXPTType((uint8)TD_INTERFACE_IS_TYPE);
             *resultID = NS_GET_IID(nsIVariant);
             break;
         case tArr :
             // FALL THROUGH
         case tUnk :
             // FALL THROUGH
         case tErr :
             // FALL THROUGH
@@ -502,80 +502,80 @@ XPCVariant::VariantDataToJS(XPCLazyCallC
         case nsIDataType::VTYPE_WCHAR:
             if (NS_FAILED(variant->GetAsWChar(&xpctvar.val.wc)))
                 return false;
             xpctvar.type = (uint8)TD_WCHAR;
             break;
         case nsIDataType::VTYPE_ID:
             if (NS_FAILED(variant->GetAsID(&iid)))
                 return false;
-            xpctvar.type = (uint8)(TD_PNSIID | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_PNSIID;
             xpctvar.val.p = &iid;
             break;
         case nsIDataType::VTYPE_ASTRING:
             if (NS_FAILED(variant->GetAsAString(astring)))
                 return false;
-            xpctvar.type = (uint8)(TD_ASTRING | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_ASTRING;
             xpctvar.val.p = &astring;
             break;
         case nsIDataType::VTYPE_DOMSTRING:
             if (NS_FAILED(variant->GetAsAString(astring)))
                 return false;
-            xpctvar.type = (uint8)(TD_DOMSTRING | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_DOMSTRING;
             xpctvar.val.p = &astring;
             break;
         case nsIDataType::VTYPE_CSTRING:
             if (NS_FAILED(variant->GetAsACString(cString)))
                 return false;
-            xpctvar.type = (uint8)(TD_CSTRING | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_CSTRING;
             xpctvar.val.p = &cString;
             break;
         case nsIDataType::VTYPE_UTF8STRING:
             if (NS_FAILED(variant->GetAsAUTF8String(utf8String)))
                 return false;
-            xpctvar.type = (uint8)(TD_UTF8STRING | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_UTF8STRING;
             xpctvar.val.p = &utf8String;
             break;
         case nsIDataType::VTYPE_CHAR_STR:
             if (NS_FAILED(variant->GetAsString((char**)&xpctvar.val.p)))
                 return false;
-            xpctvar.type = (uint8)(TD_PSTRING | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_PSTRING;
             xpctvar.SetValNeedsCleanup();
             break;
         case nsIDataType::VTYPE_STRING_SIZE_IS:
             if (NS_FAILED(variant->GetAsStringWithSize(&size,
                                                        (char**)&xpctvar.val.p)))
                 return false;
-            xpctvar.type = (uint8)(TD_PSTRING_SIZE_IS | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_PSTRING_SIZE_IS;
             xpctvar.SetValNeedsCleanup();
             break;
         case nsIDataType::VTYPE_WCHAR_STR:
             if (NS_FAILED(variant->GetAsWString((PRUnichar**)&xpctvar.val.p)))
                 return false;
-            xpctvar.type = (uint8)(TD_PWSTRING | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_PWSTRING;
             xpctvar.SetValNeedsCleanup();
             break;
         case nsIDataType::VTYPE_WSTRING_SIZE_IS:
             if (NS_FAILED(variant->GetAsWStringWithSize(&size,
                                                         (PRUnichar**)&xpctvar.val.p)))
                 return false;
-            xpctvar.type = (uint8)(TD_PWSTRING_SIZE_IS | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_PWSTRING_SIZE_IS;
             xpctvar.SetValNeedsCleanup();
             break;
         case nsIDataType::VTYPE_INTERFACE:
         case nsIDataType::VTYPE_INTERFACE_IS:
         {
             nsID* piid;
             if (NS_FAILED(variant->GetAsInterface(&piid, &xpctvar.val.p)))
                 return false;
 
             iid = *piid;
             nsMemory::Free((char*)piid);
 
-            xpctvar.type = (uint8)(TD_INTERFACE_IS_TYPE | XPT_TDP_POINTER);
+            xpctvar.type = (uint8)TD_INTERFACE_IS_TYPE;
             if (xpctvar.val.p)
                 xpctvar.SetValNeedsCleanup();
             break;
         }
         case nsIDataType::VTYPE_ARRAY:
         {
             nsDiscriminatedUnion du;
             nsVariant::Initialize(&du);
@@ -611,27 +611,27 @@ XPCVariant::VariantDataToJS(XPCLazyCallC
                 case nsIDataType::VTYPE_CHAR:
                 case nsIDataType::VTYPE_WCHAR:
                     conversionType = nsXPTType((uint8)elementType);
                     break;
 
                 case nsIDataType::VTYPE_ID:
                 case nsIDataType::VTYPE_CHAR_STR:
                 case nsIDataType::VTYPE_WCHAR_STR:
-                    conversionType = nsXPTType((uint8)elementType | XPT_TDP_POINTER);
+                    conversionType = nsXPTType((uint8)elementType);
                     break;
 
                 case nsIDataType::VTYPE_INTERFACE:
                     pid = &NS_GET_IID(nsISupports);
-                    conversionType = nsXPTType((uint8)elementType | XPT_TDP_POINTER);
+                    conversionType = nsXPTType((uint8)elementType);
                     break;
 
                 case nsIDataType::VTYPE_INTERFACE_IS:
                     pid = &du.u.array.mArrayInterfaceID;
-                    conversionType = nsXPTType((uint8)elementType | XPT_TDP_POINTER);
+                    conversionType = nsXPTType((uint8)elementType);
                     break;
 
                 // The rest are illegal.
                 case nsIDataType::VTYPE_VOID:
                 case nsIDataType::VTYPE_ASTRING:
                 case nsIDataType::VTYPE_DOMSTRING:
                 case nsIDataType::VTYPE_CSTRING:
                 case nsIDataType::VTYPE_UTF8STRING:
--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
+++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
@@ -356,17 +356,17 @@ nsXPCWrappedJSClass::CallQueryInterfaceO
 
 static JSBool
 GetNamedPropertyAsVariantRaw(XPCCallContext& ccx,
                              JSObject* aJSObj,
                              jsid aName,
                              nsIVariant** aResult,
                              nsresult* pErr)
 {
-    nsXPTType type = nsXPTType((uint8)(TD_INTERFACE_TYPE | XPT_TDP_POINTER));
+    nsXPTType type = nsXPTType((uint8)TD_INTERFACE_TYPE);
     jsval val;
 
     return JS_GetPropertyById(ccx, aJSObj, aName, &val) &&
            // Note that this always takes the T_INTERFACE path through
            // JSData2Native, so the value passed for useAllocator
            // doesn't really matter. We pass true for consistency.
            XPCConvert::JSData2Native(ccx, aResult, val, type, true,
                                      &NS_GET_IID(nsIVariant), pErr);
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -2510,17 +2510,17 @@ CallMethodHelper::QueryInterfaceFastPath
         ThrowBadResult(invokeResult, mCallContext);
         return false;
     }
 
     jsval v = JSVAL_NULL;
     uintN err;
     JSBool success =
         XPCConvert::NativeData2JS(mCallContext, &v, &qiresult,
-                                  nsXPTType::T_INTERFACE_IS | XPT_TDP_POINTER,
+                                  nsXPTType::T_INTERFACE_IS,
                                   iid, &err);
     NS_IF_RELEASE(qiresult);
 
     if (!success) {
         ThrowBadParam(err, 0, mCallContext);
         return false;
     }