Bug 1209085: Replace trivial init ops by |UnpackPDUInitOp| in Bluetooth AVRCP backend, r=joliu

This commit is contained in:
Thomas Zimmermann 2015-10-06 10:08:14 +02:00
Родитель 40d7b3a003
Коммит ec9f010e9f
2 изменённых файлов: 2 добавлений и 30 удалений

Просмотреть файл

@ -738,40 +738,13 @@ BluetoothDaemonAvrcpModule::VolumeChangeNtf(
UnpackPDUInitOp(aPDU));
}
// Init operator class for PassthroughCmdNotification
class BluetoothDaemonAvrcpModule::PassthroughCmdInitOp final
: private PDUInitOp
{
public:
PassthroughCmdInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (int& aArg1, int& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
nsresult rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg1));
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg2));
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonAvrcpModule::PassthroughCmdNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
PassthroughCmdNotification::Dispatch(
&BluetoothAvrcpNotificationHandler::PassthroughCmdNotification,
PassthroughCmdInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
#endif

Просмотреть файл

@ -243,14 +243,13 @@ protected:
VolumeChangeNotification;
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, int, int>
NotificationHandlerWrapper, void, uint8_t, uint8_t, int, int>
PassthroughCmdNotification;
class GetElementAttrInitOp;
class GetPlayerAppAttrsTextInitOp;
class GetPlayerAppValueInitOp;
class GetPlayerAppValuesTextInitOp;
class PassthroughCmdInitOp;
class RemoteFeatureInitOp;
void RemoteFeatureNtf(const DaemonSocketPDUHeader& aHeader,