зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1209085: Replace trivial init ops by |UnpackPDUInitOp| in Bluetooth AVRCP backend, r=joliu
This commit is contained in:
Родитель
40d7b3a003
Коммит
ec9f010e9f
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче