Commit d360346d authored by Thomas Zimmermann's avatar Thomas Zimmermann
Browse files

Bug 1187230: Convert Bluetooth to use daemon runnables, r=shuang

With this patch, Bluetooth uses the generic daemon runnables.
parent 30f976ec
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ void
BluetoothDaemonA2dpInterface::DispatchError(
  BluetoothA2dpResultHandler* aRes, BluetoothStatus aStatus)
{
  BluetoothResultRunnable1<BluetoothA2dpResultHandler, void,
  DaemonResultRunnable1<BluetoothA2dpResultHandler, void,
                        BluetoothStatus, BluetoothStatus>::Dispatch(
    aRes, &BluetoothA2dpResultHandler::OnError,
    ConstantInitOp1<BluetoothStatus>(aStatus));
+14 −16
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include "BluetoothDaemonHelpers.h"
#include "BluetoothInterface.h"
#include "BluetoothInterfaceHelpers.h"
#include "mozilla/ipc/DaemonRunnables.h"

BEGIN_BLUETOOTH_NAMESPACE

@@ -62,11 +63,12 @@ protected:
  // 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,
@@ -91,22 +93,18 @@ protected:

  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,
  typedef mozilla::ipc::DaemonNotificationRunnable3<
    NotificationHandlerWrapper, void, nsString, uint32_t, uint8_t,
    const nsAString&, uint32_t, uint8_t>
    AudioConfigNotification;

+2 −2
Original line number Diff line number Diff line
@@ -1090,7 +1090,7 @@ void
BluetoothDaemonAvrcpInterface::DispatchError(
  BluetoothAvrcpResultHandler* aRes, BluetoothStatus aStatus)
{
  BluetoothResultRunnable1<BluetoothAvrcpResultHandler, void,
  DaemonResultRunnable1<BluetoothAvrcpResultHandler, void,
                        BluetoothStatus, BluetoothStatus>::Dispatch(
    aRes, &BluetoothAvrcpResultHandler::OnError,
    ConstantInitOp1<BluetoothStatus>(aStatus));
+35 −29
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include "BluetoothDaemonHelpers.h"
#include "BluetoothInterface.h"
#include "BluetoothInterfaceHelpers.h"
#include "mozilla/ipc/DaemonRunnables.h"

BEGIN_BLUETOOTH_NAMESPACE

@@ -126,11 +127,12 @@ protected:
  // 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,
@@ -187,57 +189,61 @@ protected:

  class NotificationHandlerWrapper;

  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
                                         nsString, unsigned long,
  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,
  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;
+6 −6
Original line number Diff line number Diff line
@@ -2964,7 +2964,7 @@ void
BluetoothDaemonGattClientInterface::DispatchError(
  BluetoothGattClientResultHandler* aRes, BluetoothStatus aStatus)
{
  BluetoothResultRunnable1<BluetoothGattClientResultHandler, void,
  DaemonResultRunnable1<BluetoothGattClientResultHandler, void,
                        BluetoothStatus, BluetoothStatus>::Dispatch(
    aRes, &BluetoothGattResultHandler::OnError,
    ConstantInitOp1<BluetoothStatus>(aStatus));
@@ -2986,7 +2986,7 @@ void
BluetoothDaemonGattServerInterface::DispatchError(
  BluetoothGattServerResultHandler* aRes, BluetoothStatus aStatus)
{
  BluetoothResultRunnable1<BluetoothGattServerResultHandler, void,
  DaemonResultRunnable1<BluetoothGattServerResultHandler, void,
                        BluetoothStatus, BluetoothStatus>::Dispatch(
    aRes, &BluetoothGattResultHandler::OnError,
    ConstantInitOp1<BluetoothStatus>(aStatus));
@@ -3008,7 +3008,7 @@ void
BluetoothDaemonGattInterface::DispatchError(
  BluetoothGattResultHandler* aRes, BluetoothStatus aStatus)
{
  BluetoothResultRunnable1<BluetoothGattResultHandler, void,
  DaemonResultRunnable1<BluetoothGattResultHandler, void,
                        BluetoothStatus, BluetoothStatus>::Dispatch(
    aRes, &BluetoothGattResultHandler::OnError,
    ConstantInitOp1<BluetoothStatus>(aStatus));
Loading