mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changesets d9cbdfbed1f5 and a38ad201299f (bug 929376) for bustage.
This commit is contained in:
parent
c55dee3ae2
commit
7d024f80ba
@ -123,10 +123,10 @@ private:
|
||||
nsRefPtr<BluetoothAdapter> mAdapterPtr;
|
||||
};
|
||||
|
||||
class GetConnectionStatusTask : public BluetoothReplyRunnable
|
||||
class GetScoConnectionStatusTask : public BluetoothReplyRunnable
|
||||
{
|
||||
public:
|
||||
GetConnectionStatusTask(nsIDOMDOMRequest* aReq) :
|
||||
GetScoConnectionStatusTask(nsIDOMDOMRequest* aReq) :
|
||||
BluetoothReplyRunnable(aReq)
|
||||
{
|
||||
MOZ_ASSERT(aReq);
|
||||
@ -683,7 +683,7 @@ BluetoothAdapter::SetPairingConfirmation(const nsAString& aDeviceAddress,
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::Connect(BluetoothDevice& aDevice,
|
||||
const Optional<uint16_t>& aServiceUuid,
|
||||
const Optional<short unsigned int>& aServiceUuid,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
|
||||
@ -716,7 +716,7 @@ BluetoothAdapter::Connect(BluetoothDevice& aDevice,
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::Disconnect(BluetoothDevice& aDevice,
|
||||
const Optional<uint16_t>& aServiceUuid,
|
||||
const Optional<short unsigned int>& aServiceUuid,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
|
||||
@ -746,29 +746,6 @@ BluetoothAdapter::Disconnect(BluetoothDevice& aDevice,
|
||||
return request.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::IsConnected(const uint16_t aServiceUuid, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
|
||||
if (!win) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<DOMRequest> request = new DOMRequest(win);
|
||||
nsRefPtr<BluetoothReplyRunnable> results =
|
||||
new GetConnectionStatusTask(request);
|
||||
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
bs->IsConnected(aServiceUuid, results);
|
||||
|
||||
return request.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
BluetoothAdapter::SendFile(const nsAString& aDeviceAddress,
|
||||
nsIDOMBlob* aBlob, ErrorResult& aRv)
|
||||
@ -915,7 +892,7 @@ BluetoothAdapter::IsScoConnected(ErrorResult& aRv)
|
||||
|
||||
nsRefPtr<DOMRequest> request = new DOMRequest(win);
|
||||
nsRefPtr<BluetoothReplyRunnable> results =
|
||||
new GetConnectionStatusTask(request);
|
||||
new GetScoConnectionStatusTask(request);
|
||||
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
|
@ -119,16 +119,11 @@ public:
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
Connect(BluetoothDevice& aDevice,
|
||||
const Optional<uint16_t>& aServiceUuid, ErrorResult& aRv);
|
||||
const Optional<short unsigned int>& aServiceUuid, ErrorResult& aRv);
|
||||
already_AddRefed<DOMRequest>
|
||||
Disconnect(BluetoothDevice& aDevice,
|
||||
const Optional<uint16_t>& aServiceUuid,
|
||||
const Optional<short unsigned int>& aServiceUuid,
|
||||
ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
IsConnected(const uint16_t aServiceUuid,
|
||||
ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<DOMRequest>
|
||||
GetConnectedDevices(uint16_t aServiceUuid, ErrorResult& aRv);
|
||||
|
||||
|
@ -210,6 +210,18 @@ BluetoothManager::Notify(const BluetoothSignal& aData)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothManager::IsConnected(uint16_t aProfileId, ErrorResult& aRv)
|
||||
{
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
if (!bs) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return false;
|
||||
}
|
||||
|
||||
return bs->IsConnected(aProfileId);
|
||||
}
|
||||
|
||||
JSObject*
|
||||
BluetoothManager::WrapObject(JSContext* aCx)
|
||||
{
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) MOZ_OVERRIDE;
|
||||
|
||||
bool GetEnabled(ErrorResult& aRv);
|
||||
bool IsConnected(uint16_t aProfileId, ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<DOMRequest> GetDefaultAdapter(ErrorResult& aRv);
|
||||
|
||||
|
@ -229,8 +229,8 @@ public:
|
||||
Disconnect(const nsAString& aDeviceAddress, uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual void
|
||||
IsConnected(const uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable) = 0;
|
||||
virtual bool
|
||||
IsConnected(uint16_t aServiceUuid) = 0;
|
||||
|
||||
virtual void
|
||||
SendFile(const nsAString& aDeviceAddress,
|
||||
|
@ -1018,23 +1018,6 @@ BluetoothServiceBluedroid::Disconnect(
|
||||
ConnectDisconnect(false, aDeviceAddress, aRunnable, aServiceUuid);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceBluedroid::IsConnected(const uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aRunnable);
|
||||
|
||||
BluetoothProfileManagerBase* profile =
|
||||
BluetoothUuidHelper::GetBluetoothProfileManager(aServiceUuid);
|
||||
if (profile) {
|
||||
DispatchBluetoothReply(aRunnable, profile->IsConnected(), EmptyString());
|
||||
} else {
|
||||
BT_WARNING("Can't find profile manager with uuid: %x", aServiceUuid);
|
||||
DispatchBluetoothReply(aRunnable, false, EmptyString());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceBluedroid::SendFile(const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
|
@ -84,14 +84,13 @@ public:
|
||||
uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual bool
|
||||
IsConnected(uint16_t aProfileId);
|
||||
|
||||
virtual void
|
||||
Disconnect(const nsAString& aDeviceAddress, uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual void
|
||||
IsConnected(const uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
SendFile(const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
|
@ -3457,21 +3457,20 @@ BluetoothDBusService::Disconnect(const nsAString& aDeviceAddress,
|
||||
ConnectDisconnect(false, aDeviceAddress, aRunnable, aServiceUuid);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDBusService::IsConnected(const uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
bool
|
||||
BluetoothDBusService::IsConnected(const uint16_t aServiceUuid)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aRunnable);
|
||||
|
||||
BluetoothProfileManagerBase* profile =
|
||||
BluetoothUuidHelper::GetBluetoothProfileManager(aServiceUuid);
|
||||
if (profile) {
|
||||
DispatchBluetoothReply(aRunnable, profile->IsConnected(), EmptyString());
|
||||
} else {
|
||||
BT_WARNING("Can't find profile manager with uuid: %x", aServiceUuid);
|
||||
DispatchBluetoothReply(aRunnable, false, EmptyString());
|
||||
if (!profile) {
|
||||
BT_WARNING(ERR_UNKNOWN_PROFILE);
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(profile, false);
|
||||
return profile->IsConnected();
|
||||
}
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
|
@ -106,9 +106,8 @@ public:
|
||||
uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
IsConnected(const uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
virtual bool
|
||||
IsConnected(uint16_t aServiceUuid) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
Disconnect(const nsAString& aDeviceAddress, uint16_t aServiceUuid,
|
||||
|
@ -218,8 +218,6 @@ BluetoothParent::RecvPBluetoothRequestConstructor(
|
||||
return actor->DoRequest(aRequest.get_ConnectRequest());
|
||||
case Request::TDisconnectRequest:
|
||||
return actor->DoRequest(aRequest.get_DisconnectRequest());
|
||||
case Request::TIsConnectedRequest:
|
||||
return actor->DoRequest(aRequest.get_IsConnectedRequest());
|
||||
case Request::TSendFileRequest:
|
||||
return actor->DoRequest(aRequest.get_SendFileRequest());
|
||||
case Request::TStopSendingFileRequest:
|
||||
@ -511,18 +509,6 @@ BluetoothRequestParent::DoRequest(const DisconnectRequest& aRequest)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothRequestParent::DoRequest(const IsConnectedRequest& aRequest)
|
||||
{
|
||||
MOZ_ASSERT(mService);
|
||||
MOZ_ASSERT(mRequestType == Request::TIsConnectedRequest);
|
||||
|
||||
mService->IsConnected(aRequest.serviceUuid(),
|
||||
mReplyRunnable.get());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothRequestParent::DoRequest(const SendFileRequest& aRequest)
|
||||
{
|
||||
|
@ -169,9 +169,6 @@ protected:
|
||||
bool
|
||||
DoRequest(const DisconnectRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const IsConnectedRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const SendFileRequest& aRequest);
|
||||
|
||||
|
@ -245,14 +245,6 @@ BluetoothServiceChildProcess::Disconnect(
|
||||
DisconnectRequest(nsString(aDeviceAddress), aServiceUuid));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceChildProcess::IsConnected(
|
||||
const uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
SendRequest(aRunnable, IsConnectedRequest(aServiceUuid));
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothServiceChildProcess::SendFile(
|
||||
const nsAString& aDeviceAddress,
|
||||
@ -397,6 +389,12 @@ BluetoothServiceChildProcess::StopInternal()
|
||||
MOZ_CRASH("This should never be called!");
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothServiceChildProcess::IsConnected(uint16_t aServiceUuid)
|
||||
{
|
||||
MOZ_CRASH("This should never be called!");
|
||||
}
|
||||
|
||||
nsresult
|
||||
BluetoothServiceChildProcess::SendSinkMessage(const nsAString& aDeviceAddresses,
|
||||
const nsAString& aMessage)
|
||||
|
@ -111,9 +111,8 @@ public:
|
||||
uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
IsConnected(const uint16_t aServiceUuid,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
virtual bool
|
||||
IsConnected(uint16_t aServiceUuid) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
SendFile(const nsAString& aDeviceAddress,
|
||||
|
@ -101,11 +101,6 @@ struct DisconnectRequest
|
||||
uint16_t serviceUuid;
|
||||
};
|
||||
|
||||
struct IsConnectedRequest
|
||||
{
|
||||
uint16_t serviceUuid;
|
||||
};
|
||||
|
||||
struct SendFileRequest
|
||||
{
|
||||
nsString devicePath;
|
||||
@ -185,7 +180,6 @@ union Request
|
||||
PairedDevicePropertiesRequest;
|
||||
ConnectRequest;
|
||||
DisconnectRequest;
|
||||
IsConnectedRequest;
|
||||
SendFileRequest;
|
||||
StopSendingFileRequest;
|
||||
ConfirmReceivingFileRequest;
|
||||
|
@ -117,9 +117,6 @@ interface BluetoothAdapter : EventTarget {
|
||||
[NewObject, Throws]
|
||||
DOMRequest disconnect(BluetoothDevice device, optional unsigned short serviceUuid);
|
||||
|
||||
[NewObject, Throws]
|
||||
DOMRequest isConnected(unsigned short serviceUuid);
|
||||
|
||||
// One device can only send one file at a time
|
||||
[NewObject, Throws]
|
||||
DOMRequest sendFile(DOMString deviceAddress, Blob blob);
|
||||
|
@ -12,6 +12,8 @@ interface BluetoothManager : EventTarget {
|
||||
attribute EventHandler ondisabled;
|
||||
attribute EventHandler onadapteradded;
|
||||
|
||||
[Throws]
|
||||
boolean isConnected(unsigned short aProfile);
|
||||
[NewObject, Throws]
|
||||
DOMRequest? getDefaultAdapter();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user