Bug 1220121: Convert IPDL of Bluetooth OPP API to |BluetoothAddress|, r=btian
☠☠ backed out by 8c1d8b2eeb1c ☠ ☠
authorThomas Zimmermann <tdz@users.sourceforge.net>
Wed, 11 Nov 2015 11:14:39 +0100
changeset 308353 975e3b3d750400a32b16e27de8e530e31d395dd4
parent 308352 a7ea5f2e344419b0fd3a01210f9caeea7de6ba6c
child 308354 1ebe50bb4fada893aebe5a68337cfffd857d8002
push id7465
push usercku@mozilla.com
push dateThu, 12 Nov 2015 09:05:57 +0000
reviewersbtian
bugs1220121
milestone45.0a1
Bug 1220121: Convert IPDL of Bluetooth OPP API to |BluetoothAddress|, r=btian
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
dom/bluetooth/bluez/BluetoothDBusService.cpp
dom/bluetooth/bluez/BluetoothDBusService.h
dom/bluetooth/common/BluetoothService.h
dom/bluetooth/common/webapi/BluetoothAdapter.cpp
dom/bluetooth/ipc/BluetoothParent.cpp
dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
dom/bluetooth/ipc/BluetoothServiceChildProcess.h
dom/bluetooth/ipc/PBluetooth.ipdl
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -1521,75 +1521,61 @@ void
 BluetoothServiceBluedroid::Disconnect(
   const BluetoothAddress& aDeviceAddress, uint16_t aServiceUuid,
   BluetoothReplyRunnable* aRunnable)
 {
   ConnectDisconnect(false, aDeviceAddress, aRunnable, aServiceUuid);
 }
 
 void
-BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
+BluetoothServiceBluedroid::SendFile(const BluetoothAddress& aDeviceAddress,
                                     BlobParent* aBlobParent,
                                     BlobChild* aBlobChild,
                                     BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  BluetoothAddress deviceAddress;
-  nsresult rv = StringToAddress(aDeviceAddress, deviceAddress);
-  if (NS_FAILED(rv)) {
-    DispatchReplyError(aRunnable, STATUS_PARM_INVALID);
-    return;
-  }
-
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
 
   BluetoothOppManager* opp = BluetoothOppManager::Get();
-  if (!opp || !opp->SendFile(deviceAddress, aBlobParent)) {
+  if (!opp || !opp->SendFile(aDeviceAddress, aBlobParent)) {
     DispatchReplyError(aRunnable, NS_LITERAL_STRING("SendFile failed"));
     return;
   }
 
   DispatchReplySuccess(aRunnable);
 }
 
 void
-BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
+BluetoothServiceBluedroid::SendFile(const BluetoothAddress& aDeviceAddress,
                                     Blob* aBlob,
                                     BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  BluetoothAddress deviceAddress;
-  nsresult rv = StringToAddress(aDeviceAddress, deviceAddress);
-  if (NS_FAILED(rv)) {
-    DispatchReplyError(aRunnable, STATUS_PARM_INVALID);
-    return;
-  }
-
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
 
   BluetoothOppManager* opp = BluetoothOppManager::Get();
-  if (!opp || !opp->SendFile(deviceAddress, aBlob)) {
+  if (!opp || !opp->SendFile(aDeviceAddress, aBlob)) {
     DispatchReplyError(aRunnable, NS_LITERAL_STRING("SendFile failed"));
     return;
   }
 
   DispatchReplySuccess(aRunnable);
 }
 
 void
-BluetoothServiceBluedroid::StopSendingFile(const nsAString& aDeviceAddress,
-                                           BluetoothReplyRunnable* aRunnable)
+BluetoothServiceBluedroid::StopSendingFile(
+  const BluetoothAddress& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
 
@@ -1600,17 +1586,17 @@ BluetoothServiceBluedroid::StopSendingFi
     return;
   }
 
   DispatchReplySuccess(aRunnable);
 }
 
 void
 BluetoothServiceBluedroid::ConfirmReceivingFile(
-  const nsAString& aDeviceAddress, bool aConfirm,
+  const BluetoothAddress& aDeviceAddress, bool aConfirm,
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
@@ -116,32 +116,32 @@ public:
           uint16_t aServiceUuid,
           BluetoothReplyRunnable* aRunnable);
 
   virtual void
   Disconnect(const BluetoothAddress& aDeviceAddress, uint16_t aServiceUuid,
              BluetoothReplyRunnable* aRunnable);
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            BlobParent* aBlobParent,
            BlobChild* aBlobChild,
            BluetoothReplyRunnable* aRunnable);
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            Blob* aBlob,
            BluetoothReplyRunnable* aRunnable);
 
   virtual void
