Bug 1187230: Convert Bluetooth to use daemon runnables, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Mon, 27 Jul 2015 13:33:17 +0200
changeset 286376 757f394b8d0d1fda7d3c036a0262438420ce4b7c
parent 286375 c08b1aea386333dbaf5b98a1bbcac4a116c983e8
child 286377 9910a8f9ecb119abf8217051c36362dc4db2ba52
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1187230
milestone42.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 1187230: Convert Bluetooth to use daemon runnables, r=shuang With this patch, Bluetooth uses the generic daemon runnables.
dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
@@ -476,18 +476,18 @@ BluetoothDaemonA2dpInterface::Disconnect
     DispatchError(aRes, rv);
   }
 }
 
 void
 BluetoothDaemonA2dpInterface::DispatchError(
   BluetoothA2dpResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothA2dpResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothA2dpResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothA2dpResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonA2dpInterface::DispatchError(
   BluetoothA2dpResultHandler* aRes, nsresult aRv)
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_bluetoothdaemona2dpinterface_h
 #define mozilla_dom_bluetooth_bluetoothdaemona2dpinterface_h
 
 #include "BluetoothDaemonHelpers.h"
 #include "BluetoothInterface.h"
 #include "BluetoothInterfaceHelpers.h"
+#include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothSetupResultHandler;
 
 class BluetoothDaemonA2dpModule
 {
 public:
@@ -57,21 +58,22 @@ protected:
 
   void HandleSvc(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothA2dpResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothA2dpResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothA2dpResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothA2dpResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
                 BluetoothA2dpResultHandler* aRes);
 
   void ConnectRsp(const DaemonSocketPDUHeader& aHeader,
                   DaemonSocketPDU& aPDU,
@@ -86,33 +88,29 @@ protected:
                  void* aUserData);
 
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         BluetoothA2dpConnectionState,
-                                         nsString,
-                                         BluetoothA2dpConnectionState,
-                                         const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothA2dpConnectionState, nsString,
+    BluetoothA2dpConnectionState, const nsAString&>
     ConnectionStateNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         BluetoothA2dpAudioState,
-                                         nsString,
-                                         BluetoothA2dpAudioState,
-                                         const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothA2dpAudioState, nsString,
+    BluetoothA2dpAudioState, const nsAString&>
     AudioStateNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         nsString, uint32_t, uint8_t,
-                                         const nsAString&, uint32_t, uint8_t>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, nsString, uint32_t, uint8_t,
+    const nsAString&, uint32_t, uint8_t>
     AudioConfigNotification;
 
   class ConnectionStateInitOp;
   class AudioStateInitOp;
   class AudioConfigInitOp;
 
   void ConnectionStateNtf(const DaemonSocketPDUHeader& aHeader,
                           DaemonSocketPDU& aPDU);
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
@@ -1085,18 +1085,18 @@ BluetoothDaemonAvrcpInterface::SetVolume
     DispatchError(aRes, rv);
   }
 }
 
 void
 BluetoothDaemonAvrcpInterface::DispatchError(
   BluetoothAvrcpResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothAvrcpResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothAvrcpResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonAvrcpInterface::DispatchError(
   BluetoothAvrcpResultHandler* aRes, nsresult aRv)
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_bluetoothdaemonavrcpinterface_h
 #define mozilla_dom_bluetooth_bluetoothdaemonavrcpinterface_h
 
 #include "BluetoothDaemonHelpers.h"
 #include "BluetoothInterface.h"
 #include "BluetoothInterfaceHelpers.h"
+#include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothSetupResultHandler;
 
 class BluetoothDaemonAvrcpModule
 {
 public:
@@ -121,21 +122,22 @@ protected:
 
   void HandleSvc(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothAvrcpResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothAvrcpResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothAvrcpResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothAvrcpResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
                 BluetoothAvrcpResultHandler* aRes);
 
   void GetPlayStatusRspRsp(const DaemonSocketPDUHeader& aHeader,
                            DaemonSocketPDU& aPDU,
@@ -182,67 +184,71 @@ protected:
                  void* aUserData);
 
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         nsString, unsigned long,
-                                         const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, nsString, unsigned long,
+    const nsAString&>
     RemoteFeatureNotification;
 
-  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
+  typedef mozilla::ipc::DaemonNotificationRunnable0<
+    NotificationHandlerWrapper, void>
     GetPlayStatusNotification;
 
-  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
+  typedef mozilla::ipc::DaemonNotificationRunnable0<
+    NotificationHandlerWrapper, void>
     ListPlayerAppAttrNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-                                         BluetoothAvrcpPlayerAttribute>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, BluetoothAvrcpPlayerAttribute>
     ListPlayerAppValuesNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    uint8_t, nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>,
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, uint8_t,
+    nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>,
     uint8_t, const BluetoothAvrcpPlayerAttribute*>
     GetPlayerAppValueNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    uint8_t, nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>,
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, uint8_t,
+    nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>,
     uint8_t, const BluetoothAvrcpPlayerAttribute*>
     GetPlayerAppAttrsTextNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         uint8_t, uint8_t,
-                                         nsAutoArrayPtr<uint8_t>, uint8_t,
-                                         uint8_t, const uint8_t*>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, uint8_t, uint8_t,
+    nsAutoArrayPtr<uint8_t>, uint8_t, uint8_t, const uint8_t*>
     GetPlayerAppValuesTextNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-                                         BluetoothAvrcpPlayerSettings,
-                                         const BluetoothAvrcpPlayerSettings&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, BluetoothAvrcpPlayerSettings,
+    const BluetoothAvrcpPlayerSettings&>
     SetPlayerAppValueNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    uint8_t, nsAutoArrayPtr<BluetoothAvrcpMediaAttribute>,
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, uint8_t,
+    nsAutoArrayPtr<BluetoothAvrcpMediaAttribute>,
     uint8_t, const BluetoothAvrcpMediaAttribute*>
     GetElementAttrNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         BluetoothAvrcpEvent, uint32_t>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothAvrcpEvent, uint32_t>
     RegisterNotificationNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         uint8_t, uint8_t>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, uint8_t, uint8_t>
     VolumeChangeNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         int, int>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, int, int>
     PassthroughCmdNotification;
 
   class GetElementAttrInitOp;
   class GetPlayerAppAttrsTextInitOp;
   class GetPlayerAppValueInitOp;
   class GetPlayerAppValuesTextInitOp;
   class PassthroughCmdInitOp;
   class RemoteFeatureInitOp;
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
@@ -2959,18 +2959,18 @@ BluetoothDaemonGattServerInterface::Send
     DispatchError(aRes, rv);
   }
 }
 
 void
 BluetoothDaemonGattClientInterface::DispatchError(
   BluetoothGattClientResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothGattClientResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothGattClientResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothGattResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonGattClientInterface::DispatchError(
   BluetoothGattClientResultHandler* aRes, nsresult aRv)
 {
@@ -2981,18 +2981,18 @@ BluetoothDaemonGattClientInterface::Disp
   }
   DispatchError(aRes, status);
 }
 
 void
 BluetoothDaemonGattServerInterface::DispatchError(
   BluetoothGattServerResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothGattServerResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothGattServerResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothGattResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonGattServerInterface::DispatchError(
   BluetoothGattServerResultHandler* aRes, nsresult aRv)
 {
@@ -3003,18 +3003,18 @@ BluetoothDaemonGattServerInterface::Disp
   }
   DispatchError(aRes, status);
 }
 
 void
 BluetoothDaemonGattInterface::DispatchError(
   BluetoothGattResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothGattResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothGattResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothGattResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonGattInterface::DispatchError(
   BluetoothGattResultHandler* aRes, nsresult aRv)
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_bluetoothdaemongattinterface_h
 #define mozilla_dom_bluetooth_bluetoothdaemongattinterface_h
 
 #include "BluetoothDaemonHelpers.h"
 #include "BluetoothInterface.h"
 #include "BluetoothInterfaceHelpers.h"
+#include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothSetupResultHandler;
 
 class BluetoothDaemonGattModule
 {
 public:
@@ -308,31 +309,35 @@ protected:
 
   void HandleSvc(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothGattClientResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothGattClientResultHandler, void>
     ClientResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothGattClientResultHandler, void,
-                                   BluetoothTypeOfDevice, BluetoothTypeOfDevice>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothGattClientResultHandler, void,
+    BluetoothTypeOfDevice, BluetoothTypeOfDevice>
     ClientGetDeviceTypeResultRunnable;
 
-  typedef BluetoothResultRunnable0<BluetoothGattServerResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothGattServerResultHandler, void>
     ServerResultRunnable;
 
-  typedef BluetoothResultRunnable0<BluetoothGattResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothGattResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothGattResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothGattResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
                 BluetoothGattResultHandler* aRes);
 
   void ClientRegisterRsp(const DaemonSocketPDUHeader& aHeader,
                          DaemonSocketPDU& aPDU,
@@ -483,197 +488,197 @@ protected:
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
   class ClientNotificationHandlerWrapper;
   class ServerNotificationHandlerWrapper;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ClientNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, BluetoothUuid,
     BluetoothGattStatus, int, const BluetoothUuid&>
     ClientRegisterNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ClientNotificationHandlerWrapper, void,
     nsString, int, BluetoothGattAdvData,
     const nsAString&, int, const BluetoothGattAdvData&>
     ClientScanResultNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, int, nsString,
     int, BluetoothGattStatus, int, const nsAString&>
     ClientConnectNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, int, nsString,
     int, BluetoothGattStatus, int, const nsAString&>
     ClientDisconnectNotification;
 
-  typedef BluetoothNotificationRunnable2<
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus>
     ClientSearchCompleteNotification;
 
-  typedef BluetoothNotificationRunnable2<
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattServiceId,
     int, const BluetoothGattServiceId&>
     ClientSearchResultNotification;
 
-  typedef BluetoothNotificationRunnable5<
+  typedef mozilla::ipc::DaemonNotificationRunnable5<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattServiceId,
     BluetoothGattId, BluetoothGattCharProp,
     int, BluetoothGattStatus, const BluetoothGattServiceId&,
     const BluetoothGattId&, const BluetoothGattCharProp&>
     ClientGetCharacteristicNotification;
 
-  typedef BluetoothNotificationRunnable5<
+  typedef mozilla::ipc::DaemonNotificationRunnable5<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattServiceId,
     BluetoothGattId, BluetoothGattId,
     int, BluetoothGattStatus, const BluetoothGattServiceId&,
     const BluetoothGattId&, const BluetoothGattId&>
     ClientGetDescriptorNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattServiceId, BluetoothGattServiceId,
     int, BluetoothGattStatus, const BluetoothGattServiceId&,
     const BluetoothGattServiceId&>
     ClientGetIncludedServiceNotification;
 
-  typedef BluetoothNotificationRunnable5<
+  typedef mozilla::ipc::DaemonNotificationRunnable5<
     ClientNotificationHandlerWrapper, void,
     int, int, BluetoothGattStatus,
     BluetoothGattServiceId, BluetoothGattId,
     int, int, BluetoothGattStatus,
     const BluetoothGattServiceId&, const BluetoothGattId&>
     ClientRegisterNotificationNotification;
 
-  typedef BluetoothNotificationRunnable2<
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattNotifyParam,
     int, const BluetoothGattNotifyParam&>
     ClientNotifyNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattReadParam,
     int, BluetoothGattStatus, const BluetoothGattReadParam&>
     ClientReadCharacteristicNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattWriteParam,
     int, BluetoothGattStatus, const BluetoothGattWriteParam&>
     ClientWriteCharacteristicNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattReadParam,
     int, BluetoothGattStatus, const BluetoothGattReadParam&>
     ClientReadDescriptorNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus, BluetoothGattWriteParam,
     int, BluetoothGattStatus, const BluetoothGattWriteParam&>
     ClientWriteDescriptorNotification;
 
-  typedef BluetoothNotificationRunnable2<
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
     ClientNotificationHandlerWrapper, void,
     int, BluetoothGattStatus>
     ClientExecuteWriteNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ClientNotificationHandlerWrapper, void,
     int, nsString, int, BluetoothGattStatus,
     int, const nsAString&, int, BluetoothGattStatus>
     ClientReadRemoteRssiNotification;
 
-  typedef BluetoothNotificationRunnable2<
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
     ClientNotificationHandlerWrapper, void,
     BluetoothGattStatus, int>
     ClientListenNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, BluetoothUuid,
     BluetoothGattStatus, int, const BluetoothUuid&>
     ServerRegisterNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ServerNotificationHandlerWrapper, void,
     int, int, bool, nsString,
     int, int, bool, const nsAString&>
     ServerConnectionNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, BluetoothGattServiceId, int,
     BluetoothGattStatus, int, const BluetoothGattServiceId&, int>
     ServerServiceAddedNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, int, int>
     ServerIncludedServiceAddedNotification;
 
-  typedef BluetoothNotificationRunnable5<
+  typedef mozilla::ipc::DaemonNotificationRunnable5<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, BluetoothUuid, int, int,
     BluetoothGattStatus, int, const BluetoothUuid&, int, int>
     ServerCharacteristicAddedNotification;
 
-  typedef BluetoothNotificationRunnable5<
+  typedef mozilla::ipc::DaemonNotificationRunnable5<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, BluetoothUuid, int, int,
     BluetoothGattStatus, int, const BluetoothUuid&, int, int>
     ServerDescriptorAddedNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, int>
     ServerServiceStartedNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, int>
     ServerServiceStoppedNotification;
 
-  typedef BluetoothNotificationRunnable3<
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int, int>
     ServerServiceDeletedNotification;
 
-  typedef BluetoothNotificationRunnable6<
+  typedef mozilla::ipc::DaemonNotificationRunnable6<
     ServerNotificationHandlerWrapper, void,
     int, int, nsString, int, int, bool,
     int, int, const nsAString&, int, int, bool>
     ServerRequestReadNotification;
 
-  typedef BluetoothNotificationRunnable9<
+  typedef mozilla::ipc::DaemonNotificationRunnable9<
     ServerNotificationHandlerWrapper, void,
     int, int, nsString, int, int, int, nsAutoArrayPtr<uint8_t>, bool, bool,
     int, int, const nsAString&, int, int, int, const uint8_t*, bool, bool>
     ServerRequestWriteNotification;
 
-  typedef BluetoothNotificationRunnable4<
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
     ServerNotificationHandlerWrapper, void,
     int, int, nsString, bool,
     int, int, const nsAString&, bool>
     ServerRequestExecuteWriteNotification;
 
-  typedef BluetoothNotificationRunnable2<
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
     ServerNotificationHandlerWrapper, void,
     BluetoothGattStatus, int>
     ServerResponseConfirmationNotification;
 
   class ClientScanResultInitOp;
   class ClientConnectDisconnectInitOp;
   class ClientReadRemoteRssiInitOp;
   class ClientGetDeviceTypeInitOp;
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
@@ -1794,18 +1794,18 @@ BluetoothDaemonHandsfreeInterface::Confi
     DispatchError(aRes, rv);
   }
 }
 
 void
 BluetoothDaemonHandsfreeInterface::DispatchError(
   BluetoothHandsfreeResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothHandsfreeResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothHandsfreeResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonHandsfreeInterface::DispatchError(
   BluetoothHandsfreeResultHandler* aRes, nsresult aRv)
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_bluetoothdaemonhandsfreeinterface_h
 #define mozilla_dom_bluetooth_bluetoothdaemonhandsfreeinterface_h
 
 #include "BluetoothDaemonHelpers.h"
 #include "BluetoothInterface.h"
 #include "BluetoothInterfaceHelpers.h"
+#include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothSetupResultHandler;
 
 class BluetoothDaemonHandsfreeModule
 {
 public:
@@ -130,21 +131,22 @@ protected:
 
   void HandleSvc(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothHandsfreeResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothHandsfreeResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothHandsfreeResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothHandsfreeResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
                 BluetoothHandsfreeResultHandler* aRes);
 
   void ConnectRsp(const DaemonSocketPDUHeader& aHeader,
                   DaemonSocketPDU& aPDU,
@@ -211,98 +213,86 @@ protected:
                  void* aUserData);
 
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         BluetoothHandsfreeConnectionState,
-                                         nsString,
-                                         BluetoothHandsfreeConnectionState,
-                                         const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothHandsfreeConnectionState,
+    nsString, BluetoothHandsfreeConnectionState, const nsAString&>
     ConnectionStateNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         BluetoothHandsfreeAudioState,
-                                         nsString,
-                                         BluetoothHandsfreeAudioState,
-                                         const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothHandsfreeAudioState,
+    nsString, BluetoothHandsfreeAudioState, const nsAString&>
     AudioStateNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeVoiceRecognitionState, nsString,
-    BluetoothHandsfreeVoiceRecognitionState, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothHandsfreeVoiceRecognitionState,
+    nsString, BluetoothHandsfreeVoiceRecognitionState, const nsAString&>
     VoiceRecognitionNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     AnswerCallNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     HangupCallNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeVolumeType, int, nsString,
-    BluetoothHandsfreeVolumeType, int, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, BluetoothHandsfreeVolumeType,
+    int, nsString, BluetoothHandsfreeVolumeType, int, const nsAString&>
     VolumeNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    nsString, nsString,
-    const nsAString&, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, nsString, nsString, const nsAString&,
+    const nsAString&>
     DialCallNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    char, nsString,
-    char, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, char, nsString, char, const nsAString&>
     DtmfNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeNRECState, nsString,
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothHandsfreeNRECState, nsString,
     BluetoothHandsfreeNRECState, const nsAString&>
     NRECNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeCallHoldType, nsString,
-    BluetoothHandsfreeCallHoldType, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothHandsfreeCallHoldType,
+    nsString, BluetoothHandsfreeCallHoldType, const nsAString&>
     CallHoldNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     CnumNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     CindNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     CopsNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     ClccNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    nsCString, nsString,
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, nsCString, nsString,
     const nsACString&, const nsAString&>
     UnknownAtNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, nsString, const nsAString&>
     KeyPressedNotification;
 
   class ConnectionStateInitOp;
   class AudioStateInitOp;
   class VoiceRecognitionInitOp;
   class AnswerCallInitOp;
   class HangupCallInitOp;
   class VolumeInitOp;
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
@@ -12,16 +12,17 @@
 #include "BluetoothDaemonAvrcpInterface.h"
 #include "BluetoothDaemonConnector.h"
 #include "BluetoothDaemonGattInterface.h"
 #include "BluetoothDaemonHandsfreeInterface.h"
 #include "BluetoothDaemonHelpers.h"
 #include "BluetoothDaemonSetupInterface.h"
 #include "BluetoothDaemonSocketInterface.h"
 #include "BluetoothInterfaceHelpers.h"
+#include "mozilla/ipc/DaemonRunnables.h"
 #include "mozilla/ipc/DaemonSocket.h"
 #include "mozilla/ipc/ListenSocket.h"
 #include "mozilla/unused.h"
 #include "prrng.h"
 
 using namespace mozilla::ipc;
 
 BEGIN_BLUETOOTH_NAMESPACE
@@ -142,21 +143,22 @@ protected:
     return Send(aPDU, static_cast<void*>(aRes));
   }
 
 private:
 
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothSetupResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothSetupResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothSetupResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothSetupResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void
   ErrorRsp(const DaemonSocketPDUHeader& aHeader,
            DaemonSocketPDU& aPDU,
            BluetoothSetupResultHandler* aRes)
   {
     ErrorRunnable::Dispatch(
@@ -614,21 +616,22 @@ protected:
     return Send(aPDU, static_cast<void*>(aRes));
   }
 
 private:
 
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
                 BluetoothResultHandler* aRes)
   {
     ErrorRunnable::Dispatch(
       aRes, &BluetoothResultHandler::OnError, UnpackPDUInitOp(aPDU));
@@ -876,73 +879,68 @@ private:
     static ObjectType* GetInstance()
     {
       MOZ_ASSERT(NS_IsMainThread());
 
       return sNotificationHandler;
     }
   };
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-                                         bool>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, bool>
     AdapterStateChangedNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         BluetoothStatus, int,
-                                         nsAutoArrayPtr<BluetoothProperty>,
-                                         BluetoothStatus, int,
-                                         const BluetoothProperty*>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, BluetoothStatus, int,
+    nsAutoArrayPtr<BluetoothProperty>, BluetoothStatus, int,
+    const BluetoothProperty*>
     AdapterPropertiesNotification;
 
-  typedef BluetoothNotificationRunnable4<NotificationHandlerWrapper, void,
-                                         BluetoothStatus, nsString, int,
-                                         nsAutoArrayPtr<BluetoothProperty>,
-                                         BluetoothStatus, const nsAString&,
-                                         int, const BluetoothProperty*>
+  typedef mozilla::ipc::DaemonNotificationRunnable4<
+    NotificationHandlerWrapper, void, BluetoothStatus, nsString, int,
+    nsAutoArrayPtr<BluetoothProperty>, BluetoothStatus, const nsAString&,
+    int, const BluetoothProperty*>
     RemoteDevicePropertiesNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         int,
-                                         nsAutoArrayPtr<BluetoothProperty>,
-                                         int, const BluetoothProperty*>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, int, nsAutoArrayPtr<BluetoothProperty>,
+    int, const BluetoothProperty*>
     DeviceFoundNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-                                         bool>
+  typedef mozilla::ipc::DaemonNotificationRunnable1<
+    NotificationHandlerWrapper, void, bool>
     DiscoveryStateChangedNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         nsString, nsString, uint32_t,
-                                         const nsAString&, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, nsString, nsString, uint32_t,
+    const nsAString&, const nsAString&>
     PinRequestNotification;
 
-  typedef BluetoothNotificationRunnable5<NotificationHandlerWrapper, void,
-                                         nsString, nsString, uint32_t,
-                                         BluetoothSspVariant, uint32_t,
-                                         const nsAString&, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable5<
+    NotificationHandlerWrapper, void, nsString, nsString, uint32_t,
+    BluetoothSspVariant, uint32_t, const nsAString&, const nsAString&>
     SspRequestNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         BluetoothStatus, nsString,
-                                         BluetoothBondState,
-                                         BluetoothStatus, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, BluetoothStatus, nsString,
+    BluetoothBondState, BluetoothStatus, const nsAString&>
     BondStateChangedNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         BluetoothStatus, nsString, bool,
-                                         BluetoothStatus, const nsAString&>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, BluetoothStatus, nsString, bool,
+    BluetoothStatus, const nsAString&>
     AclStateChangedNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         uint16_t, nsAutoArrayPtr<uint8_t>,
-                                         uint8_t, uint16_t, const uint8_t*>
+  typedef mozilla::ipc::DaemonNotificationRunnable3<
+    NotificationHandlerWrapper, void, uint16_t, nsAutoArrayPtr<uint8_t>,
+    uint8_t, uint16_t, const uint8_t*>
     DutModeRecvNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-                                         BluetoothStatus, uint16_t>
+  typedef mozilla::ipc::DaemonNotificationRunnable2<
+    NotificationHandlerWrapper, void, BluetoothStatus, uint16_t>
     LeTestModeNotification;
 
   void AdapterStateChangedNtf(const DaemonSocketPDUHeader& aHeader,
                               DaemonSocketPDU& aPDU)
   {
     AdapterStateChangedNotification::Dispatch(
       &BluetoothNotificationHandler::AdapterStateChangedNotification,
       UnpackPDUInitOp(aPDU));
@@ -2236,17 +2234,17 @@ BluetoothDaemonInterface::ReadEnergyInfo
 {
   // NO-OP: no corresponding interface of current BlueZ
 }
 
 void
 BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
                                         BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<
+  DaemonResultRunnable1<
     BluetoothResultHandler, void, BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
                                         nsresult aRv)
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
@@ -361,18 +361,18 @@ BluetoothDaemonSocketInterface::Close(Bl
     DispatchError(aRes, rv);
   }
 }
 
 void
 BluetoothDaemonSocketInterface::DispatchError(
   BluetoothSocketResultHandler* aRes, BluetoothStatus aStatus)
 {
-  BluetoothResultRunnable1<BluetoothSocketResultHandler, void,
-                           BluetoothStatus, BluetoothStatus>::Dispatch(
+  DaemonResultRunnable1<BluetoothSocketResultHandler, void,
+                        BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothSocketResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
 
 void
 BluetoothDaemonSocketInterface::DispatchError(
   BluetoothSocketResultHandler* aRes, nsresult aRv)
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_bluetooth_bluedroid_bluetoothdaemonsocketinterface_h__
 #define mozilla_dom_bluetooth_bluedroid_bluetoothdaemonsocketinterface_h__
 
 #include "BluetoothDaemonHelpers.h"
 #include "BluetoothInterface.h"
 #include "BluetoothInterfaceHelpers.h"
+#include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 class BluetoothDaemonSocketModule
 {
 public:
@@ -53,30 +54,31 @@ private:
   class ConnectWatcher;
   class ListenInitOp;
 
   uint8_t SocketFlags(bool aEncrypt, bool aAuth);
 
   // Responses
   //
 
-  typedef BluetoothResultRunnable0<BluetoothSocketResultHandler, void>
+  typedef mozilla::ipc::DaemonResultRunnable0<
+    BluetoothSocketResultHandler, void>
     ResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothSocketResultHandler, void,
-                                   int, int>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothSocketResultHandler, void, int, int>
     IntResultRunnable;
 
-  typedef BluetoothResultRunnable1<BluetoothSocketResultHandler, void,
-                                   BluetoothStatus, BluetoothStatus>
+  typedef mozilla::ipc::DaemonResultRunnable1<
+    BluetoothSocketResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
-  typedef BluetoothResultRunnable3<BluetoothSocketResultHandler, void,
-                                   int, nsString, int,
-                                   int, const nsAString_internal&, int>
+  typedef mozilla::ipc::DaemonResultRunnable3<
+    BluetoothSocketResultHandler, void, int, nsString, int, int,
+    const nsAString_internal&, int>
     IntStringIntResultRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
                 BluetoothSocketResultHandler* aRes);
 
   void ListenRsp(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU,