mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 805724 - patch 4: fire dom request events after calling OPP related functions, r=qdot
This commit is contained in:
parent
92f04e9b2b
commit
17cd9f8f35
@ -253,8 +253,7 @@ BluetoothOppManager::Listen()
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothOppManager::SendFile(BlobParent* aActor,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
BluetoothOppManager::SendFile(BlobParent* aActor)
|
||||
{
|
||||
if (mBlob) {
|
||||
// Means there's a sending process. Reply error.
|
||||
@ -275,20 +274,19 @@ BluetoothOppManager::SendFile(BlobParent* aActor,
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothOppManager::StopSendingFile(BluetoothReplyRunnable* aRunnable)
|
||||
BluetoothOppManager::StopSendingFile()
|
||||
{
|
||||
mAbortFlag = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothOppManager::ConfirmReceivingFile(bool aConfirm,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
bool
|
||||
BluetoothOppManager::ConfirmReceivingFile(bool aConfirm)
|
||||
{
|
||||
if (!mWaitingForConfirmationFlag) {
|
||||
NS_WARNING("We are not waiting for a confirmation now.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_ASSERTION(mPacketLeftLength == 0,
|
||||
@ -307,6 +305,8 @@ BluetoothOppManager::ConfirmReceivingFile(bool aConfirm,
|
||||
FileTransferComplete(mConnectedDeviceAddress, aConfirm, true, sFileName,
|
||||
sSentFileLength, sContentType);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -50,10 +50,9 @@ public:
|
||||
void Disconnect();
|
||||
bool Listen();
|
||||
|
||||
bool SendFile(BlobParent* aBlob,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
bool StopSendingFile(BluetoothReplyRunnable* aRunnable);
|
||||
void ConfirmReceivingFile(bool aConfirm, BluetoothReplyRunnable* aRunnable);
|
||||
bool SendFile(BlobParent* aBlob);
|
||||
bool StopSendingFile();
|
||||
bool ConfirmReceivingFile(bool aConfirm);
|
||||
|
||||
void SendConnectRequest();
|
||||
void SendPutHeaderRequest(const nsAString& aFileName, int aFileSize);
|
||||
|
@ -273,13 +273,13 @@ public:
|
||||
virtual void
|
||||
Disconnect(uint16_t aProfileId, BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual bool
|
||||
virtual void
|
||||
SendFile(const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
virtual bool
|
||||
virtual void
|
||||
StopSendingFile(const nsAString& aDeviceAddress,
|
||||
BluetoothReplyRunnable* aRunnable) = 0;
|
||||
|
||||
|
@ -529,10 +529,12 @@ BluetoothRequestParent::DoRequest(const SendFileRequest& aRequest)
|
||||
MOZ_ASSERT(mService);
|
||||
MOZ_ASSERT(mRequestType == Request::TSendFileRequest);
|
||||
|
||||
return mService->SendFile(aRequest.devicePath(),
|
||||
(BlobParent*)aRequest.blobParent(),
|
||||
(BlobChild*)aRequest.blobChild(),
|
||||
mReplyRunnable.get());
|
||||
mService->SendFile(aRequest.devicePath(),
|
||||
(BlobParent*)aRequest.blobParent(),
|
||||
(BlobChild*)aRequest.blobChild(),
|
||||
mReplyRunnable.get());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -541,8 +543,10 @@ BluetoothRequestParent::DoRequest(const StopSendingFileRequest& aRequest)
|
||||
MOZ_ASSERT(mService);
|
||||
MOZ_ASSERT(mRequestType == Request::TStopSendingFileRequest);
|
||||
|
||||
return mService->StopSendingFile(aRequest.devicePath(),
|
||||
mReplyRunnable.get());
|
||||
mService->StopSendingFile(aRequest.devicePath(),
|
||||
mReplyRunnable.get());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -323,7 +323,7 @@ BluetoothServiceChildProcess::Disconnect(
|
||||
SendRequest(aRunnable, DisconnectRequest(aProfileId));
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
BluetoothServiceChildProcess::SendFile(
|
||||
const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
@ -332,17 +332,15 @@ BluetoothServiceChildProcess::SendFile(
|
||||
{
|
||||
SendRequest(aRunnable,
|
||||
SendFileRequest(nsString(aDeviceAddress), nullptr, aBlobChild));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
BluetoothServiceChildProcess::StopSendingFile(
|
||||
const nsAString& aDeviceAddress,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
SendRequest(aRunnable,
|
||||
StopSendingFileRequest(nsString(aDeviceAddress)));
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -139,13 +139,13 @@ public:
|
||||
Disconnect(const uint16_t aProfileId,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool
|
||||
virtual void
|
||||
SendFile(const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool
|
||||
virtual void
|
||||
StopSendingFile(const nsAString& aDeviceAddress,
|
||||
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -2368,7 +2368,8 @@ void
|
||||
BluetoothDBusService::Disconnect(const uint16_t aProfileId,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
if (aProfileId == (uint16_t)(BluetoothServiceUuid::Handsfree >> 32)) {
|
||||
if (aProfileId == (uint16_t)(BluetoothServiceUuid::Handsfree >> 32) ||
|
||||
aProfileId == (uint16_t)(BluetoothServiceUuid::Headset >> 32)) {
|
||||
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
|
||||
hfp->Disconnect();
|
||||
} else if (aProfileId == (uint16_t)(BluetoothServiceUuid::ObjectPush >> 32)) {
|
||||
@ -2557,7 +2558,7 @@ BluetoothDBusService::GetScoSocket(const nsAString& aAddress,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
BluetoothDBusService::SendFile(const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
@ -2570,12 +2571,17 @@ BluetoothDBusService::SendFile(const nsAString& aDeviceAddress,
|
||||
// has been determined when calling 'Connect()'. Nevertheless, keep
|
||||
// it for future use.
|
||||
BluetoothOppManager* opp = BluetoothOppManager::Get();
|
||||
opp->SendFile(aBlobParent, aRunnable);
|
||||
BluetoothValue v = true;
|
||||
nsString errorStr;
|
||||
|
||||
return true;
|
||||
if (!opp->SendFile(aBlobParent)) {
|
||||
errorStr.AssignLiteral("Calling SendFile() failed");
|
||||
}
|
||||
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
BluetoothDBusService::StopSendingFile(const nsAString& aDeviceAddress,
|
||||
BluetoothReplyRunnable* aRunnable)
|
||||
{
|
||||
@ -2586,9 +2592,14 @@ BluetoothDBusService::StopSendingFile(const nsAString& aDeviceAddress,
|
||||
// has been determined when calling 'Connect()'. Nevertheless, keep
|
||||
// it for future use.
|
||||
BluetoothOppManager* opp = BluetoothOppManager::Get();
|
||||
opp->StopSendingFile(aRunnable);
|
||||
BluetoothValue v = true;
|
||||
nsString errorStr;
|
||||
|
||||
return true;
|
||||
if (!opp->StopSendingFile()) {
|
||||
errorStr.AssignLiteral("Calling StopSendingFile() failed");
|
||||
}
|
||||
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
}
|
||||
|
||||
void
|
||||
@ -2603,7 +2614,14 @@ BluetoothDBusService::ConfirmReceivingFile(const nsAString& aDeviceAddress,
|
||||
// has been determined when calling 'Connect()'. Nevertheless, keep
|
||||
// it for future use.
|
||||
BluetoothOppManager* opp = BluetoothOppManager::Get();
|
||||
opp->ConfirmReceivingFile(aConfirm, aRunnable);
|
||||
BluetoothValue v = true;
|
||||
nsString errorStr;
|
||||
|
||||
if (!opp->ConfirmReceivingFile(aConfirm)) {
|
||||
errorStr.AssignLiteral("Calling ConfirmReceivingFile() failed");
|
||||
}
|
||||
|
||||
DispatchBluetoothReply(aRunnable, v, errorStr);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -142,13 +142,13 @@ public:
|
||||
virtual void
|
||||
Disconnect(const uint16_t aProfileId, BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual bool
|
||||
virtual void
|
||||
SendFile(const nsAString& aDeviceAddress,
|
||||
BlobParent* aBlobParent,
|
||||
BlobChild* aBlobChild,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
virtual bool
|
||||
virtual void
|
||||
StopSendingFile(const nsAString& aDeviceAddress,
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user