Bug 1146923: Rename |BluetoothSspPairingVariant| to |BluetoothSspVariant|, r=btian
authorThomas Zimmermann <tdz@users.sourceforge.net>
Thu, 26 Mar 2015 10:29:58 +0100
changeset 265983 ad9d80aa4f2c1e4ccbfc934bf6e5055e55331cbc
parent 265982 648003ae99f0a9ad72b6f54f87acbf1c8c17bf63
child 265984 e81e1da40a9c9086c9b4519f4358f2be296cda41
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtian
bugs1146923
milestone39.0a1
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
Bug 1146923: Rename |BluetoothSspPairingVariant| to |BluetoothSspVariant|, r=btian
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -196,16 +196,23 @@ enum BluetoothPropertyType {
 };
 
 enum BluetoothScanMode {
   SCAN_MODE_NONE,
   SCAN_MODE_CONNECTABLE,
   SCAN_MODE_CONNECTABLE_DISCOVERABLE
 };
 
+enum BluetoothSspVariant {
+  SSP_VARIANT_PASSKEY_CONFIRMATION,
+  SSP_VARIANT_PASSKEY_ENTRY,
+  SSP_VARIANT_CONSENT,
+  SSP_VARIANT_PASSKEY_NOTIFICATION
+};
+
 struct BluetoothUuid {
   uint8_t mUuid[16];
 };
 
 struct BluetoothServiceRecord {
   BluetoothUuid mUuid;
   uint16_t mChannel;
   char mName[256];
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
@@ -450,28 +450,28 @@ Convert(BluetoothSocketType aIn, uint8_t
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sSocketType[aIn];
   return NS_OK;
 }
 
 nsresult
-Convert(uint8_t aIn, BluetoothSspPairingVariant& aOut)
+Convert(uint8_t aIn, BluetoothSspVariant& aOut)
 {
-  static const BluetoothSspPairingVariant sSspPairingVariant[] = {
+  static const BluetoothSspVariant sSspVariant[] = {
     CONVERT(0x00, SSP_VARIANT_PASSKEY_CONFIRMATION),
     CONVERT(0x01, SSP_VARIANT_PASSKEY_ENTRY),
     CONVERT(0x02, SSP_VARIANT_CONSENT),
     CONVERT(0x03, SSP_VARIANT_PASSKEY_NOTIFICATION)
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSspPairingVariant))) {
+  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSspVariant))) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
-  aOut = sSspPairingVariant[aIn];
+  aOut = sSspVariant[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothStatus& aOut)
 {
   static const BluetoothStatus sStatus[] = {
     CONVERT(0x00, STATUS_SUCCESS),
@@ -594,17 +594,17 @@ Convert(const nsAString& aIn, BluetoothS
 
   memcpy(aOut.mName, str, len);
   memset(aOut.mName + len, 0, sizeof(aOut.mName) - len);
 
   return NS_OK;
 }
 
 nsresult
-Convert(const nsAString& aIn, BluetoothSspPairingVariant& aOut)
+Convert(const nsAString& aIn, BluetoothSspVariant& aOut)
 {
   if (aIn.EqualsLiteral("PasskeyConfirmation")) {
     aOut = SSP_VARIANT_PASSKEY_CONFIRMATION;
   } else if (aIn.EqualsLiteral("PasskeyEntry")) {
     aOut = SSP_VARIANT_PASSKEY_ENTRY;
   } else if (aIn.EqualsLiteral("Consent")) {
     aOut = SSP_VARIANT_CONSENT;
   } else if (aIn.EqualsLiteral("PasskeyNotification")) {
@@ -937,34 +937,34 @@ Convert(BluetoothScanMode aIn, int32_t& 
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sScanMode[aIn];
   return NS_OK;
 }
 
 nsresult
-Convert(BluetoothSspPairingVariant aIn, uint8_t& aOut)
+Convert(BluetoothSspVariant aIn, uint8_t& aOut)
 {
   static const uint8_t sValue[] = {
     CONVERT(SSP_VARIANT_PASSKEY_CONFIRMATION, 0x00),
     CONVERT(SSP_VARIANT_PASSKEY_ENTRY, 0x01),
     CONVERT(SSP_VARIANT_CONSENT, 0x02),
     CONVERT(SSP_VARIANT_PASSKEY_NOTIFICATION, 0x03)
   };
   if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
-Convert(BluetoothSspPairingVariant aIn, nsAString& aOut)
+Convert(BluetoothSspVariant aIn, nsAString& aOut)
 {
   static const char* const sString[] = {
     CONVERT(SSP_VARIANT_PASSKEY_CONFIRMATION, "PasskeyConfirmation"),
     CONVERT(SSP_VARIANT_PASSKEY_ENTRY, "PasskeyEntry"),
     CONVERT(SSP_VARIANT_CONSENT, "Consent"),
     CONVERT(SSP_VARIANT_PASSKEY_NOTIFICATION, "PasskeyNotification")
   };
   if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sString))) {
@@ -1326,20 +1326,19 @@ PackPDU(const BluetoothPinCode& aIn, Blu
 
 nsresult
 PackPDU(BluetoothPropertyType aIn, BluetoothDaemonPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothPropertyType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothSspPairingVariant aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothSspVariant aIn, BluetoothDaemonPDU& aPDU)
 {
-  return PackPDU(PackConversion<BluetoothSspPairingVariant, uint8_t>(aIn),
-                 aPDU);
+  return PackPDU(PackConversion<BluetoothSspVariant, uint8_t>(aIn), aPDU);
 }
 
 nsresult
 PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothScanMode, int32_t>(aIn), aPDU);
 }
 
@@ -1636,20 +1635,20 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack name */
   return aPDU.Read(aOut.mName, sizeof(aOut.mName));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspPairingVariant& aOut)
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspVariant& aOut)
 {
   return UnpackPDU(
-    aPDU, UnpackConversion<uint8_t, BluetoothSspPairingVariant>(aOut));
+    aPDU, UnpackConversion<uint8_t, BluetoothSspVariant>(aOut));
 }
 
 nsresult
 UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothStatus& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<uint8_t, BluetoothStatus>(aOut));
 }
 
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
@@ -21,23 +21,16 @@ BEGIN_BLUETOOTH_NAMESPACE
 // Helper structures
 //
 
 enum BluetoothAclState {
   ACL_STATE_CONNECTED,
   ACL_STATE_DISCONNECTED
 };
 
