mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 876823 - Fire DOMRequest.onerror event when Bluetooth*Manager.Connect() fails, r=gyeh
This commit is contained in:
parent
8311a912cc
commit
ba5153a179
@ -1026,15 +1026,22 @@ BluetoothHfpManager::Connect(const nsAString& aDeviceAddress,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
NS_ENSURE_FALSE_VOID(gInShutdown);
|
BluetoothService* bs = BluetoothService::Get();
|
||||||
NS_ENSURE_FALSE_VOID(mSocket);
|
if (!bs || gInShutdown) {
|
||||||
|
DispatchBluetoothReply(aRunnable, BluetoothValue(),
|
||||||
|
NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mSocket) {
|
||||||
|
DispatchBluetoothReply(aRunnable, BluetoothValue(),
|
||||||
|
NS_LITERAL_STRING(ERR_REACHED_CONNECTION_LIMIT));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mNeedsUpdatingSdpRecords = true;
|
mNeedsUpdatingSdpRecords = true;
|
||||||
mIsHandsfree = aIsHandsfree;
|
mIsHandsfree = aIsHandsfree;
|
||||||
|
|
||||||
BluetoothService* bs = BluetoothService::Get();
|
|
||||||
NS_ENSURE_TRUE_VOID(bs);
|
|
||||||
|
|
||||||
nsString uuid;
|
nsString uuid;
|
||||||
if (aIsHandsfree) {
|
if (aIsHandsfree) {
|
||||||
BluetoothUuidHelper::GetString(BluetoothServiceClass::HANDSFREE, uuid);
|
BluetoothUuidHelper::GetString(BluetoothServiceClass::HANDSFREE, uuid);
|
||||||
|
@ -257,10 +257,18 @@ BluetoothOppManager::Connect(const nsAString& aDeviceAddress,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
NS_ENSURE_FALSE_VOID(mSocket);
|
|
||||||
|
|
||||||
BluetoothService* bs = BluetoothService::Get();
|
BluetoothService* bs = BluetoothService::Get();
|
||||||
NS_ENSURE_TRUE_VOID(bs);
|
if (!bs || sInShutdown) {
|
||||||
|
DispatchBluetoothReply(aRunnable, BluetoothValue(),
|
||||||
|
NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mSocket) {
|
||||||
|
DispatchBluetoothReply(aRunnable, BluetoothValue(),
|
||||||
|
NS_LITERAL_STRING(ERR_REACHED_CONNECTION_LIMIT));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mNeedsUpdatingSdpRecords = true;
|
mNeedsUpdatingSdpRecords = true;
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#define mozilla_dom_bluetooth_bluetoothprofilemanagerbase_h__
|
#define mozilla_dom_bluetooth_bluetoothprofilemanagerbase_h__
|
||||||
|
|
||||||
#define ERR_SERVICE_CHANNEL_NOT_FOUND "DeviceChannelRetrievalError"
|
#define ERR_SERVICE_CHANNEL_NOT_FOUND "DeviceChannelRetrievalError"
|
||||||
|
#define ERR_REACHED_CONNECTION_LIMIT "ReachedConnectionLimitError"
|
||||||
|
#define ERR_NO_AVAILABLE_RESOURCE "NoAvailableResourceError"
|
||||||
|
|
||||||
#include "BluetoothCommon.h"
|
#include "BluetoothCommon.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user