Bug 1105308: Cleanup non-shared functions in Bluedroid's BluetoothUtils.{cpp,h}, r=btian
authorThomas Zimmermann <tdz@users.sourceforge.net>
Fri, 28 Nov 2014 11:49:40 +0100
changeset 243876 6230fb3f608aa0ce33773c083488e90dfc87010f
parent 243875 d359d36fbaa832fcf601add06a0db4f61e588adc
child 243877 10ecf1e770b1348ad41bcfe716d9c74c80c4490f
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtian
bugs1105308
milestone36.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 1105308: Cleanup non-shared functions in Bluedroid's BluetoothUtils.{cpp,h}, r=btian This patch moves functions out of Bluedroid's BluetoothUtils.{cpp,h} that are specific to this backend.
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
dom/bluetooth/bluedroid/BluetoothUtils.cpp
dom/bluetooth/bluedroid/BluetoothUtils.h
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -1093,16 +1093,25 @@ BluetoothServiceBluedroid::IgnoreWaiting
 {
 }
 
 void
 BluetoothServiceBluedroid::ToggleCalls(BluetoothReplyRunnable* aRunnable)
 {
 }
 
+uint16_t
+BluetoothServiceBluedroid::UuidToServiceClassInt(const BluetoothUuid& mUuid)
+{
+  // extract short UUID 0000xxxx-0000-1000-8000-00805f9b34fb
+  uint16_t shortUuid;
+  memcpy(&shortUuid, mUuid.mUuid + 2, sizeof(uint16_t));
+  return ntohs(shortUuid);
+}
+
 //
 // Bluetooth notifications
 //
 
 /* |ProfileDeinitResultHandler| collect the results of all profile
  * result handlers and calls |Proceed| after all results handlers
  * have been run.
  */
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
@@ -216,14 +216,16 @@ protected:
   static nsresult StartGonkBluetooth();
   static nsresult StopGonkBluetooth();
   static bool EnsureBluetoothHalLoad();
 
   static void ClassToIcon(uint32_t aClass, nsAString& aRetIcon);
 
   static ControlPlayStatus PlayStatusStringToControlPlayStatus(
     const nsAString& aPlayStatus);
+
+  uint16_t UuidToServiceClassInt(const BluetoothUuid& mUuid);
 };
 
 END_BLUETOOTH_NAMESPACE
 
 #endif
 
--- a/dom/bluetooth/bluedroid/BluetoothUtils.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothUtils.cpp
@@ -17,25 +17,16 @@
 #include "nsIScriptContext.h"
 #include "nsISystemMessagesInternal.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsServiceManagerUtils.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
-uint16_t
-UuidToServiceClassInt(const BluetoothUuid& mUuid)
-{
-  // extract short UUID 0000xxxx-0000-1000-8000-00805f9b34fb
-  uint16_t shortUuid;
-  memcpy(&shortUuid, mUuid.mUuid + 2, sizeof(uint16_t));
-  return ntohs(shortUuid);
-}
-
 bool
 SetJsObject(JSContext* aContext,
             const BluetoothValue& aValue,
             JS::Handle<JSObject*> aObj)
 {
   MOZ_ASSERT(aContext && aObj);
 
   if (aValue.type() != BluetoothValue::TArrayOfBluetoothNamedValue) {
--- a/dom/bluetooth/bluedroid/BluetoothUtils.h
+++ b/dom/bluetooth/bluedroid/BluetoothUtils.h
@@ -11,19 +11,16 @@
 #include "js/TypeDecls.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothNamedValue;
 class BluetoothValue;
 class BluetoothReplyRunnable;
 
-uint16_t
-UuidToServiceClassInt(const BluetoothUuid& mUuid);
-
 bool
 SetJsObject(JSContext* aContext,
             const BluetoothValue& aValue,
             JS::Handle<JSObject*> aObj);
 
 bool
 BroadcastSystemMessage(const nsAString& aType,
                        const BluetoothValue& aData);