Loading dom/bluetooth/ipc/BluetoothParent.cpp +52 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,14 @@ BluetoothParent::RecvPBluetoothRequestConstructor( return actor->DoRequest(aRequest.get_DenyPairingConfirmationRequest()); case Request::TDenyAuthorizationRequest: return actor->DoRequest(aRequest.get_DenyAuthorizationRequest()); case Request::TConnectHeadsetRequest: return actor->DoRequest(aRequest.get_ConnectHeadsetRequest()); case Request::TConnectObjectPushRequest: return actor->DoRequest(aRequest.get_ConnectObjectPushRequest()); case Request::TDisconnectHeadsetRequest: return actor->DoRequest(aRequest.get_DisconnectHeadsetRequest()); case Request::TDisconnectObjectPushRequest: return actor->DoRequest(aRequest.get_DisconnectObjectPushRequest()); default: MOZ_NOT_REACHED("Unknown type!"); return false; Loading Loading @@ -486,3 +494,47 @@ BluetoothRequestParent::DoRequest(const DenyAuthorizationRequest& aRequest) return true; } bool BluetoothRequestParent::DoRequest(const ConnectHeadsetRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TConnectHeadsetRequest); return mService->ConnectHeadset(aRequest.address(), aRequest.adapterPath(), mReplyRunnable.get()); } bool BluetoothRequestParent::DoRequest(const ConnectObjectPushRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TConnectObjectPushRequest); return mService->ConnectObjectPush(aRequest.address(), aRequest.adapterPath(), mReplyRunnable.get()); } bool BluetoothRequestParent::DoRequest(const DisconnectHeadsetRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TDisconnectHeadsetRequest); mService->DisconnectHeadset(mReplyRunnable.get()); return true; } bool BluetoothRequestParent::DoRequest(const DisconnectObjectPushRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TDenyAuthorizationRequest); mService->DisconnectObjectPush(mReplyRunnable.get()); return true; } dom/bluetooth/ipc/BluetoothParent.h +12 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,18 @@ protected: bool DoRequest(const DenyAuthorizationRequest& aRequest); bool DoRequest(const ConnectHeadsetRequest& aRequest); bool DoRequest(const ConnectObjectPushRequest& aRequest); bool DoRequest(const DisconnectHeadsetRequest& aRequest); bool DoRequest(const DisconnectObjectPushRequest& aRequest); }; END_BLUETOOTH_NAMESPACE Loading dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -293,6 +293,10 @@ BluetoothServiceChildProcess::ConnectHeadset( const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { SendRequest(aRunnable, ConnectHeadsetRequest(nsString(aDeviceAddress), nsString(aAdapterPath))); return true; } Loading @@ -300,7 +304,7 @@ void BluetoothServiceChildProcess::DisconnectHeadset( BluetoothReplyRunnable* aRunnable) { return; SendRequest(aRunnable, DisconnectHeadsetRequest()); } bool Loading @@ -309,6 +313,9 @@ BluetoothServiceChildProcess::ConnectObjectPush( const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { SendRequest(aRunnable, ConnectObjectPushRequest(nsString(aDeviceAddress), nsString(aAdapterPath))); return true; } Loading @@ -316,7 +323,7 @@ void BluetoothServiceChildProcess::DisconnectObjectPush( BluetoothReplyRunnable* aRunnable) { return; SendRequest(aRunnable, DisconnectObjectPushRequest()); } nsresult Loading dom/bluetooth/ipc/PBluetooth.ipdl +22 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,24 @@ struct DevicePropertiesRequest nsString[] addresses; }; struct ConnectHeadsetRequest { nsString address; nsString adapterPath; }; struct ConnectObjectPushRequest { nsString address; nsString adapterPath; }; struct DisconnectHeadsetRequest {}; struct DisconnectObjectPushRequest {}; union Request { DefaultAdapterPathRequest; Loading @@ -113,6 +131,10 @@ union Request ConfirmAuthorizationRequest; DenyAuthorizationRequest; DevicePropertiesRequest; ConnectHeadsetRequest; ConnectObjectPushRequest; DisconnectHeadsetRequest; DisconnectObjectPushRequest; }; protocol PBluetooth Loading dom/bluetooth/linux/BluetoothDBusService.cpp +26 −5 Original line number Diff line number Diff line Loading @@ -19,9 +19,10 @@ #include "base/basictypes.h" #include "BluetoothDBusService.h" #include "BluetoothHfpManager.h" #include "BluetoothOppManager.h" #include "BluetoothReplyRunnable.h" #include "BluetoothScoManager.h" #include "BluetoothServiceUuid.h" #include "BluetoothReplyRunnable.h" #include "BluetoothUnixSocketConnector.h" #include <cstdio> Loading Loading @@ -2203,13 +2204,23 @@ BluetoothDBusService::ConnectHeadset(const nsAString& aDeviceAddress, const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { return true; BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); return hfp->Connect(GetObjectPathFromAddress(aAdapterPath, aDeviceAddress), aRunnable); } void BluetoothDBusService::DisconnectHeadset(BluetoothReplyRunnable* aRunnable) { return; BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); hfp->Disconnect(); // Currently, just fire success because Disconnect() doesn't fail, // but we still make aRunnable pass into this function for future // once Disconnect will fail. nsString replyError; BluetoothValue v = true; DispatchBluetoothReply(aRunnable, v, replyError); } bool Loading @@ -2217,13 +2228,23 @@ BluetoothDBusService::ConnectObjectPush(const nsAString& aDeviceAddress, const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { return true; BluetoothOppManager* opp = BluetoothOppManager::Get(); return opp->Connect(GetObjectPathFromAddress(aAdapterPath, aDeviceAddress), aRunnable); } void BluetoothDBusService::DisconnectObjectPush(BluetoothReplyRunnable* aRunnable) { return; BluetoothOppManager* opp = BluetoothOppManager::Get(); opp->Disconnect(); // Currently, just fire success because Disconnect() doesn't fail, // but we still make aRunnable pass into this function for future // once Disconnect will fail. nsString replyError; BluetoothValue v = true; DispatchBluetoothReply(aRunnable, v, replyError); } class CreateBluetoothScoSocket : public nsRunnable { Loading Loading
dom/bluetooth/ipc/BluetoothParent.cpp +52 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,14 @@ BluetoothParent::RecvPBluetoothRequestConstructor( return actor->DoRequest(aRequest.get_DenyPairingConfirmationRequest()); case Request::TDenyAuthorizationRequest: return actor->DoRequest(aRequest.get_DenyAuthorizationRequest()); case Request::TConnectHeadsetRequest: return actor->DoRequest(aRequest.get_ConnectHeadsetRequest()); case Request::TConnectObjectPushRequest: return actor->DoRequest(aRequest.get_ConnectObjectPushRequest()); case Request::TDisconnectHeadsetRequest: return actor->DoRequest(aRequest.get_DisconnectHeadsetRequest()); case Request::TDisconnectObjectPushRequest: return actor->DoRequest(aRequest.get_DisconnectObjectPushRequest()); default: MOZ_NOT_REACHED("Unknown type!"); return false; Loading Loading @@ -486,3 +494,47 @@ BluetoothRequestParent::DoRequest(const DenyAuthorizationRequest& aRequest) return true; } bool BluetoothRequestParent::DoRequest(const ConnectHeadsetRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TConnectHeadsetRequest); return mService->ConnectHeadset(aRequest.address(), aRequest.adapterPath(), mReplyRunnable.get()); } bool BluetoothRequestParent::DoRequest(const ConnectObjectPushRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TConnectObjectPushRequest); return mService->ConnectObjectPush(aRequest.address(), aRequest.adapterPath(), mReplyRunnable.get()); } bool BluetoothRequestParent::DoRequest(const DisconnectHeadsetRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TDisconnectHeadsetRequest); mService->DisconnectHeadset(mReplyRunnable.get()); return true; } bool BluetoothRequestParent::DoRequest(const DisconnectObjectPushRequest& aRequest) { MOZ_ASSERT(mService); MOZ_ASSERT(mRequestType == Request::TDenyAuthorizationRequest); mService->DisconnectObjectPush(mReplyRunnable.get()); return true; }
dom/bluetooth/ipc/BluetoothParent.h +12 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,18 @@ protected: bool DoRequest(const DenyAuthorizationRequest& aRequest); bool DoRequest(const ConnectHeadsetRequest& aRequest); bool DoRequest(const ConnectObjectPushRequest& aRequest); bool DoRequest(const DisconnectHeadsetRequest& aRequest); bool DoRequest(const DisconnectObjectPushRequest& aRequest); }; END_BLUETOOTH_NAMESPACE Loading
dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -293,6 +293,10 @@ BluetoothServiceChildProcess::ConnectHeadset( const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { SendRequest(aRunnable, ConnectHeadsetRequest(nsString(aDeviceAddress), nsString(aAdapterPath))); return true; } Loading @@ -300,7 +304,7 @@ void BluetoothServiceChildProcess::DisconnectHeadset( BluetoothReplyRunnable* aRunnable) { return; SendRequest(aRunnable, DisconnectHeadsetRequest()); } bool Loading @@ -309,6 +313,9 @@ BluetoothServiceChildProcess::ConnectObjectPush( const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { SendRequest(aRunnable, ConnectObjectPushRequest(nsString(aDeviceAddress), nsString(aAdapterPath))); return true; } Loading @@ -316,7 +323,7 @@ void BluetoothServiceChildProcess::DisconnectObjectPush( BluetoothReplyRunnable* aRunnable) { return; SendRequest(aRunnable, DisconnectObjectPushRequest()); } nsresult Loading
dom/bluetooth/ipc/PBluetooth.ipdl +22 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,24 @@ struct DevicePropertiesRequest nsString[] addresses; }; struct ConnectHeadsetRequest { nsString address; nsString adapterPath; }; struct ConnectObjectPushRequest { nsString address; nsString adapterPath; }; struct DisconnectHeadsetRequest {}; struct DisconnectObjectPushRequest {}; union Request { DefaultAdapterPathRequest; Loading @@ -113,6 +131,10 @@ union Request ConfirmAuthorizationRequest; DenyAuthorizationRequest; DevicePropertiesRequest; ConnectHeadsetRequest; ConnectObjectPushRequest; DisconnectHeadsetRequest; DisconnectObjectPushRequest; }; protocol PBluetooth Loading
dom/bluetooth/linux/BluetoothDBusService.cpp +26 −5 Original line number Diff line number Diff line Loading @@ -19,9 +19,10 @@ #include "base/basictypes.h" #include "BluetoothDBusService.h" #include "BluetoothHfpManager.h" #include "BluetoothOppManager.h" #include "BluetoothReplyRunnable.h" #include "BluetoothScoManager.h" #include "BluetoothServiceUuid.h" #include "BluetoothReplyRunnable.h" #include "BluetoothUnixSocketConnector.h" #include <cstdio> Loading Loading @@ -2203,13 +2204,23 @@ BluetoothDBusService::ConnectHeadset(const nsAString& aDeviceAddress, const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { return true; BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); return hfp->Connect(GetObjectPathFromAddress(aAdapterPath, aDeviceAddress), aRunnable); } void BluetoothDBusService::DisconnectHeadset(BluetoothReplyRunnable* aRunnable) { return; BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); hfp->Disconnect(); // Currently, just fire success because Disconnect() doesn't fail, // but we still make aRunnable pass into this function for future // once Disconnect will fail. nsString replyError; BluetoothValue v = true; DispatchBluetoothReply(aRunnable, v, replyError); } bool Loading @@ -2217,13 +2228,23 @@ BluetoothDBusService::ConnectObjectPush(const nsAString& aDeviceAddress, const nsAString& aAdapterPath, BluetoothReplyRunnable* aRunnable) { return true; BluetoothOppManager* opp = BluetoothOppManager::Get(); return opp->Connect(GetObjectPathFromAddress(aAdapterPath, aDeviceAddress), aRunnable); } void BluetoothDBusService::DisconnectObjectPush(BluetoothReplyRunnable* aRunnable) { return; BluetoothOppManager* opp = BluetoothOppManager::Get(); opp->Disconnect(); // Currently, just fire success because Disconnect() doesn't fail, // but we still make aRunnable pass into this function for future // once Disconnect will fail. nsString replyError; BluetoothValue v = true; DispatchBluetoothReply(aRunnable, v, replyError); } class CreateBluetoothScoSocket : public nsRunnable { Loading