[xpcom] Implement DataCarrier support in signature detection
authorKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 05:41:18 +0000 (08:41 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 05:41:18 +0000 (08:41 +0300)
xpcom-dbusservice/DBusMarshaling.cpp

index b2ffd744ad70e0c1651ab5b30ca08c03aafe9136..6c8f72dcddee1f3fe64ccf4f7798da82a48c2291 100644 (file)
@@ -37,6 +37,7 @@
 #include "nsIXPConnect.h"
 
 #include "DBusMarshaling.h"
+#include "DBusDataCarrier.h"
 
 #include "bdb-debug.h"
 
@@ -324,6 +325,23 @@ getSignatureFromISupports(JSContext* cx, nsISupports *aISupports, nsCString &aRe
         return;
     }
 
+    // test argument for DBusDataCarrier
+    nsCOMPtr<DBusDataCarrier> carrier = do_QueryInterface(aISupports);
+    if (carrier)
+    {
+        BDBLOG(("  getSignatureFromISupports: DBusDataCarrier\n"));
+        carrier->GetType(aResult);
+        if (aResult.Equals("r")) {
+          nsIVariant *value;
+          carrier->GetValue(&value);
+          getSignatureFromVariant(cx, value, aResult);
+          NS_RELEASE(value);
+        } else if (aResult.Equals("v")) {
+          carrier->GetSignature(aResult);
+        }
+        return;
+    }
+
     // test argument for nsIXPConnectWrappedJS
     nsCOMPtr<nsIXPConnectWrappedJS> wrapped = do_QueryInterface(aISupports);
     if (wrapped)