-  StopSendingFile(const nsAString& aDeviceAddress,
+  StopSendingFile(const BluetoothAddress& aDeviceAddress,
                   BluetoothReplyRunnable* aRunnable);
 
   virtual void
-  ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm,
+  ConfirmReceivingFile(const BluetoothAddress& aDeviceAddress, bool aConfirm,
                        BluetoothReplyRunnable* aRunnable);
 
   virtual void
   ConnectSco(BluetoothReplyRunnable* aRunnable);
 
   virtual void
   DisconnectSco(BluetoothReplyRunnable* aRunnable);
 
--- a/dom/bluetooth/bluez/BluetoothDBusService.cpp
+++ b/dom/bluetooth/bluez/BluetoothDBusService.cpp
@@ -3773,70 +3773,58 @@ BluetoothDBusService::UpdateSdpRecords(c
 
   Task* task = new UpdateSdpRecordsTask(aDeviceAddress, aManager);
   DispatchToDBusThread(task);
 
   return true;
 }
 
 void
-BluetoothDBusService::SendFile(const nsAString& aDeviceAddress,
+BluetoothDBusService::SendFile(const BluetoothAddress& aDeviceAddress,
                                BlobParent* aBlobParent,
                                BlobChild* aBlobChild,
                                BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  BluetoothAddress deviceAddress;
-  if (NS_FAILED(StringToAddress(aDeviceAddress, deviceAddress))) {
-    DispatchReplyError(aRunnable, STATUS_PARM_INVALID);
-    return;
-  }
-
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
   BluetoothOppManager* opp = BluetoothOppManager::Get();
   nsAutoString errorStr;
-  if (!opp || !opp->SendFile(deviceAddress, aBlobParent)) {
+  if (!opp || !opp->SendFile(aDeviceAddress, aBlobParent)) {
     errorStr.AssignLiteral("Calling SendFile() failed");
   }
 
   DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
 }
 
 void
-BluetoothDBusService::SendFile(const nsAString& aDeviceAddress,
+BluetoothDBusService::SendFile(const BluetoothAddress& aDeviceAddress,
                                Blob* aBlob,
                                BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  BluetoothAddress deviceAddress;
-  if (NS_FAILED(StringToAddress(aDeviceAddress, deviceAddress))) {
-    DispatchReplyError(aRunnable, STATUS_PARM_INVALID);
-    return;
-  }
-
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
   BluetoothOppManager* opp = BluetoothOppManager::Get();
   nsAutoString errorStr;
-  if (!opp || !opp->SendFile(deviceAddress, aBlob)) {
+  if (!opp || !opp->SendFile(aDeviceAddress, aBlob)) {
     errorStr.AssignLiteral("Calling SendFile() failed");
   }
 
   DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
 }
 
 void
-BluetoothDBusService::StopSendingFile(const nsAString& aDeviceAddress,
+BluetoothDBusService::StopSendingFile(const BluetoothAddress& aDeviceAddress,
                                       BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
@@ -3845,19 +3833,20 @@ BluetoothDBusService::StopSendingFile(co
   if (!opp || !opp->StopSendingFile()) {
     errorStr.AssignLiteral("Calling StopSendingFile() failed");
   }
 
   DispatchBluetoothReply(aRunnable, BluetoothValue(true), errorStr);
 }
 
 void
-BluetoothDBusService::ConfirmReceivingFile(const nsAString& aDeviceAddress,
-                                           bool aConfirm,
-                                           BluetoothReplyRunnable* aRunnable)
+BluetoothDBusService::ConfirmReceivingFile(
+  const BluetoothAddress& aDeviceAddress,
+  bool aConfirm,
+  BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be called from main thread!");
 
   // Currently we only support one device sending one file at a time,
   // so we don't need aDeviceAddress here because the target device
   // has been determined when calling 'Connect()'. Nevertheless, keep
   // it for future use.
   BluetoothOppManager* opp = BluetoothOppManager::Get();
--- a/dom/bluetooth/bluez/BluetoothDBusService.h
+++ b/dom/bluetooth/bluez/BluetoothDBusService.h
@@ -128,32 +128,32 @@ public:
           uint16_t aServiceUuid,
           BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
   Disconnect(const BluetoothAddress& aDeviceAddress, uint16_t aServiceUuid,
              BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            BlobParent* aBlobParent,
            BlobChild* aBlobChild,
            BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            Blob* aBlob,
            BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  StopSendingFile(const nsAString& aDeviceAddress,
+  StopSendingFile(const BluetoothAddress& aDeviceAddress,
                   BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm,
+  ConfirmReceivingFile(const BluetoothAddress& aDeviceAddress, bool aConfirm,
                        BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
   ConnectSco(BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
   DisconnectSco(BluetoothReplyRunnable* aRunnable) override;
 
--- a/dom/bluetooth/common/BluetoothService.h
+++ b/dom/bluetooth/common/BluetoothService.h
@@ -281,32 +281,32 @@ public:
           uint32_t aCod, uint16_t aServiceUuid,
           BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
   Disconnect(const BluetoothAddress& aDeviceAddress, uint16_t aServiceUuid,
              BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            BlobParent* aBlobParent,
            BlobChild* aBlobChild,
            BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            Blob* aBlob,
            BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
-  StopSendingFile(const nsAString& aDeviceAddress,
+  StopSendingFile(const BluetoothAddress& aDeviceAddress,
                   BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
-  ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm,
+  ConfirmReceivingFile(const BluetoothAddress& aDeviceAddress, bool aConfirm,
                        BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
   ConnectSco(BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual void
   DisconnectSco(BluetoothReplyRunnable* aRunnable) = 0;
 
--- a/dom/bluetooth/common/webapi/BluetoothAdapter.cpp
+++ b/dom/bluetooth/common/webapi/BluetoothAdapter.cpp
@@ -1743,39 +1743,46 @@ BluetoothAdapter::SendFile(const nsAStri
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   RefPtr<DOMRequest> request = new DOMRequest(win);
   RefPtr<BluetoothVoidReplyRunnable> results =
     new BluetoothVoidReplyRunnable(request);
 
+  BluetoothAddress deviceAddress;
+  auto rv = StringToAddress(aDeviceAddress, deviceAddress);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
+
   BluetoothService* bs = BluetoothService::Get();
   if (!bs) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   if (XRE_IsParentProcess()) {
     // In-process transfer
-    bs->SendFile(aDeviceAddress, &aBlob, results);
+    bs->SendFile(deviceAddress, &aBlob, results);
   } else {
     ContentChild *cc = ContentChild::GetSingleton();
     if (!cc) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
 
     BlobChild* actor = cc->GetOrCreateActorForBlob(&aBlob);
     if (!actor) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
 
-    bs->SendFile(aDeviceAddress, nullptr, actor, results);
+    bs->SendFile(deviceAddress, nullptr, actor, results);
   }
 
   return request.forget();
 }
 
 already_AddRefed<DOMRequest>
 BluetoothAdapter::StopSendingFile(
   const nsAString& aDeviceAddress, ErrorResult& aRv)
@@ -1785,22 +1792,29 @@ BluetoothAdapter::StopSendingFile(
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   RefPtr<DOMRequest> request = new DOMRequest(win);
   RefPtr<BluetoothVoidReplyRunnable> results =
     new BluetoothVoidReplyRunnable(request);
 
+  BluetoothAddress deviceAddress;
+  auto rv = StringToAddress(aDeviceAddress, deviceAddress);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
+
   BluetoothService* bs = BluetoothService::Get();
   if (!bs) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
-  bs->StopSendingFile(aDeviceAddress, results);
+  bs->StopSendingFile(deviceAddress, results);
 
   return request.forget();
 }
 
 already_AddRefed<DOMRequest>
 BluetoothAdapter::ConfirmReceivingFile(const nsAString& aDeviceAddress,
                                        bool aConfirmation, ErrorResult& aRv)
 {
@@ -1809,22 +1823,29 @@ BluetoothAdapter::ConfirmReceivingFile(c
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   RefPtr<DOMRequest> request = new DOMRequest(win);
   RefPtr<BluetoothVoidReplyRunnable> results =
     new BluetoothVoidReplyRunnable(request);
 
+  BluetoothAddress deviceAddress;
+  auto rv = StringToAddress(aDeviceAddress, deviceAddress);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+    return nullptr;
+  }
+
   BluetoothService* bs = BluetoothService::Get();
   if (!bs) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
-  bs->ConfirmReceivingFile(aDeviceAddress, aConfirmation, results);
+  bs->ConfirmReceivingFile(deviceAddress, aConfirmation, results);
 
   return request.forget();
 }
 
 already_AddRefed<DOMRequest>
 BluetoothAdapter::ConnectSco(ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> win = GetOwner();
--- a/dom/bluetooth/ipc/BluetoothParent.cpp
+++ b/dom/bluetooth/ipc/BluetoothParent.cpp
@@ -675,55 +675,55 @@ BluetoothRequestParent::DoRequest(const 
 }
 
 bool
 BluetoothRequestParent::DoRequest(const SendFileRequest& aRequest)
 {
   MOZ_ASSERT(mService);
   MOZ_ASSERT(mRequestType == Request::TSendFileRequest);
 
-  mService->SendFile(aRequest.devicePath(),
+  mService->SendFile(aRequest.address(),
                      (BlobParent*)aRequest.blobParent(),
                      (BlobChild*)aRequest.blobChild(),
                      mReplyRunnable.get());
 
   return true;
 }
 
 bool
 BluetoothRequestParent::DoRequest(const StopSendingFileRequest& aRequest)
 {
   MOZ_ASSERT(mService);
   MOZ_ASSERT(mRequestType == Request::TStopSendingFileRequest);
 
-  mService->StopSendingFile(aRequest.devicePath(),
+  mService->StopSendingFile(aRequest.address(),
                             mReplyRunnable.get());
 
   return true;
 }
 
 bool
 BluetoothRequestParent::DoRequest(const ConfirmReceivingFileRequest& aRequest)
 {
   MOZ_ASSERT(mService);
   MOZ_ASSERT(mRequestType == Request::TConfirmReceivingFileRequest);
 
-  mService->ConfirmReceivingFile(aRequest.devicePath(),
+  mService->ConfirmReceivingFile(aRequest.address(),
                                  true,
                                  mReplyRunnable.get());
   return true;
 }
 
 bool
 BluetoothRequestParent::DoRequest(const DenyReceivingFileRequest& aRequest)
 {
   MOZ_ASSERT(mService);
   MOZ_ASSERT(mRequestType == Request::TDenyReceivingFileRequest);
 
-  mService->ConfirmReceivingFile(aRequest.devicePath(),
+  mService->ConfirmReceivingFile(aRequest.address(),
                                  false,
                                  mReplyRunnable.get());
   return true;
 }
 
 bool
 BluetoothRequestParent::DoRequest(const ConnectScoRequest& aRequest)
 {
--- a/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
+++ b/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
@@ -281,58 +281,53 @@ BluetoothServiceChildProcess::Disconnect
   uint16_t aServiceUuid,
   BluetoothReplyRunnable* aRunnable)
 {
   SendRequest(aRunnable, DisconnectRequest(aDeviceAddress, aServiceUuid));
 }
 
 void
 BluetoothServiceChildProcess::SendFile(
-  const nsAString& aDeviceAddress,
+  const BluetoothAddress& aDeviceAddress,
   BlobParent* aBlobParent,
   BlobChild* aBlobChild,
   BluetoothReplyRunnable* aRunnable)
 {
-  SendRequest(aRunnable,
-              SendFileRequest(nsString(aDeviceAddress), nullptr, aBlobChild));
+  SendRequest(aRunnable, SendFileRequest(aDeviceAddress, nullptr, aBlobChild));
 }
 
 void
 BluetoothServiceChildProcess::SendFile(
-  const nsAString& aDeviceAddress,
+  const BluetoothAddress& aDeviceAddress,
   Blob* aBlobChild,
   BluetoothReplyRunnable* aRunnable)
 {
   // Parent-process-only method
   MOZ_CRASH("This should never be called!");
 }
 
 void
 BluetoothServiceChildProcess::StopSendingFile(
-  const nsAString& aDeviceAddress,
+  const BluetoothAddress& aDeviceAddress,
   BluetoothReplyRunnable* aRunnable)
 {
-  SendRequest(aRunnable,
-              StopSendingFileRequest(nsString(aDeviceAddress)));
+  SendRequest(aRunnable, StopSendingFileRequest(aDeviceAddress));
 }
 
 void
 BluetoothServiceChildProcess::ConfirmReceivingFile(
-  const nsAString& aDeviceAddress,
-  bool aConfirm,
+  const BluetoothAddress& aDeviceAddress, bool aConfirm,
   BluetoothReplyRunnable* aRunnable)
 {
   if(aConfirm) {
-    SendRequest(aRunnable,
-                ConfirmReceivingFileRequest(nsString(aDeviceAddress)));
+    SendRequest(aRunnable, ConfirmReceivingFileRequest(aDeviceAddress));
     return;
   }
 
-  SendRequest(aRunnable,
-              DenyReceivingFileRequest(nsString(aDeviceAddress)));
+  SendRequest(aRunnable, DenyReceivingFileRequest(aDeviceAddress));
 }
 
 void
 BluetoothServiceChildProcess::ConnectSco(BluetoothReplyRunnable* aRunnable)
 {
   SendRequest(aRunnable, ConnectScoRequest());
 }
 
--- a/dom/bluetooth/ipc/BluetoothServiceChildProcess.h
+++ b/dom/bluetooth/ipc/BluetoothServiceChildProcess.h
@@ -125,32 +125,32 @@ public:
           BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
   Disconnect(const BluetoothAddress& aDeviceAddress,
              uint16_t aServiceUuid,
              BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            BlobParent* aBlobParent,
            BlobChild* aBlobChild,
            BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  SendFile(const nsAString& aDeviceAddress,
+  SendFile(const BluetoothAddress& aDeviceAddress,
            Blob* aBlob,
            BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  StopSendingFile(const nsAString& aDeviceAddress,
+  StopSendingFile(const BluetoothAddress& aDeviceAddress,
                   BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
-  ConfirmReceivingFile(const nsAString& aDeviceAddress,
+  ConfirmReceivingFile(const BluetoothAddress& aDeviceAddress,
                        bool aConfirm,
                        BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
   ConnectSco(BluetoothReplyRunnable* aRunnable) override;
 
   virtual void
   DisconnectSco(BluetoothReplyRunnable* aRunnable) override;
--- a/dom/bluetooth/ipc/PBluetooth.ipdl
+++ b/dom/bluetooth/ipc/PBluetooth.ipdl
@@ -140,33 +140,33 @@ struct ConnectRequest
 struct DisconnectRequest
 {
   BluetoothAddress address;
   uint16_t serviceUuid;
 };
 
 struct SendFileRequest
 {
-  nsString devicePath;
+  BluetoothAddress address;
   PBlob blob;
 };
 
 struct StopSendingFileRequest
 {
-  nsString devicePath;
+  BluetoothAddress address;
 };
 
 struct ConfirmReceivingFileRequest
 {
-  nsString devicePath;
+  BluetoothAddress address;
 };
 
 struct DenyReceivingFileRequest
 {
-  nsString devicePath;
+  BluetoothAddress address;
 };
 
 struct ConnectScoRequest
 {
 };
 
 struct DisconnectScoRequest
 {