-enum BluetoothSspPairingVariant {
-  SSP_VARIANT_PASSKEY_CONFIRMATION,
-  SSP_VARIANT_PASSKEY_ENTRY,
-  SSP_VARIANT_CONSENT,
-  SSP_VARIANT_PASSKEY_NOTIFICATION
-};
-
 struct BluetoothAddress {
   uint8_t mAddr[6];
 };
 
 struct BluetoothAvrcpAttributeTextPairs {
   BluetoothAvrcpAttributeTextPairs(const uint8_t* aAttr,
                                    const char** aText,
                                    size_t aLength)
@@ -237,17 +230,17 @@ Convert(uint8_t aIn, BluetoothTypeOfDevi
 
 nsresult
 Convert(uint8_t aIn, BluetoothPropertyType& aOut);
 
 nsresult
 Convert(uint8_t aIn, BluetoothScanMode& aOut);
 
 nsresult
-Convert(uint8_t aIn, BluetoothSspPairingVariant& aOut);
+Convert(uint8_t aIn, BluetoothSspVariant& aOut);
 
 nsresult
 Convert(uint8_t aIn, BluetoothStatus& aOut);
 
 nsresult
 Convert(uint32_t aIn, int& aOut);
 
 nsresult
@@ -264,17 +257,17 @@ Convert(const nsAString& aIn, BluetoothP
 
 nsresult
 Convert(const nsAString& aIn, BluetoothPropertyType& aOut);
 
 nsresult
 Convert(const nsAString& aIn, BluetoothServiceName& aOut);
 
 nsresult
-Convert(const nsAString& aIn, BluetoothSspPairingVariant& aOut);
+Convert(const nsAString& aIn, BluetoothSspVariant& aOut);
 
 nsresult
 Convert(BluetoothAclState aIn, bool& aOut);
 
 nsresult
 Convert(const BluetoothAddress& aIn, nsAString& aOut);
 
 nsresult
@@ -330,20 +323,20 @@ Convert(const BluetoothRemoteName& aIn, 
 
 nsresult
 Convert(BluetoothScanMode aIn, uint8_t& aOut);
 
 nsresult
 Convert(BluetoothSocketType aIn, uint8_t& aOut);
 
 nsresult
-Convert(BluetoothSspPairingVariant aIn, uint8_t& aOut);
+Convert(BluetoothSspVariant aIn, uint8_t& aOut);
 
 nsresult
-Convert(BluetoothSspPairingVariant aIn, nsAString& aOut);
+Convert(BluetoothSspVariant aIn, nsAString& aOut);
 
 nsresult
 Convert(ControlPlayStatus aIn, uint8_t& aOut);
 
 //
 // Packing
 //
 
@@ -455,17 +448,17 @@ PackPDU(BluetoothPropertyType aIn, Bluet
 
 nsresult
 PackPDU(const BluetoothServiceName& aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
 PackPDU(BluetoothSocketType aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothSspPairingVariant aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothSspVariant aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
 PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
 PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
@@ -838,17 +831,17 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
 
 nsresult
 UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothScanMode& aOut);
 
 nsresult
 UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothServiceRecord& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspPairingVariant& aOut);
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspVariant& aOut);
 
 nsresult
 UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothStatus& aOut);
 
 inline nsresult
 UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothUuid& aOut)
 {
   return aPDU.Read(aOut.mUuid, sizeof(aOut.mUuid));
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
@@ -513,17 +513,17 @@ public:
                        BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x11, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr),
-      PackConversion<nsAString, BluetoothSspPairingVariant>(aVariant),
+      PackConversion<nsAString, BluetoothSspVariant>(aVariant),
       aAccept, aPasskey, *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
@@ -1171,17 +1171,17 @@ private:
       /* Read CoD */
       rv = UnpackPDU(pdu, aArg3);
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read pairing variant */
       rv = UnpackPDU(
-        pdu, UnpackConversion<BluetoothSspPairingVariant, nsAString>(aArg4));
+        pdu, UnpackConversion<BluetoothSspVariant, nsAString>(aArg4));
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read passkey */
       rv = UnpackPDU(pdu, aArg5);
       if (NS_FAILED(rv)) {
         return rv;