Bug 1203092: Inherit Bluetooth result handlers from |DaemonSocketResultHandler|, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Tue, 15 Sep 2015 12:55:02 +0200
changeset 262635 103d592c9630671a712d5be3d82524cafa05e537
parent 262634 1a8bfb9330d9b8f4eac3d8e0998a0df979a5d48c
child 262636 0634d9d4ab5dcdbe4790dedaaa0deabc4267ef65
push id15198
push userkwierso@gmail.com
push dateWed, 16 Sep 2015 00:21:31 +0000
treeherderfx-team@dbfddd6efb5d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1203092
milestone43.0a1
Bug 1203092: Inherit Bluetooth result handlers from |DaemonSocketResultHandler|, r=shuang
dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.h
dom/bluetooth/common/BluetoothInterface.h
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.h
@@ -3,24 +3,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_bluedroid_BluetoothDaemonSetupInterface_h
 #define mozilla_dom_bluetooth_bluedroid_BluetoothDaemonSetupInterface_h
 
 #include "BluetoothCommon.h"
+#include "mozilla/ipc/DaemonSocketMessageHandlers.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothSetupResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothSetupResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus);
   virtual void RegisterModule();
   virtual void UnregisterModule();
   virtual void Configuration();
 
 protected:
   virtual ~BluetoothSetupResultHandler();
 };
--- a/dom/bluetooth/common/BluetoothInterface.h
+++ b/dom/bluetooth/common/BluetoothInterface.h
@@ -4,28 +4,28 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_BluetoothInterface_h
 #define mozilla_dom_bluetooth_BluetoothInterface_h
 
 #include "BluetoothCommon.h"
 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
+#include "mozilla/ipc/DaemonSocketMessageHandlers.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
 // Socket Interface
 //
 
 class BluetoothSocketResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothSocketResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus)
   {
     BT_WARNING("Received error code %d", (int)aStatus);
   }
 
   virtual void Listen(int aSockFd) { }
   virtual void Connect(int aSockFd, const nsAString& aBdAddress,
                        int aConnectionState) { }
@@ -150,20 +150,19 @@ public:
 protected:
   BluetoothHandsfreeNotificationHandler()
   { }
 
   virtual ~BluetoothHandsfreeNotificationHandler();
 };
 
 class BluetoothHandsfreeResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothHandsfreeResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus)
   {
     BT_WARNING("Received error code %d", (int)aStatus);
   }
 
   virtual void Init() { }
   virtual void Cleanup() { }
 
@@ -298,20 +297,19 @@ public:
 protected:
   BluetoothA2dpNotificationHandler()
   { }
 
   virtual ~BluetoothA2dpNotificationHandler();
 };
 
 class BluetoothA2dpResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothA2dpResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus)
   {
     BT_WARNING("Received error code %d", (int)aStatus);
   }
 
   virtual void Init() { }
   virtual void Cleanup() { }
   virtual void Connect() { }
@@ -401,20 +399,19 @@ public:
 protected:
   BluetoothAvrcpNotificationHandler()
   { }
 
   virtual ~BluetoothAvrcpNotificationHandler();
 };
 
 class BluetoothAvrcpResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothAvrcpResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus)
   {
     BT_WARNING("Received error code %d", (int)aStatus);
   }
 
   virtual void Init() { }
   virtual void Cleanup() { }
 
@@ -715,20 +712,19 @@ public:
 protected:
   BluetoothGattNotificationHandler()
   { }
 
   virtual ~BluetoothGattNotificationHandler();
 };
 
 class BluetoothGattResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothGattResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus)
   {
     BT_WARNING("Received error code %d", (int)aStatus);
   }
 
   virtual void Init() { }
   virtual void Cleanup() { }
 
@@ -1043,20 +1039,19 @@ public:
 protected:
   BluetoothNotificationHandler()
   { }
 
   virtual ~BluetoothNotificationHandler();
 };
 
 class BluetoothResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BluetoothResultHandler)
-
   virtual void OnError(BluetoothStatus aStatus)
   {
     BT_LOGR("Received error code %d", aStatus);
   }
 
   virtual void Init() { }
   virtual void Cleanup() { }
   virtual void Enable() { }