Bug 1164498: Remove |DispatchBluetoothReply|, r=btian

This patch removes |DispatchBluetoothReply|. The only remaining user
is |BluetoothDBusService|, but it comes with its own implemenation of
the function.
This commit is contained in:
Thomas Zimmermann 2015-05-19 12:28:38 +02:00
parent 2e4712ef31
commit 8ece57532a
3 changed files with 2 additions and 40 deletions

View File

@ -330,31 +330,6 @@ DispatchReplyError(BluetoothReplyRunnable* aRunnable,
NS_WARN_IF(NS_FAILED(NS_DispatchToMainThread(aRunnable)));
}
#if MOZ_B2G_BT_API_V2
// TODO: remove with bluetooth1
#else
void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
const BluetoothValue& aValue,
const nsAString& aErrorStr)
{
// Reply will be deleted by the runnable after running on main thread
BluetoothReply* reply;
if (!aErrorStr.IsEmpty()) {
nsString err(aErrorStr);
reply = new BluetoothReply(BluetoothReplyError(err));
} else {
MOZ_ASSERT(aValue.type() != BluetoothValue::T__None);
reply = new BluetoothReply(BluetoothReplySuccess(aValue));
}
aRunnable->SetReply(reply);
if (NS_FAILED(NS_DispatchToMainThread(aRunnable))) {
BT_WARNING("Failed to dispatch to main thread!");
}
}
#endif
void
DispatchStatusChangedEvent(const nsAString& aType,
const nsAString& aAddress,

View File

@ -177,15 +177,6 @@ void
DispatchReplyError(BluetoothReplyRunnable* aRunnable,
const enum BluetoothStatus aStatus);
#if MOZ_B2G_BT_API_V2
// TODO: remove with bluetooth1
#else
void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
const BluetoothValue& aValue,
const nsAString& aErrorStr);
#endif
void
DispatchStatusChangedEvent(const nsAString& aType,
const nsAString& aDeviceAddress,

View File

@ -420,7 +420,6 @@ DispatchToBtThread(nsIRunnable* aRunnable)
return sBluetoothThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL);
}
#ifdef MOZ_B2G_BT_API_V2
static void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
const BluetoothValue& aValue,
@ -432,9 +431,6 @@ DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
DispatchReplySuccess(aRunnable, aValue);
}
}
#else
// Missing in bluetooth1
#endif
BluetoothDBusService::BluetoothDBusService()
{
@ -4698,14 +4694,14 @@ BluetoothDBusService::UpdateNotification(ControlEventId aEventId,
void
BluetoothDBusService::StartLeScanInternal(
const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::StopLeScanInternal(
const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable)
{
}