зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1441308 - Support moving Maybe's in IPC serialization r=mccr8
I'd like to move an ipc::ByteBuf member of a struct into a Maybe, and in order for that to work IPDLParamTraits<Maybe> needs to support the rvalue Write. Differential Revision: https://phabricator.services.mozilla.com/D23986 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c734d845d0
Коммит
3f608fab0a
|
@ -189,6 +189,16 @@ struct IPDLParamTraits<mozilla::Maybe<T>> {
|
|||
}
|
||||
}
|
||||
|
||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
||||
mozilla::Maybe<T>&& aParam) {
|
||||
bool isSome = aParam.isSome();
|
||||
WriteIPDLParam(aMsg, aActor, isSome);
|
||||
|
||||
if (isSome) {
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.ref()));
|
||||
}
|
||||
}
|
||||
|
||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
||||
IProtocol* aActor, mozilla::Maybe<T>* aResult) {
|
||||
bool isSome;
|
||||
|
|
Загрузка…
Ссылка в новой задаче