Bug 1204801: Move |BlutoothSetupResultHandler| to generic backend interface, r=btian
authorThomas Zimmermann <tdz@users.sourceforge.net>
Wed, 16 Sep 2015 10:37:58 +0200
changeset 295424 431b83a1923ad6718c092564791334e257d2425e
parent 295423 f46e4ced44d3b0b32148037e1b186dce3d9945de
child 295425 d0f2e3af0595a6e3e8d43b12c15ffaf70c137aa5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtian
bugs1204801
milestone43.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 1204801: Move |BlutoothSetupResultHandler| to generic backend interface, r=btian |BluetoothSetupResultHandler| is independent from the Bluetooth backend code. This patch moves it to the other backend interfaces.
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/BluetoothDaemonSetupInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.h
dom/bluetooth/common/BluetoothInterface.cpp
dom/bluetooth/common/BluetoothInterface.h
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "BluetoothDaemonA2dpInterface.h"
-#include "BluetoothDaemonSetupInterface.h"
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 //
 // A2DP module
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
@@ -12,18 +12,16 @@
 #include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using mozilla::ipc::DaemonSocketPDU;
 using mozilla::ipc::DaemonSocketPDUHeader;
 using mozilla::ipc::DaemonSocketResultHandler;
 
-class BluetoothSetupResultHandler;
-
 class BluetoothDaemonA2dpModule
 {
 public:
   enum {
     SERVICE_ID = 0x06
   };
 
   enum {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "BluetoothDaemonAvrcpInterface.h"
-#include "BluetoothDaemonSetupInterface.h"
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 //
 // AVRCP module
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
@@ -12,18 +12,16 @@
 #include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using mozilla::ipc::DaemonSocketPDU;
 using mozilla::ipc::DaemonSocketPDUHeader;
 using mozilla::ipc::DaemonSocketResultHandler;
 
-class BluetoothSetupResultHandler;
-
 class BluetoothDaemonAvrcpModule
 {
 public:
   enum {
     SERVICE_ID = 0x08
   };
 
   enum {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "BluetoothDaemonGattInterface.h"
-#include "BluetoothDaemonSetupInterface.h"
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 //
 // GATT module
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
@@ -12,18 +12,16 @@
 #include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using mozilla::ipc::DaemonSocketPDU;
 using mozilla::ipc::DaemonSocketPDUHeader;
 using mozilla::ipc::DaemonSocketResultHandler;
 
-class BluetoothSetupResultHandler;
-
 class BluetoothDaemonGattModule
 {
 public:
   enum {
     SERVICE_ID = 0x09
   };
 
   enum {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "BluetoothDaemonHandsfreeInterface.h"
-#include "BluetoothDaemonSetupInterface.h"
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 //
 // Handsfree module
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
@@ -12,18 +12,16 @@
 #include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using mozilla::ipc::DaemonSocketPDU;
 using mozilla::ipc::DaemonSocketPDUHeader;
 using mozilla::ipc::DaemonSocketResultHandler;
 
-class BluetoothSetupResultHandler;
-
 class BluetoothDaemonHandsfreeModule
 {
 public:
   enum {
     SERVICE_ID = 0x05
   };
 
   enum {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.cpp
@@ -4,37 +4,16 @@
  * 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/. */
 
 #include "BluetoothDaemonSetupInterface.h"
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
-BluetoothSetupResultHandler::~BluetoothSetupResultHandler()
-{ }
-
-void
-BluetoothSetupResultHandler::OnError(BluetoothStatus aStatus)
-{
-  BT_WARNING("Received error code %d", (int)aStatus);
-}
-
-void
-BluetoothSetupResultHandler::RegisterModule()
-{ }
-
-void
-BluetoothSetupResultHandler::UnregisterModule()
-{ }
-
-void
-BluetoothSetupResultHandler::Configuration()
-{ }
-
 //
 // Setup module
 //
 
 // Called to handle PDUs with Service field equal to 0x00, which
 // contains internal operations for setup and configuration.
 void
 BluetoothDaemonSetupModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.h
@@ -12,29 +12,16 @@
 #include "mozilla/ipc/DaemonRunnables.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using mozilla::ipc::DaemonSocketPDU;
 using mozilla::ipc::DaemonSocketPDUHeader;
 using mozilla::ipc::DaemonSocketResultHandler;
 
-class BluetoothSetupResultHandler
-  : public mozilla::ipc::DaemonSocketResultHandler
-{
-public:
-  virtual void OnError(BluetoothStatus aStatus);
-  virtual void RegisterModule();
-  virtual void UnregisterModule();
-  virtual void Configuration();
-
-protected:
-  virtual ~BluetoothSetupResultHandler();
-};
-
 class BluetoothDaemonSetupModule
 {
 public:
   virtual nsresult Send(DaemonSocketPDU* aPDU,
                         DaemonSocketResultHandler* aRes) = 0;
 
   // Commands
   //
--- a/dom/bluetooth/common/BluetoothInterface.cpp
+++ b/dom/bluetooth/common/BluetoothInterface.cpp
@@ -10,16 +10,41 @@
 #endif
 #ifdef MOZ_B2G_BT_DAEMON
 #include "BluetoothDaemonInterface.h"
 #endif
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
+// Setup Interface
+//
+
+BluetoothSetupResultHandler::~BluetoothSetupResultHandler()
+{ }
+
+void
+BluetoothSetupResultHandler::OnError(BluetoothStatus aStatus)
+{
+  BT_WARNING("Received error code %d", (int)aStatus);
+}
+
+void
+BluetoothSetupResultHandler::RegisterModule()
+{ }
+
+void
+BluetoothSetupResultHandler::UnregisterModule()
+{ }
+
+void
+BluetoothSetupResultHandler::Configuration()
+{ }
+
+//
 // Socket Interface
 //
 
 BluetoothSocketInterface::~BluetoothSocketInterface()
 { }
 
 //
 // Handsfree Interface
--- a/dom/bluetooth/common/BluetoothInterface.h
+++ b/dom/bluetooth/common/BluetoothInterface.h
@@ -9,16 +9,33 @@
 
 #include "BluetoothCommon.h"
 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
 #include "mozilla/ipc/DaemonSocketMessageHandlers.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
+// Setup Interface
+//
+
+class BluetoothSetupResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
+{
+public:
+  virtual void OnError(BluetoothStatus aStatus);
+  virtual void RegisterModule();
+  virtual void UnregisterModule();
+  virtual void Configuration();
+
+protected:
+  virtual ~BluetoothSetupResultHandler();
+};
+
+//
 // Socket Interface
 //
 
 class BluetoothSocketResultHandler
   : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
   virtual void OnError(BluetoothStatus aStatus)