mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1754037 - Part 3c: Automatically update all ParamTraits implementations, r=ipc-reviewers,media-playback-reviewers,bryce,mccr8
Automatically generated rewrites of all ParamTraits and IPDLParamTraits implementations in-tree to use IPC::Message{Reader,Writer}. Differential Revision: https://phabricator.services.mozilla.com/D140004
This commit is contained in:
parent
1d44e4355c
commit
05dc5e0d76
@ -49,13 +49,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::a11y::FontSize> {
|
struct ParamTraits<mozilla::a11y::FontSize> {
|
||||||
typedef mozilla::a11y::FontSize paramType;
|
typedef mozilla::a11y::FontSize paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mValue);
|
WriteParam(aWriter, aParam.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mValue));
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mValue));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -63,13 +62,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::a11y::DeleteEntry> {
|
struct ParamTraits<mozilla::a11y::DeleteEntry> {
|
||||||
typedef mozilla::a11y::DeleteEntry paramType;
|
typedef mozilla::a11y::DeleteEntry paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mValue);
|
WriteParam(aWriter, aParam.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mValue));
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mValue));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -77,12 +75,11 @@ template <>
|
|||||||
struct ParamTraits<mozilla::a11y::AccGroupInfo> {
|
struct ParamTraits<mozilla::a11y::AccGroupInfo> {
|
||||||
typedef mozilla::a11y::AccGroupInfo paramType;
|
typedef mozilla::a11y::AccGroupInfo paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
MOZ_ASSERT_UNREACHABLE("Cannot serialize AccGroupInfo");
|
MOZ_ASSERT_UNREACHABLE("Cannot serialize AccGroupInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
MOZ_ASSERT_UNREACHABLE("Cannot de-serialize AccGroupInfo");
|
MOZ_ASSERT_UNREACHABLE("Cannot de-serialize AccGroupInfo");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -92,13 +89,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::a11y::Color> {
|
struct ParamTraits<mozilla::a11y::Color> {
|
||||||
typedef mozilla::a11y::Color paramType;
|
typedef mozilla::a11y::Color paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mValue);
|
WriteParam(aWriter, aParam.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mValue));
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mValue));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -106,27 +102,26 @@ template <>
|
|||||||
struct ParamTraits<mozilla::a11y::AccAttributes*> {
|
struct ParamTraits<mozilla::a11y::AccAttributes*> {
|
||||||
typedef mozilla::a11y::AccAttributes paramType;
|
typedef mozilla::a11y::AccAttributes paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType* aParam) {
|
static void Write(MessageWriter* aWriter, const paramType* aParam) {
|
||||||
if (!aParam) {
|
if (!aParam) {
|
||||||
WriteParam(aMsg, true);
|
WriteParam(aWriter, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteParam(aMsg, false);
|
WriteParam(aWriter, false);
|
||||||
uint32_t count = aParam->mData.Count();
|
uint32_t count = aParam->mData.Count();
|
||||||
WriteParam(aMsg, count);
|
WriteParam(aWriter, count);
|
||||||
for (auto iter = aParam->mData.ConstIter(); !iter.Done(); iter.Next()) {
|
for (auto iter = aParam->mData.ConstIter(); !iter.Done(); iter.Next()) {
|
||||||
RefPtr<nsAtom> key = iter.Key();
|
RefPtr<nsAtom> key = iter.Key();
|
||||||
WriteParam(aMsg, key);
|
WriteParam(aWriter, key);
|
||||||
const paramType::AttrValueType& data = iter.Data();
|
const paramType::AttrValueType& data = iter.Data();
|
||||||
WriteParam(aMsg, data);
|
WriteParam(aWriter, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, RefPtr<paramType>* aResult) {
|
||||||
RefPtr<paramType>* aResult) {
|
|
||||||
bool isNull = false;
|
bool isNull = false;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) {
|
if (!ReadParam(aReader, &isNull)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,16 +132,16 @@ struct ParamTraits<mozilla::a11y::AccAttributes*> {
|
|||||||
|
|
||||||
*aResult = mozilla::MakeRefPtr<mozilla::a11y::AccAttributes>();
|
*aResult = mozilla::MakeRefPtr<mozilla::a11y::AccAttributes>();
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
if (!ReadParam(aMsg, aIter, &count)) {
|
if (!ReadParam(aReader, &count)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (uint32_t i = 0; i < count; ++i) {
|
for (uint32_t i = 0; i < count; ++i) {
|
||||||
RefPtr<nsAtom> key;
|
RefPtr<nsAtom> key;
|
||||||
if (!ReadParam(aMsg, aIter, &key)) {
|
if (!ReadParam(aReader, &key)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
paramType::AttrValueType val(0);
|
paramType::AttrValueType val(0);
|
||||||
if (!ReadParam(aMsg, aIter, &val)) {
|
if (!ReadParam(aReader, &val)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
(*aResult)->mData.InsertOrUpdate(key, std::move(val));
|
(*aResult)->mData.InsertOrUpdate(key, std::move(val));
|
||||||
|
@ -59,14 +59,13 @@ template <>
|
|||||||
struct ParamTraits<SerializedURI> {
|
struct ParamTraits<SerializedURI> {
|
||||||
typedef SerializedURI paramType;
|
typedef SerializedURI paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.spec);
|
WriteParam(aWriter, aParam.spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsCString spec;
|
nsCString spec;
|
||||||
if (ReadParam(aMsg, aIter, &spec)) {
|
if (ReadParam(aReader, &spec)) {
|
||||||
aResult->spec = spec;
|
aResult->spec = spec;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -78,25 +77,22 @@ template <>
|
|||||||
struct ParamTraits<ChromePackage> {
|
struct ParamTraits<ChromePackage> {
|
||||||
typedef ChromePackage paramType;
|
typedef ChromePackage paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.package);
|
WriteParam(aWriter, aParam.package);
|
||||||
WriteParam(aMsg, aParam.contentBaseURI);
|
WriteParam(aWriter, aParam.contentBaseURI);
|
||||||
WriteParam(aMsg, aParam.localeBaseURI);
|
WriteParam(aWriter, aParam.localeBaseURI);
|
||||||
WriteParam(aMsg, aParam.skinBaseURI);
|
WriteParam(aWriter, aParam.skinBaseURI);
|
||||||
WriteParam(aMsg, aParam.flags);
|
WriteParam(aWriter, aParam.flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsCString package;
|
nsCString package;
|
||||||
SerializedURI contentBaseURI, localeBaseURI, skinBaseURI;
|
SerializedURI contentBaseURI, localeBaseURI, skinBaseURI;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
||||||
if (ReadParam(aMsg, aIter, &package) &&
|
if (ReadParam(aReader, &package) && ReadParam(aReader, &contentBaseURI) &&
|
||||||
ReadParam(aMsg, aIter, &contentBaseURI) &&
|
ReadParam(aReader, &localeBaseURI) &&
|
||||||
ReadParam(aMsg, aIter, &localeBaseURI) &&
|
ReadParam(aReader, &skinBaseURI) && ReadParam(aReader, &flags)) {
|
||||||
ReadParam(aMsg, aIter, &skinBaseURI) &&
|
|
||||||
ReadParam(aMsg, aIter, &flags)) {
|
|
||||||
aResult->package = package;
|
aResult->package = package;
|
||||||
aResult->contentBaseURI = contentBaseURI;
|
aResult->contentBaseURI = contentBaseURI;
|
||||||
aResult->localeBaseURI = localeBaseURI;
|
aResult->localeBaseURI = localeBaseURI;
|
||||||
@ -119,22 +115,20 @@ template <>
|
|||||||
struct ParamTraits<SubstitutionMapping> {
|
struct ParamTraits<SubstitutionMapping> {
|
||||||
typedef SubstitutionMapping paramType;
|
typedef SubstitutionMapping paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.scheme);
|
WriteParam(aWriter, aParam.scheme);
|
||||||
WriteParam(aMsg, aParam.path);
|
WriteParam(aWriter, aParam.path);
|
||||||
WriteParam(aMsg, aParam.resolvedURI);
|
WriteParam(aWriter, aParam.resolvedURI);
|
||||||
WriteParam(aMsg, aParam.flags);
|
WriteParam(aWriter, aParam.flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsCString scheme, path;
|
nsCString scheme, path;
|
||||||
SerializedURI resolvedURI;
|
SerializedURI resolvedURI;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
||||||
if (ReadParam(aMsg, aIter, &scheme) && ReadParam(aMsg, aIter, &path) &&
|
if (ReadParam(aReader, &scheme) && ReadParam(aReader, &path) &&
|
||||||
ReadParam(aMsg, aIter, &resolvedURI) &&
|
ReadParam(aReader, &resolvedURI) && ReadParam(aReader, &flags)) {
|
||||||
ReadParam(aMsg, aIter, &flags)) {
|
|
||||||
aResult->scheme = scheme;
|
aResult->scheme = scheme;
|
||||||
aResult->path = path;
|
aResult->path = path;
|
||||||
aResult->resolvedURI = resolvedURI;
|
aResult->resolvedURI = resolvedURI;
|
||||||
@ -155,18 +149,16 @@ template <>
|
|||||||
struct ParamTraits<OverrideMapping> {
|
struct ParamTraits<OverrideMapping> {
|
||||||
typedef OverrideMapping paramType;
|
typedef OverrideMapping paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.originalURI);
|
WriteParam(aWriter, aParam.originalURI);
|
||||||
WriteParam(aMsg, aParam.overrideURI);
|
WriteParam(aWriter, aParam.overrideURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
SerializedURI originalURI;
|
SerializedURI originalURI;
|
||||||
SerializedURI overrideURI;
|
SerializedURI overrideURI;
|
||||||
|
|
||||||
if (ReadParam(aMsg, aIter, &originalURI) &&
|
if (ReadParam(aReader, &originalURI) && ReadParam(aReader, &overrideURI)) {
|
||||||
ReadParam(aMsg, aIter, &overrideURI)) {
|
|
||||||
aResult->originalURI = originalURI;
|
aResult->originalURI = originalURI;
|
||||||
aResult->overrideURI = overrideURI;
|
aResult->overrideURI = overrideURI;
|
||||||
return true;
|
return true;
|
||||||
|
@ -3711,19 +3711,19 @@ void BrowsingContext::ResetLocationChangeRateLimit() {
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>>::Write(
|
void IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::MaybeDiscarded<dom::BrowsingContext>& aParam) {
|
const dom::MaybeDiscarded<dom::BrowsingContext>& aParam) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!aParam.GetMaybeDiscarded() ||
|
MOZ_DIAGNOSTIC_ASSERT(!aParam.GetMaybeDiscarded() ||
|
||||||
aParam.GetMaybeDiscarded()->EverAttached());
|
aParam.GetMaybeDiscarded()->EverAttached());
|
||||||
uint64_t id = aParam.ContextId();
|
uint64_t id = aParam.ContextId();
|
||||||
WriteIPDLParam(aMsg, aActor, id);
|
WriteIPDLParam(aWriter, aActor, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>>::Read(
|
bool IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
dom::MaybeDiscarded<dom::BrowsingContext>* aResult) {
|
dom::MaybeDiscarded<dom::BrowsingContext>* aResult) {
|
||||||
uint64_t id = 0;
|
uint64_t id = 0;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &id)) {
|
if (!ReadIPDLParam(aReader, aActor, &id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3738,43 +3738,39 @@ bool IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<dom::BrowsingContext::IPCInitializer>::Write(
|
void IPDLParamTraits<dom::BrowsingContext::IPCInitializer>::Write(
|
||||||
IPC::Message* aMessage, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::BrowsingContext::IPCInitializer& aInit) {
|
const dom::BrowsingContext::IPCInitializer& aInit) {
|
||||||
// Write actor ID parameters.
|
// Write actor ID parameters.
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mId);
|
WriteIPDLParam(aWriter, aActor, aInit.mId);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mParentId);
|
WriteIPDLParam(aWriter, aActor, aInit.mParentId);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mWindowless);
|
WriteIPDLParam(aWriter, aActor, aInit.mWindowless);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mUseRemoteTabs);
|
WriteIPDLParam(aWriter, aActor, aInit.mUseRemoteTabs);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mUseRemoteSubframes);
|
WriteIPDLParam(aWriter, aActor, aInit.mUseRemoteSubframes);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mCreatedDynamically);
|
WriteIPDLParam(aWriter, aActor, aInit.mCreatedDynamically);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mChildOffset);
|
WriteIPDLParam(aWriter, aActor, aInit.mChildOffset);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mOriginAttributes);
|
WriteIPDLParam(aWriter, aActor, aInit.mOriginAttributes);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mRequestContextId);
|
WriteIPDLParam(aWriter, aActor, aInit.mRequestContextId);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mSessionHistoryIndex);
|
WriteIPDLParam(aWriter, aActor, aInit.mSessionHistoryIndex);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mSessionHistoryCount);
|
WriteIPDLParam(aWriter, aActor, aInit.mSessionHistoryCount);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mFields);
|
WriteIPDLParam(aWriter, aActor, aInit.mFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::BrowsingContext::IPCInitializer>::Read(
|
bool IPDLParamTraits<dom::BrowsingContext::IPCInitializer>::Read(
|
||||||
const IPC::Message* aMessage, PickleIterator* aIterator, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
dom::BrowsingContext::IPCInitializer* aInit) {
|
dom::BrowsingContext::IPCInitializer* aInit) {
|
||||||
// Read actor ID parameters.
|
// Read actor ID parameters.
|
||||||
if (!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mId) ||
|
if (!ReadIPDLParam(aReader, aActor, &aInit->mId) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mParentId) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mParentId) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mWindowless) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mWindowless) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mUseRemoteTabs) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mUseRemoteTabs) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor,
|
!ReadIPDLParam(aReader, aActor, &aInit->mUseRemoteSubframes) ||
|
||||||
&aInit->mUseRemoteSubframes) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mCreatedDynamically) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor,
|
!ReadIPDLParam(aReader, aActor, &aInit->mChildOffset) ||
|
||||||
&aInit->mCreatedDynamically) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mOriginAttributes) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mChildOffset) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mRequestContextId) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mOriginAttributes) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mSessionHistoryIndex) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mRequestContextId) ||
|
!ReadIPDLParam(aReader, aActor, &aInit->mSessionHistoryCount) ||
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor,
|
!ReadIPDLParam(aReader, aActor, &aInit->mFields)) {
|
||||||
&aInit->mSessionHistoryIndex) ||
|
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor,
|
|
||||||
&aInit->mSessionHistoryCount) ||
|
|
||||||
!ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mFields)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1345,20 +1345,18 @@ extern template class syncedcontext::Transaction<BrowsingContext>;
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>> {
|
struct IPDLParamTraits<dom::MaybeDiscarded<dom::BrowsingContext>> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::MaybeDiscarded<dom::BrowsingContext>& aParam);
|
const dom::MaybeDiscarded<dom::BrowsingContext>& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor,
|
|
||||||
dom::MaybeDiscarded<dom::BrowsingContext>* aResult);
|
dom::MaybeDiscarded<dom::BrowsingContext>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<dom::BrowsingContext::IPCInitializer> {
|
struct IPDLParamTraits<dom::BrowsingContext::IPCInitializer> {
|
||||||
static void Write(IPC::Message* aMessage, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::BrowsingContext::IPCInitializer& aInitializer);
|
const dom::BrowsingContext::IPCInitializer& aInitializer);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMessage, PickleIterator* aIterator,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor,
|
|
||||||
dom::BrowsingContext::IPCInitializer* aInitializer);
|
dom::BrowsingContext::IPCInitializer* aInitializer);
|
||||||
};
|
};
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -63,29 +63,28 @@ template <>
|
|||||||
struct ParamTraits<SerializedLoadContext> {
|
struct ParamTraits<SerializedLoadContext> {
|
||||||
typedef SerializedLoadContext paramType;
|
typedef SerializedLoadContext paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
nsAutoCString suffix;
|
nsAutoCString suffix;
|
||||||
aParam.mOriginAttributes.CreateSuffix(suffix);
|
aParam.mOriginAttributes.CreateSuffix(suffix);
|
||||||
|
|
||||||
WriteParam(aMsg, aParam.mIsNotNull);
|
WriteParam(aWriter, aParam.mIsNotNull);
|
||||||
WriteParam(aMsg, aParam.mIsContent);
|
WriteParam(aWriter, aParam.mIsContent);
|
||||||
WriteParam(aMsg, aParam.mIsPrivateBitValid);
|
WriteParam(aWriter, aParam.mIsPrivateBitValid);
|
||||||
WriteParam(aMsg, aParam.mUseRemoteTabs);
|
WriteParam(aWriter, aParam.mUseRemoteTabs);
|
||||||
WriteParam(aMsg, aParam.mUseRemoteSubframes);
|
WriteParam(aWriter, aParam.mUseRemoteSubframes);
|
||||||
WriteParam(aMsg, aParam.mUseTrackingProtection);
|
WriteParam(aWriter, aParam.mUseTrackingProtection);
|
||||||
WriteParam(aMsg, suffix);
|
WriteParam(aWriter, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsAutoCString suffix;
|
nsAutoCString suffix;
|
||||||
if (!ReadParam(aMsg, aIter, &aResult->mIsNotNull) ||
|
if (!ReadParam(aReader, &aResult->mIsNotNull) ||
|
||||||
!ReadParam(aMsg, aIter, &aResult->mIsContent) ||
|
!ReadParam(aReader, &aResult->mIsContent) ||
|
||||||
!ReadParam(aMsg, aIter, &aResult->mIsPrivateBitValid) ||
|
!ReadParam(aReader, &aResult->mIsPrivateBitValid) ||
|
||||||
!ReadParam(aMsg, aIter, &aResult->mUseRemoteTabs) ||
|
!ReadParam(aReader, &aResult->mUseRemoteTabs) ||
|
||||||
!ReadParam(aMsg, aIter, &aResult->mUseRemoteSubframes) ||
|
!ReadParam(aReader, &aResult->mUseRemoteSubframes) ||
|
||||||
!ReadParam(aMsg, aIter, &aResult->mUseTrackingProtection) ||
|
!ReadParam(aReader, &aResult->mUseTrackingProtection) ||
|
||||||
!ReadParam(aMsg, aIter, &suffix)) {
|
!ReadParam(aReader, &suffix)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return aResult->mOriginAttributes.PopulateFromSuffix(suffix);
|
return aResult->mOriginAttributes.PopulateFromSuffix(suffix);
|
||||||
|
@ -90,9 +90,9 @@ class Transaction {
|
|||||||
private:
|
private:
|
||||||
friend struct mozilla::ipc::IPDLParamTraits<Transaction<Context>>;
|
friend struct mozilla::ipc::IPDLParamTraits<Transaction<Context>>;
|
||||||
|
|
||||||
void Write(IPC::Message* aMsg, mozilla::ipc::IProtocol* aActor) const;
|
void Write(IPC::MessageWriter* aWriter,
|
||||||
bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
mozilla::ipc::IProtocol* aActor) const;
|
||||||
mozilla::ipc::IProtocol* aActor);
|
bool Read(IPC::MessageReader* aReader, mozilla::ipc::IProtocol* aActor);
|
||||||
|
|
||||||
// You probably don't want to directly call this method - instead call
|
// You probably don't want to directly call this method - instead call
|
||||||
// `Commit`, which will perform the necessary synchronization.
|
// `Commit`, which will perform the necessary synchronization.
|
||||||
@ -141,9 +141,9 @@ class FieldValues : public Base {
|
|||||||
private:
|
private:
|
||||||
friend struct mozilla::ipc::IPDLParamTraits<FieldValues<Base, Count>>;
|
friend struct mozilla::ipc::IPDLParamTraits<FieldValues<Base, Count>>;
|
||||||
|
|
||||||
void Write(IPC::Message* aMsg, mozilla::ipc::IProtocol* aActor) const;
|
void Write(IPC::MessageWriter* aWriter,
|
||||||
bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
mozilla::ipc::IProtocol* aActor) const;
|
||||||
mozilla::ipc::IProtocol* aActor);
|
bool Read(IPC::MessageReader* aReader, mozilla::ipc::IProtocol* aActor);
|
||||||
|
|
||||||
template <typename F, size_t... Indexes>
|
template <typename F, size_t... Indexes>
|
||||||
static void EachIndexInner(std::index_sequence<Indexes...> aIndexes,
|
static void EachIndexInner(std::index_sequence<Indexes...> aIndexes,
|
||||||
@ -324,14 +324,14 @@ template <typename Context>
|
|||||||
struct IPDLParamTraits<dom::syncedcontext::Transaction<Context>> {
|
struct IPDLParamTraits<dom::syncedcontext::Transaction<Context>> {
|
||||||
typedef dom::syncedcontext::Transaction<Context> paramType;
|
typedef dom::syncedcontext::Transaction<Context> paramType;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
aParam.Write(aMsg, aActor);
|
aParam.Write(aWriter, aActor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
return aResult->Read(aMsg, aIter, aActor);
|
return aResult->Read(aReader, aActor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -339,14 +339,14 @@ template <typename Base, size_t Count>
|
|||||||
struct IPDLParamTraits<dom::syncedcontext::FieldValues<Base, Count>> {
|
struct IPDLParamTraits<dom::syncedcontext::FieldValues<Base, Count>> {
|
||||||
typedef dom::syncedcontext::FieldValues<Base, Count> paramType;
|
typedef dom::syncedcontext::FieldValues<Base, Count> paramType;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
aParam.Write(aMsg, aActor);
|
aParam.Write(aWriter, aActor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
return aResult->Read(aMsg, aIter, aActor);
|
return aResult->Read(aReader, aActor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -294,27 +294,27 @@ typename Transaction<Context>::IndexSet Transaction<Context>::Validate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Context>
|
template <typename Context>
|
||||||
void Transaction<Context>::Write(IPC::Message* aMsg,
|
void Transaction<Context>::Write(IPC::MessageWriter* aWriter,
|
||||||
mozilla::ipc::IProtocol* aActor) const {
|
mozilla::ipc::IProtocol* aActor) const {
|
||||||
// Record which field indices will be included, and then write those fields
|
// Record which field indices will be included, and then write those fields
|
||||||
// out.
|
// out.
|
||||||
typename IndexSet::serializedType modified = mModified.serialize();
|
typename IndexSet::serializedType modified = mModified.serialize();
|
||||||
WriteIPDLParam(aMsg, aActor, modified);
|
WriteIPDLParam(aWriter, aActor, modified);
|
||||||
EachIndex([&](auto idx) {
|
EachIndex([&](auto idx) {
|
||||||
if (mModified.contains(idx)) {
|
if (mModified.contains(idx)) {
|
||||||
WriteIPDLParam(aMsg, aActor, mValues.Get(idx));
|
WriteIPDLParam(aWriter, aActor, mValues.Get(idx));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Context>
|
template <typename Context>
|
||||||
bool Transaction<Context>::Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool Transaction<Context>::Read(IPC::MessageReader* aReader,
|
||||||
mozilla::ipc::IProtocol* aActor) {
|
mozilla::ipc::IProtocol* aActor) {
|
||||||
// Read in which field indices were sent by the remote, followed by the fields
|
// Read in which field indices were sent by the remote, followed by the fields
|
||||||
// identified by those indices.
|
// identified by those indices.
|
||||||
typename IndexSet::serializedType modified =
|
typename IndexSet::serializedType modified =
|
||||||
typename IndexSet::serializedType{};
|
typename IndexSet::serializedType{};
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &modified)) {
|
if (!ReadIPDLParam(aReader, aActor, &modified)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mModified.deserialize(modified);
|
mModified.deserialize(modified);
|
||||||
@ -322,30 +322,29 @@ bool Transaction<Context>::Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
EachIndex([&](auto idx) {
|
EachIndex([&](auto idx) {
|
||||||
if (ok && mModified.contains(idx)) {
|
if (ok && mModified.contains(idx)) {
|
||||||
ok = ReadIPDLParam(aMsg, aIter, aActor, &mValues.Get(idx));
|
ok = ReadIPDLParam(aReader, aActor, &mValues.Get(idx));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base, size_t Count>
|
template <typename Base, size_t Count>
|
||||||
void FieldValues<Base, Count>::Write(IPC::Message* aMsg,
|
void FieldValues<Base, Count>::Write(IPC::MessageWriter* aWriter,
|
||||||
mozilla::ipc::IProtocol* aActor) const {
|
mozilla::ipc::IProtocol* aActor) const {
|
||||||
// XXX The this-> qualification is necessary to work around a bug in older gcc
|
// XXX The this-> qualification is necessary to work around a bug in older gcc
|
||||||
// versions causing an ICE.
|
// versions causing an ICE.
|
||||||
EachIndex([&](auto idx) { WriteIPDLParam(aMsg, aActor, this->Get(idx)); });
|
EachIndex([&](auto idx) { WriteIPDLParam(aWriter, aActor, this->Get(idx)); });
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base, size_t Count>
|
template <typename Base, size_t Count>
|
||||||
bool FieldValues<Base, Count>::Read(const IPC::Message* aMsg,
|
bool FieldValues<Base, Count>::Read(IPC::MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
mozilla::ipc::IProtocol* aActor) {
|
mozilla::ipc::IProtocol* aActor) {
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
EachIndex([&](auto idx) {
|
EachIndex([&](auto idx) {
|
||||||
if (ok) {
|
if (ok) {
|
||||||
// XXX The this-> qualification is necessary to work around a bug in older
|
// XXX The this-> qualification is necessary to work around a bug in older
|
||||||
// gcc versions causing an ICE.
|
// gcc versions causing an ICE.
|
||||||
ok = ReadIPDLParam(aMsg, aIter, aActor, &this->Get(idx));
|
ok = ReadIPDLParam(aReader, aActor, &this->Get(idx));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return ok;
|
return ok;
|
||||||
|
@ -577,17 +577,17 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(WindowContext)
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>>::Write(
|
void IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::MaybeDiscarded<dom::WindowContext>& aParam) {
|
const dom::MaybeDiscarded<dom::WindowContext>& aParam) {
|
||||||
uint64_t id = aParam.ContextId();
|
uint64_t id = aParam.ContextId();
|
||||||
WriteIPDLParam(aMsg, aActor, id);
|
WriteIPDLParam(aWriter, aActor, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>>::Read(
|
bool IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
dom::MaybeDiscarded<dom::WindowContext>* aResult) {
|
dom::MaybeDiscarded<dom::WindowContext>* aResult) {
|
||||||
uint64_t id = 0;
|
uint64_t id = 0;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &id)) {
|
if (!ReadIPDLParam(aReader, aActor, &id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,24 +602,23 @@ bool IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<dom::WindowContext::IPCInitializer>::Write(
|
void IPDLParamTraits<dom::WindowContext::IPCInitializer>::Write(
|
||||||
IPC::Message* aMessage, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::WindowContext::IPCInitializer& aInit) {
|
const dom::WindowContext::IPCInitializer& aInit) {
|
||||||
// Write actor ID parameters.
|
// Write actor ID parameters.
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mInnerWindowId);
|
WriteIPDLParam(aWriter, aActor, aInit.mInnerWindowId);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mOuterWindowId);
|
WriteIPDLParam(aWriter, aActor, aInit.mOuterWindowId);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mBrowsingContextId);
|
WriteIPDLParam(aWriter, aActor, aInit.mBrowsingContextId);
|
||||||
WriteIPDLParam(aMessage, aActor, aInit.mFields);
|
WriteIPDLParam(aWriter, aActor, aInit.mFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::WindowContext::IPCInitializer>::Read(
|
bool IPDLParamTraits<dom::WindowContext::IPCInitializer>::Read(
|
||||||
const IPC::Message* aMessage, PickleIterator* aIterator, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
dom::WindowContext::IPCInitializer* aInit) {
|
dom::WindowContext::IPCInitializer* aInit) {
|
||||||
// Read actor ID parameters.
|
// Read actor ID parameters.
|
||||||
return ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mInnerWindowId) &&
|
return ReadIPDLParam(aReader, aActor, &aInit->mInnerWindowId) &&
|
||||||
ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mOuterWindowId) &&
|
ReadIPDLParam(aReader, aActor, &aInit->mOuterWindowId) &&
|
||||||
ReadIPDLParam(aMessage, aIterator, aActor,
|
ReadIPDLParam(aReader, aActor, &aInit->mBrowsingContextId) &&
|
||||||
&aInit->mBrowsingContextId) &&
|
ReadIPDLParam(aReader, aActor, &aInit->mFields);
|
||||||
ReadIPDLParam(aMessage, aIterator, aActor, &aInit->mFields);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template struct IPDLParamTraits<dom::WindowContext::BaseTransaction>;
|
template struct IPDLParamTraits<dom::WindowContext::BaseTransaction>;
|
||||||
|
@ -353,20 +353,18 @@ extern template class syncedcontext::Transaction<WindowContext>;
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>> {
|
struct IPDLParamTraits<dom::MaybeDiscarded<dom::WindowContext>> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::MaybeDiscarded<dom::WindowContext>& aParam);
|
const dom::MaybeDiscarded<dom::WindowContext>& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor,
|
|
||||||
dom::MaybeDiscarded<dom::WindowContext>* aResult);
|
dom::MaybeDiscarded<dom::WindowContext>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<dom::WindowContext::IPCInitializer> {
|
struct IPDLParamTraits<dom::WindowContext::IPCInitializer> {
|
||||||
static void Write(IPC::Message* aMessage, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::WindowContext::IPCInitializer& aInitializer);
|
const dom::WindowContext::IPCInitializer& aInitializer);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMessage, PickleIterator* aIterator,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor,
|
|
||||||
dom::WindowContext::IPCInitializer* aInitializer);
|
dom::WindowContext::IPCInitializer* aInitializer);
|
||||||
};
|
};
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -1445,7 +1445,7 @@ void SessionHistoryEntry::SetInfo(SessionHistoryInfo* aInfo) {
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<dom::SessionHistoryInfo>::Write(
|
void IPDLParamTraits<dom::SessionHistoryInfo>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::SessionHistoryInfo& aParam) {
|
const dom::SessionHistoryInfo& aParam) {
|
||||||
Maybe<Tuple<uint32_t, dom::ClonedMessageData>> stateData;
|
Maybe<Tuple<uint32_t, dom::ClonedMessageData>> stateData;
|
||||||
if (aParam.mStateData) {
|
if (aParam.mStateData) {
|
||||||
@ -1471,63 +1471,66 @@ void IPDLParamTraits<dom::SessionHistoryInfo>::Write(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mURI);
|
WriteIPDLParam(aWriter, aActor, aParam.mURI);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mOriginalURI);
|
WriteIPDLParam(aWriter, aActor, aParam.mOriginalURI);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mResultPrincipalURI);
|
WriteIPDLParam(aWriter, aActor, aParam.mResultPrincipalURI);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mReferrerInfo);
|
WriteIPDLParam(aWriter, aActor, aParam.mReferrerInfo);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mTitle);
|
WriteIPDLParam(aWriter, aActor, aParam.mTitle);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mName);
|
WriteIPDLParam(aWriter, aActor, aParam.mName);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mPostData);
|
WriteIPDLParam(aWriter, aActor, aParam.mPostData);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mLoadType);
|
WriteIPDLParam(aWriter, aActor, aParam.mLoadType);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollPositionX);
|
WriteIPDLParam(aWriter, aActor, aParam.mScrollPositionX);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollPositionY);
|
WriteIPDLParam(aWriter, aActor, aParam.mScrollPositionY);
|
||||||
WriteIPDLParam(aMsg, aActor, stateData);
|
WriteIPDLParam(aWriter, aActor, stateData);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSrcdocData);
|
WriteIPDLParam(aWriter, aActor, aParam.mSrcdocData);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mBaseURI);
|
WriteIPDLParam(aWriter, aActor, aParam.mBaseURI);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mLoadReplace);
|
WriteIPDLParam(aWriter, aActor, aParam.mLoadReplace);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mURIWasModified);
|
WriteIPDLParam(aWriter, aActor, aParam.mURIWasModified);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollRestorationIsManual);
|
WriteIPDLParam(aWriter, aActor, aParam.mScrollRestorationIsManual);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mPersist);
|
WriteIPDLParam(aWriter, aActor, aParam.mPersist);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mHasUserInteraction);
|
WriteIPDLParam(aWriter, aActor, aParam.mHasUserInteraction);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mHasUserActivation);
|
WriteIPDLParam(aWriter, aActor, aParam.mHasUserActivation);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mId);
|
WriteIPDLParam(aWriter, aActor, aParam.mSharedState.Get()->mId);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mTriggeringPrincipal);
|
WriteIPDLParam(aWriter, aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mPrincipalToInherit);
|
aParam.mSharedState.Get()->mTriggeringPrincipal);
|
||||||
WriteIPDLParam(aMsg, aActor,
|
WriteIPDLParam(aWriter, aActor,
|
||||||
|
aParam.mSharedState.Get()->mPrincipalToInherit);
|
||||||
|
WriteIPDLParam(aWriter, aActor,
|
||||||
aParam.mSharedState.Get()->mPartitionedPrincipalToInherit);
|
aParam.mSharedState.Get()->mPartitionedPrincipalToInherit);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mCsp);
|
WriteIPDLParam(aWriter, aActor, aParam.mSharedState.Get()->mCsp);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mContentType);
|
WriteIPDLParam(aWriter, aActor, aParam.mSharedState.Get()->mContentType);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mLayoutHistoryState);
|
WriteIPDLParam(aWriter, aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mCacheKey);
|
aParam.mSharedState.Get()->mLayoutHistoryState);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSharedState.Get()->mIsFrameNavigation);
|
WriteIPDLParam(aWriter, aActor, aParam.mSharedState.Get()->mCacheKey);
|
||||||
|
WriteIPDLParam(aWriter, aActor,
|
||||||
|
aParam.mSharedState.Get()->mIsFrameNavigation);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::SessionHistoryInfo>::Read(
|
bool IPDLParamTraits<dom::SessionHistoryInfo>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
dom::SessionHistoryInfo* aResult) {
|
dom::SessionHistoryInfo* aResult) {
|
||||||
Maybe<Tuple<uint32_t, dom::ClonedMessageData>> stateData;
|
Maybe<Tuple<uint32_t, dom::ClonedMessageData>> stateData;
|
||||||
uint64_t sharedId;
|
uint64_t sharedId;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mURI) ||
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mURI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mOriginalURI) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mOriginalURI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResultPrincipalURI) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mResultPrincipalURI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mReferrerInfo) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mReferrerInfo) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mTitle) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mTitle) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mName) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mName) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mPostData) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mPostData) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLoadType) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mLoadType) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollPositionX) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mScrollPositionX) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollPositionY) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mScrollPositionY) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &stateData) ||
|
!ReadIPDLParam(aReader, aActor, &stateData) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSrcdocData) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mSrcdocData) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mBaseURI) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mBaseURI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLoadReplace) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mLoadReplace) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mURIWasModified) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mURIWasModified) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor,
|
!ReadIPDLParam(aReader, aActor, &aResult->mScrollRestorationIsManual) ||
|
||||||
&aResult->mScrollRestorationIsManual) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mPersist) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mPersist) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mHasUserInteraction) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mHasUserInteraction) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mHasUserActivation) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mHasUserActivation) ||
|
!ReadIPDLParam(aReader, aActor, &sharedId)) {
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &sharedId)) {
|
|
||||||
aActor->FatalError("Error reading fields for SessionHistoryInfo");
|
aActor->FatalError("Error reading fields for SessionHistoryInfo");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1537,11 +1540,11 @@ bool IPDLParamTraits<dom::SessionHistoryInfo>::Read(
|
|||||||
nsCOMPtr<nsIPrincipal> partitionedPrincipalToInherit;
|
nsCOMPtr<nsIPrincipal> partitionedPrincipalToInherit;
|
||||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||||
nsCString contentType;
|
nsCString contentType;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &triggeringPrincipal) ||
|
if (!ReadIPDLParam(aReader, aActor, &triggeringPrincipal) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &principalToInherit) ||
|
!ReadIPDLParam(aReader, aActor, &principalToInherit) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &partitionedPrincipalToInherit) ||
|
!ReadIPDLParam(aReader, aActor, &partitionedPrincipalToInherit) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &csp) ||
|
!ReadIPDLParam(aReader, aActor, &csp) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &contentType)) {
|
!ReadIPDLParam(aReader, aActor, &contentType)) {
|
||||||
aActor->FatalError("Error reading fields for SessionHistoryInfo");
|
aActor->FatalError("Error reading fields for SessionHistoryInfo");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1588,11 +1591,11 @@ bool IPDLParamTraits<dom::SessionHistoryInfo>::Read(
|
|||||||
aResult->mSharedState.Get()->mContentType = contentType;
|
aResult->mSharedState.Get()->mContentType = contentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor,
|
if (!ReadIPDLParam(aReader, aActor,
|
||||||
&aResult->mSharedState.Get()->mLayoutHistoryState) ||
|
&aResult->mSharedState.Get()->mLayoutHistoryState) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor,
|
!ReadIPDLParam(aReader, aActor,
|
||||||
&aResult->mSharedState.Get()->mCacheKey) ||
|
&aResult->mSharedState.Get()->mCacheKey) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor,
|
!ReadIPDLParam(aReader, aActor,
|
||||||
&aResult->mSharedState.Get()->mIsFrameNavigation)) {
|
&aResult->mSharedState.Get()->mIsFrameNavigation)) {
|
||||||
aActor->FatalError("Error reading fields for SessionHistoryInfo");
|
aActor->FatalError("Error reading fields for SessionHistoryInfo");
|
||||||
return false;
|
return false;
|
||||||
@ -1614,26 +1617,25 @@ bool IPDLParamTraits<dom::SessionHistoryInfo>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<dom::LoadingSessionHistoryInfo>::Write(
|
void IPDLParamTraits<dom::LoadingSessionHistoryInfo>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::LoadingSessionHistoryInfo& aParam) {
|
const dom::LoadingSessionHistoryInfo& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mInfo);
|
WriteIPDLParam(aWriter, aActor, aParam.mInfo);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mLoadId);
|
WriteIPDLParam(aWriter, aActor, aParam.mLoadId);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mLoadIsFromSessionHistory);
|
WriteIPDLParam(aWriter, aActor, aParam.mLoadIsFromSessionHistory);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mOffset);
|
WriteIPDLParam(aWriter, aActor, aParam.mOffset);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mLoadingCurrentEntry);
|
WriteIPDLParam(aWriter, aActor, aParam.mLoadingCurrentEntry);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mForceMaybeResetName);
|
WriteIPDLParam(aWriter, aActor, aParam.mForceMaybeResetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::LoadingSessionHistoryInfo>::Read(
|
bool IPDLParamTraits<dom::LoadingSessionHistoryInfo>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
dom::LoadingSessionHistoryInfo* aResult) {
|
dom::LoadingSessionHistoryInfo* aResult) {
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mInfo) ||
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mInfo) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLoadId) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mLoadId) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor,
|
!ReadIPDLParam(aReader, aActor, &aResult->mLoadIsFromSessionHistory) ||
|
||||||
&aResult->mLoadIsFromSessionHistory) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mOffset) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mOffset) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mLoadingCurrentEntry) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLoadingCurrentEntry) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mForceMaybeResetName)) {
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mForceMaybeResetName)) {
|
|
||||||
aActor->FatalError("Error reading fields for LoadingSessionHistoryInfo");
|
aActor->FatalError("Error reading fields for LoadingSessionHistoryInfo");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1642,26 +1644,27 @@ bool IPDLParamTraits<dom::LoadingSessionHistoryInfo>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<nsILayoutHistoryState*>::Write(
|
void IPDLParamTraits<nsILayoutHistoryState*>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor, nsILayoutHistoryState* aParam) {
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
nsILayoutHistoryState* aParam) {
|
||||||
if (aParam) {
|
if (aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, true);
|
WriteIPDLParam(aWriter, aActor, true);
|
||||||
bool scrollPositionOnly = false;
|
bool scrollPositionOnly = false;
|
||||||
nsTArray<nsCString> keys;
|
nsTArray<nsCString> keys;
|
||||||
nsTArray<mozilla::PresState> states;
|
nsTArray<mozilla::PresState> states;
|
||||||
aParam->GetContents(&scrollPositionOnly, keys, states);
|
aParam->GetContents(&scrollPositionOnly, keys, states);
|
||||||
WriteIPDLParam(aMsg, aActor, scrollPositionOnly);
|
WriteIPDLParam(aWriter, aActor, scrollPositionOnly);
|
||||||
WriteIPDLParam(aMsg, aActor, keys);
|
WriteIPDLParam(aWriter, aActor, keys);
|
||||||
WriteIPDLParam(aMsg, aActor, states);
|
WriteIPDLParam(aWriter, aActor, states);
|
||||||
} else {
|
} else {
|
||||||
WriteIPDLParam(aMsg, aActor, false);
|
WriteIPDLParam(aWriter, aActor, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<nsILayoutHistoryState*>::Read(
|
bool IPDLParamTraits<nsILayoutHistoryState*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
RefPtr<nsILayoutHistoryState>* aResult) {
|
RefPtr<nsILayoutHistoryState>* aResult) {
|
||||||
bool hasLayoutHistoryState = false;
|
bool hasLayoutHistoryState = false;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &hasLayoutHistoryState)) {
|
if (!ReadIPDLParam(aReader, aActor, &hasLayoutHistoryState)) {
|
||||||
aActor->FatalError("Error reading fields for nsILayoutHistoryState");
|
aActor->FatalError("Error reading fields for nsILayoutHistoryState");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1670,9 +1673,9 @@ bool IPDLParamTraits<nsILayoutHistoryState*>::Read(
|
|||||||
bool scrollPositionOnly = false;
|
bool scrollPositionOnly = false;
|
||||||
nsTArray<nsCString> keys;
|
nsTArray<nsCString> keys;
|
||||||
nsTArray<mozilla::PresState> states;
|
nsTArray<mozilla::PresState> states;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &scrollPositionOnly) ||
|
if (!ReadIPDLParam(aReader, aActor, &scrollPositionOnly) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &keys) ||
|
!ReadIPDLParam(aReader, aActor, &keys) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &states)) {
|
!ReadIPDLParam(aReader, aActor, &states)) {
|
||||||
aActor->FatalError("Error reading fields for nsILayoutHistoryState");
|
aActor->FatalError("Error reading fields for nsILayoutHistoryState");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1693,17 +1696,17 @@ bool IPDLParamTraits<nsILayoutHistoryState*>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<mozilla::dom::Wireframe>::Write(
|
void IPDLParamTraits<mozilla::dom::Wireframe>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor,
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const mozilla::dom::Wireframe& aParam) {
|
const mozilla::dom::Wireframe& aParam) {
|
||||||
WriteParam(aMsg, aParam.mCanvasBackground);
|
WriteParam(aWriter, aParam.mCanvasBackground);
|
||||||
WriteParam(aMsg, aParam.mRects);
|
WriteParam(aWriter, aParam.mRects);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<mozilla::dom::Wireframe>::Read(
|
bool IPDLParamTraits<mozilla::dom::Wireframe>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
mozilla::dom::Wireframe* aResult) {
|
mozilla::dom::Wireframe* aResult) {
|
||||||
return ReadParam(aMsg, aIter, &aResult->mCanvasBackground) &&
|
return ReadParam(aReader, &aResult->mCanvasBackground) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mRects);
|
ReadParam(aReader, &aResult->mRects);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
@ -1720,30 +1723,28 @@ struct ParamTraits<mozilla::dom::WireframeRectType>
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::dom::WireframeTaggedRect> {
|
struct ParamTraits<mozilla::dom::WireframeTaggedRect> {
|
||||||
static void Write(Message* aMsg,
|
static void Write(MessageWriter* aWriter,
|
||||||
const mozilla::dom::WireframeTaggedRect& aParam);
|
const mozilla::dom::WireframeTaggedRect& aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader,
|
||||||
mozilla::dom::WireframeTaggedRect* aResult);
|
mozilla::dom::WireframeTaggedRect* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
void ParamTraits<mozilla::dom::WireframeTaggedRect>::Write(
|
void ParamTraits<mozilla::dom::WireframeTaggedRect>::Write(
|
||||||
Message* aMsg, const mozilla::dom::WireframeTaggedRect& aParam) {
|
MessageWriter* aWriter, const mozilla::dom::WireframeTaggedRect& aParam) {
|
||||||
WriteParam(aMsg, aParam.mColor);
|
WriteParam(aWriter, aParam.mColor);
|
||||||
WriteParam(aMsg, aParam.mType);
|
WriteParam(aWriter, aParam.mType);
|
||||||
WriteParam(aMsg, aParam.mX);
|
WriteParam(aWriter, aParam.mX);
|
||||||
WriteParam(aMsg, aParam.mY);
|
WriteParam(aWriter, aParam.mY);
|
||||||
WriteParam(aMsg, aParam.mWidth);
|
WriteParam(aWriter, aParam.mWidth);
|
||||||
WriteParam(aMsg, aParam.mHeight);
|
WriteParam(aWriter, aParam.mHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParamTraits<mozilla::dom::WireframeTaggedRect>::Read(
|
bool ParamTraits<mozilla::dom::WireframeTaggedRect>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter,
|
IPC::MessageReader* aReader, mozilla::dom::WireframeTaggedRect* aResult) {
|
||||||
mozilla::dom::WireframeTaggedRect* aResult) {
|
return ReadParam(aReader, &aResult->mColor) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mColor) &&
|
ReadParam(aReader, &aResult->mType) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mType) &&
|
ReadParam(aReader, &aResult->mX) && ReadParam(aReader, &aResult->mY) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mX) &&
|
ReadParam(aReader, &aResult->mWidth) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mY) &&
|
ReadParam(aReader, &aResult->mHeight);
|
||||||
ReadParam(aMsg, aIter, &aResult->mWidth) &&
|
|
||||||
ReadParam(aMsg, aIter, &aResult->mHeight);
|
|
||||||
}
|
}
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -431,37 +431,37 @@ class IProtocol;
|
|||||||
// Allow sending SessionHistoryInfo objects over IPC.
|
// Allow sending SessionHistoryInfo objects over IPC.
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<dom::SessionHistoryInfo> {
|
struct IPDLParamTraits<dom::SessionHistoryInfo> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::SessionHistoryInfo& aParam);
|
const dom::SessionHistoryInfo& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, dom::SessionHistoryInfo* aResult);
|
dom::SessionHistoryInfo* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Allow sending LoadingSessionHistoryInfo objects over IPC.
|
// Allow sending LoadingSessionHistoryInfo objects over IPC.
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<dom::LoadingSessionHistoryInfo> {
|
struct IPDLParamTraits<dom::LoadingSessionHistoryInfo> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const dom::LoadingSessionHistoryInfo& aParam);
|
const dom::LoadingSessionHistoryInfo& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, dom::LoadingSessionHistoryInfo* aResult);
|
dom::LoadingSessionHistoryInfo* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Allow sending nsILayoutHistoryState objects over IPC.
|
// Allow sending nsILayoutHistoryState objects over IPC.
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsILayoutHistoryState*> {
|
struct IPDLParamTraits<nsILayoutHistoryState*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsILayoutHistoryState* aParam);
|
nsILayoutHistoryState* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<nsILayoutHistoryState>* aResult);
|
RefPtr<nsILayoutHistoryState>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Allow sending dom::Wireframe objects over IPC.
|
// Allow sending dom::Wireframe objects over IPC.
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<mozilla::dom::Wireframe> {
|
struct IPDLParamTraits<mozilla::dom::Wireframe> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const mozilla::dom::Wireframe& aParam);
|
const mozilla::dom::Wireframe& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, mozilla::dom::Wireframe* aResult);
|
mozilla::dom::Wireframe* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -589,61 +589,61 @@ nsDOMNavigationTiming::nsDOMNavigationTiming(nsDocShell* aDocShell,
|
|||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Write(
|
void mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor, nsDOMNavigationTiming* aParam) {
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
nsDOMNavigationTiming* aParam) {
|
||||||
RefPtr<nsIURI> unloadedURI = aParam->mUnloadedURI.get();
|
RefPtr<nsIURI> unloadedURI = aParam->mUnloadedURI.get();
|
||||||
RefPtr<nsIURI> loadedURI = aParam->mLoadedURI.get();
|
RefPtr<nsIURI> loadedURI = aParam->mLoadedURI.get();
|
||||||
WriteIPDLParam(aMsg, aActor, unloadedURI ? Some(unloadedURI) : Nothing());
|
WriteIPDLParam(aWriter, aActor, unloadedURI ? Some(unloadedURI) : Nothing());
|
||||||
WriteIPDLParam(aMsg, aActor, loadedURI ? Some(loadedURI) : Nothing());
|
WriteIPDLParam(aWriter, aActor, loadedURI ? Some(loadedURI) : Nothing());
|
||||||
WriteIPDLParam(aMsg, aActor, uint32_t(aParam->mNavigationType));
|
WriteIPDLParam(aWriter, aActor, uint32_t(aParam->mNavigationType));
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mNavigationStartHighRes);
|
WriteIPDLParam(aWriter, aActor, aParam->mNavigationStartHighRes);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mNavigationStart);
|
WriteIPDLParam(aWriter, aActor, aParam->mNavigationStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mNonBlankPaint);
|
WriteIPDLParam(aWriter, aActor, aParam->mNonBlankPaint);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mContentfulComposite);
|
WriteIPDLParam(aWriter, aActor, aParam->mContentfulComposite);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mDOMContentFlushed);
|
WriteIPDLParam(aWriter, aActor, aParam->mDOMContentFlushed);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mBeforeUnloadStart);
|
WriteIPDLParam(aWriter, aActor, aParam->mBeforeUnloadStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mUnloadStart);
|
WriteIPDLParam(aWriter, aActor, aParam->mUnloadStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mUnloadEnd);
|
WriteIPDLParam(aWriter, aActor, aParam->mUnloadEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mLoadEventStart);
|
WriteIPDLParam(aWriter, aActor, aParam->mLoadEventStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mLoadEventEnd);
|
WriteIPDLParam(aWriter, aActor, aParam->mLoadEventEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mDOMLoading);
|
WriteIPDLParam(aWriter, aActor, aParam->mDOMLoading);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mDOMInteractive);
|
WriteIPDLParam(aWriter, aActor, aParam->mDOMInteractive);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mDOMContentLoadedEventStart);
|
WriteIPDLParam(aWriter, aActor, aParam->mDOMContentLoadedEventStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mDOMContentLoadedEventEnd);
|
WriteIPDLParam(aWriter, aActor, aParam->mDOMContentLoadedEventEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mDOMComplete);
|
WriteIPDLParam(aWriter, aActor, aParam->mDOMComplete);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->mTTFI);
|
WriteIPDLParam(aWriter, aActor, aParam->mTTFI);
|
||||||
WriteIPDLParam(aMsg, aActor,
|
WriteIPDLParam(aWriter, aActor,
|
||||||
aParam->mDocShellHasBeenActiveSinceNavigationStart);
|
aParam->mDocShellHasBeenActiveSinceNavigationStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
bool mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Read(
|
bool mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
RefPtr<nsDOMNavigationTiming>* aResult) {
|
RefPtr<nsDOMNavigationTiming>* aResult) {
|
||||||
auto timing = MakeRefPtr<nsDOMNavigationTiming>(nullptr);
|
auto timing = MakeRefPtr<nsDOMNavigationTiming>(nullptr);
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
Maybe<RefPtr<nsIURI>> unloadedURI;
|
Maybe<RefPtr<nsIURI>> unloadedURI;
|
||||||
Maybe<RefPtr<nsIURI>> loadedURI;
|
Maybe<RefPtr<nsIURI>> loadedURI;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &unloadedURI) ||
|
if (!ReadIPDLParam(aReader, aActor, &unloadedURI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &loadedURI) ||
|
!ReadIPDLParam(aReader, aActor, &loadedURI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &type) ||
|
!ReadIPDLParam(aReader, aActor, &type) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mNavigationStartHighRes) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mNavigationStartHighRes) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mNavigationStart) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mNavigationStart) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mNonBlankPaint) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mNonBlankPaint) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mContentfulComposite) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mContentfulComposite) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mDOMContentFlushed) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mDOMContentFlushed) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mBeforeUnloadStart) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mBeforeUnloadStart) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mUnloadStart) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mUnloadStart) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mUnloadEnd) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mUnloadEnd) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mLoadEventStart) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mLoadEventStart) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mLoadEventEnd) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mLoadEventEnd) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mDOMLoading) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mDOMLoading) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mDOMInteractive) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mDOMInteractive) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor,
|
!ReadIPDLParam(aReader, aActor, &timing->mDOMContentLoadedEventStart) ||
|
||||||
&timing->mDOMContentLoadedEventStart) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mDOMContentLoadedEventEnd) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mDOMContentLoadedEventEnd) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mDOMComplete) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mDOMComplete) ||
|
!ReadIPDLParam(aReader, aActor, &timing->mTTFI) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &timing->mTTFI) ||
|
!ReadIPDLParam(aReader, aActor,
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor,
|
|
||||||
&timing->mDocShellHasBeenActiveSinceNavigationStart)) {
|
&timing->mDocShellHasBeenActiveSinceNavigationStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -261,10 +261,10 @@ namespace mozilla {
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsDOMNavigationTiming*> {
|
struct IPDLParamTraits<nsDOMNavigationTiming*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsDOMNavigationTiming* aParam);
|
nsDOMNavigationTiming* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<nsDOMNavigationTiming>* aResult);
|
RefPtr<nsDOMNavigationTiming>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -251,23 +251,24 @@ nsTArray<nsCString>& TErrorResult<CleanupPolicy>::CreateErrorMessageHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename CleanupPolicy>
|
template <typename CleanupPolicy>
|
||||||
void TErrorResult<CleanupPolicy>::SerializeMessage(IPC::Message* aMsg) const {
|
void TErrorResult<CleanupPolicy>::SerializeMessage(
|
||||||
|
IPC::MessageWriter* aWriter) const {
|
||||||
using namespace IPC;
|
using namespace IPC;
|
||||||
AssertInOwningThread();
|
AssertInOwningThread();
|
||||||
MOZ_ASSERT(mUnionState == HasMessage);
|
MOZ_ASSERT(mUnionState == HasMessage);
|
||||||
MOZ_ASSERT(mExtra.mMessage);
|
MOZ_ASSERT(mExtra.mMessage);
|
||||||
WriteParam(aMsg, mExtra.mMessage->mArgs);
|
WriteParam(aWriter, mExtra.mMessage->mArgs);
|
||||||
WriteParam(aMsg, mExtra.mMessage->mErrorNumber);
|
WriteParam(aWriter, mExtra.mMessage->mErrorNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename CleanupPolicy>
|
template <typename CleanupPolicy>
|
||||||
bool TErrorResult<CleanupPolicy>::DeserializeMessage(const IPC::Message* aMsg,
|
bool TErrorResult<CleanupPolicy>::DeserializeMessage(
|
||||||
PickleIterator* aIter) {
|
IPC::MessageReader* aReader) {
|
||||||
using namespace IPC;
|
using namespace IPC;
|
||||||
AssertInOwningThread();
|
AssertInOwningThread();
|
||||||
auto readMessage = MakeUnique<Message>();
|
auto readMessage = MakeUnique<Message>();
|
||||||
if (!ReadParam(aMsg, aIter, &readMessage->mArgs) ||
|
if (!ReadParam(aReader, &readMessage->mArgs) ||
|
||||||
!ReadParam(aMsg, aIter, &readMessage->mErrorNumber)) {
|
!ReadParam(aReader, &readMessage->mErrorNumber)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!readMessage->HasCorrectNumberOfArguments()) {
|
if (!readMessage->HasCorrectNumberOfArguments()) {
|
||||||
@ -392,23 +393,23 @@ struct TErrorResult<CleanupPolicy>::DOMExceptionInfo {
|
|||||||
|
|
||||||
template <typename CleanupPolicy>
|
template <typename CleanupPolicy>
|
||||||
void TErrorResult<CleanupPolicy>::SerializeDOMExceptionInfo(
|
void TErrorResult<CleanupPolicy>::SerializeDOMExceptionInfo(
|
||||||
IPC::Message* aMsg) const {
|
IPC::MessageWriter* aWriter) const {
|
||||||
using namespace IPC;
|
using namespace IPC;
|
||||||
AssertInOwningThread();
|
AssertInOwningThread();
|
||||||
MOZ_ASSERT(mUnionState == HasDOMExceptionInfo);
|
MOZ_ASSERT(mUnionState == HasDOMExceptionInfo);
|
||||||
MOZ_ASSERT(mExtra.mDOMExceptionInfo);
|
MOZ_ASSERT(mExtra.mDOMExceptionInfo);
|
||||||
WriteParam(aMsg, mExtra.mDOMExceptionInfo->mMessage);
|
WriteParam(aWriter, mExtra.mDOMExceptionInfo->mMessage);
|
||||||
WriteParam(aMsg, mExtra.mDOMExceptionInfo->mRv);
|
WriteParam(aWriter, mExtra.mDOMExceptionInfo->mRv);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename CleanupPolicy>
|
template <typename CleanupPolicy>
|
||||||
bool TErrorResult<CleanupPolicy>::DeserializeDOMExceptionInfo(
|
bool TErrorResult<CleanupPolicy>::DeserializeDOMExceptionInfo(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter) {
|
IPC::MessageReader* aReader) {
|
||||||
using namespace IPC;
|
using namespace IPC;
|
||||||
AssertInOwningThread();
|
AssertInOwningThread();
|
||||||
nsCString message;
|
nsCString message;
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
if (!ReadParam(aMsg, aIter, &message) || !ReadParam(aMsg, aIter, &rv)) {
|
if (!ReadParam(aReader, &message) || !ReadParam(aReader, &rv)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ template <>
|
|||||||
struct ParamTraits<mozilla::ErrorResult> {
|
struct ParamTraits<mozilla::ErrorResult> {
|
||||||
typedef mozilla::ErrorResult paramType;
|
typedef mozilla::ErrorResult paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
// It should be the case that mMightHaveUnreportedJSException can only be
|
// It should be the case that mMightHaveUnreportedJSException can only be
|
||||||
// true when we're expecting a JS exception. We cannot send such messages
|
// true when we're expecting a JS exception. We cannot send such messages
|
||||||
// over the IPC channel since there is no sane way of transferring the JS
|
// over the IPC channel since there is no sane way of transferring the JS
|
||||||
@ -42,43 +42,42 @@ struct ParamTraits<mozilla::ErrorResult> {
|
|||||||
"Cannot encode an ErrorResult representing a Javascript exception");
|
"Cannot encode an ErrorResult representing a Javascript exception");
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteParam(aMsg, aParam.mResult);
|
WriteParam(aWriter, aParam.mResult);
|
||||||
WriteParam(aMsg, aParam.IsErrorWithMessage());
|
WriteParam(aWriter, aParam.IsErrorWithMessage());
|
||||||
WriteParam(aMsg, aParam.IsDOMException());
|
WriteParam(aWriter, aParam.IsDOMException());
|
||||||
if (aParam.IsErrorWithMessage()) {
|
if (aParam.IsErrorWithMessage()) {
|
||||||
aParam.SerializeMessage(aMsg);
|
aParam.SerializeMessage(aWriter);
|
||||||
} else if (aParam.IsDOMException()) {
|
} else if (aParam.IsDOMException()) {
|
||||||
aParam.SerializeDOMExceptionInfo(aMsg);
|
aParam.SerializeDOMExceptionInfo(aWriter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Write(Message* aMsg, paramType&& aParam) {
|
static void Write(MessageWriter* aWriter, paramType&& aParam) {
|
||||||
Write(aMsg, static_cast<const paramType&>(aParam));
|
Write(aWriter, static_cast<const paramType&>(aParam));
|
||||||
aParam.SuppressException();
|
aParam.SuppressException();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
paramType readValue;
|
paramType readValue;
|
||||||
if (!ReadParam(aMsg, aIter, &readValue.mResult)) {
|
if (!ReadParam(aReader, &readValue.mResult)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool hasMessage = false;
|
bool hasMessage = false;
|
||||||
if (!ReadParam(aMsg, aIter, &hasMessage)) {
|
if (!ReadParam(aReader, &hasMessage)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool hasDOMExceptionInfo = false;
|
bool hasDOMExceptionInfo = false;
|
||||||
if (!ReadParam(aMsg, aIter, &hasDOMExceptionInfo)) {
|
if (!ReadParam(aReader, &hasDOMExceptionInfo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (hasMessage && hasDOMExceptionInfo) {
|
if (hasMessage && hasDOMExceptionInfo) {
|
||||||
// Shouldn't have both!
|
// Shouldn't have both!
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (hasMessage && !readValue.DeserializeMessage(aMsg, aIter)) {
|
if (hasMessage && !readValue.DeserializeMessage(aReader)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (hasDOMExceptionInfo &&
|
} else if (hasDOMExceptionInfo &&
|
||||||
!readValue.DeserializeDOMExceptionInfo(aMsg, aIter)) {
|
!readValue.DeserializeDOMExceptionInfo(aReader)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aResult = std::move(readValue);
|
*aResult = std::move(readValue);
|
||||||
@ -90,16 +89,15 @@ template <>
|
|||||||
struct ParamTraits<mozilla::CopyableErrorResult> {
|
struct ParamTraits<mozilla::CopyableErrorResult> {
|
||||||
typedef mozilla::CopyableErrorResult paramType;
|
typedef mozilla::CopyableErrorResult paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
ParamTraits<mozilla::ErrorResult>::Write(aMsg, aParam);
|
ParamTraits<mozilla::ErrorResult>::Write(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
// We can't cast *aResult to ErrorResult&, so cheat and just cast
|
// We can't cast *aResult to ErrorResult&, so cheat and just cast
|
||||||
// to ErrorResult*.
|
// to ErrorResult*.
|
||||||
return ParamTraits<mozilla::ErrorResult>::Read(
|
return ParamTraits<mozilla::ErrorResult>::Read(
|
||||||
aMsg, aIter, reinterpret_cast<mozilla::ErrorResult*>(aResult));
|
aReader, reinterpret_cast<mozilla::ErrorResult*>(aResult));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -476,12 +476,11 @@ class TErrorResult {
|
|||||||
|
|
||||||
friend struct IPC::ParamTraits<TErrorResult>;
|
friend struct IPC::ParamTraits<TErrorResult>;
|
||||||
friend struct IPC::ParamTraits<ErrorResult>;
|
friend struct IPC::ParamTraits<ErrorResult>;
|
||||||
void SerializeMessage(IPC::Message* aMsg) const;
|
void SerializeMessage(IPC::MessageWriter* aWriter) const;
|
||||||
bool DeserializeMessage(const IPC::Message* aMsg, PickleIterator* aIter);
|
bool DeserializeMessage(IPC::MessageReader* aReader);
|
||||||
|
|
||||||
void SerializeDOMExceptionInfo(IPC::Message* aMsg) const;
|
void SerializeDOMExceptionInfo(IPC::MessageWriter* aWriter) const;
|
||||||
bool DeserializeDOMExceptionInfo(const IPC::Message* aMsg,
|
bool DeserializeDOMExceptionInfo(IPC::MessageReader* aReader);
|
||||||
PickleIterator* aIter);
|
|
||||||
|
|
||||||
// Helper method that creates a new Message for this TErrorResult,
|
// Helper method that creates a new Message for this TErrorResult,
|
||||||
// and returns the arguments array from that Message.
|
// and returns the arguments array from that Message.
|
||||||
|
@ -115,15 +115,15 @@ template <>
|
|||||||
struct IPDLParamTraits<mozilla::webgl::FrontBufferSnapshotIpc> final {
|
struct IPDLParamTraits<mozilla::webgl::FrontBufferSnapshotIpc> final {
|
||||||
using T = mozilla::webgl::FrontBufferSnapshotIpc;
|
using T = mozilla::webgl::FrontBufferSnapshotIpc;
|
||||||
|
|
||||||
static void Write(IPC::Message* const msg, IProtocol* actor, T& in) {
|
static void Write(IPC::MessageWriter* const writer, IProtocol* actor, T& in) {
|
||||||
WriteParam(msg, in.surfSize);
|
WriteParam(writer, in.surfSize);
|
||||||
WriteIPDLParam(msg, actor, std::move(in.shmem));
|
WriteIPDLParam(writer, actor, std::move(in.shmem));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* const msg, PickleIterator* const itr,
|
static bool Read(IPC::MessageReader* const reader, IProtocol* actor,
|
||||||
IProtocol* actor, T* const out) {
|
T* const out) {
|
||||||
return ReadParam(msg, itr, &out->surfSize) &&
|
return ReadParam(reader, &out->surfSize) &&
|
||||||
ReadIPDLParam(msg, itr, actor, &out->shmem);
|
ReadIPDLParam(reader, actor, &out->shmem);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -133,17 +133,17 @@ template <>
|
|||||||
struct IPDLParamTraits<mozilla::webgl::ReadPixelsResultIpc> final {
|
struct IPDLParamTraits<mozilla::webgl::ReadPixelsResultIpc> final {
|
||||||
using T = mozilla::webgl::ReadPixelsResultIpc;
|
using T = mozilla::webgl::ReadPixelsResultIpc;
|
||||||
|
|
||||||
static void Write(IPC::Message* const msg, IProtocol* actor, T& in) {
|
static void Write(IPC::MessageWriter* const writer, IProtocol* actor, T& in) {
|
||||||
WriteParam(msg, in.subrect);
|
WriteParam(writer, in.subrect);
|
||||||
WriteParam(msg, in.byteStride);
|
WriteParam(writer, in.byteStride);
|
||||||
WriteIPDLParam(msg, actor, std::move(in.shmem));
|
WriteIPDLParam(writer, actor, std::move(in.shmem));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* const msg, PickleIterator* const itr,
|
static bool Read(IPC::MessageReader* const reader, IProtocol* actor,
|
||||||
IProtocol* actor, T* const out) {
|
T* const out) {
|
||||||
return ReadParam(msg, itr, &out->subrect) &&
|
return ReadParam(reader, &out->subrect) &&
|
||||||
ReadParam(msg, itr, &out->byteStride) &&
|
ReadParam(reader, &out->byteStride) &&
|
||||||
ReadIPDLParam(msg, itr, actor, &out->shmem);
|
ReadIPDLParam(reader, actor, &out->shmem);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -153,29 +153,30 @@ template <>
|
|||||||
struct IPDLParamTraits<mozilla::webgl::TexUnpackBlobDesc> final {
|
struct IPDLParamTraits<mozilla::webgl::TexUnpackBlobDesc> final {
|
||||||
using T = mozilla::webgl::TexUnpackBlobDesc;
|
using T = mozilla::webgl::TexUnpackBlobDesc;
|
||||||
|
|
||||||
static void Write(IPC::Message* const msg, IProtocol* actor, T&& in) {
|
static void Write(IPC::MessageWriter* const writer, IProtocol* actor,
|
||||||
WriteParam(msg, in.imageTarget);
|
T&& in) {
|
||||||
WriteParam(msg, in.size);
|
WriteParam(writer, in.imageTarget);
|
||||||
WriteParam(msg, in.srcAlphaType);
|
WriteParam(writer, in.size);
|
||||||
|
WriteParam(writer, in.srcAlphaType);
|
||||||
MOZ_RELEASE_ASSERT(!in.cpuData);
|
MOZ_RELEASE_ASSERT(!in.cpuData);
|
||||||
MOZ_RELEASE_ASSERT(!in.pboOffset);
|
MOZ_RELEASE_ASSERT(!in.pboOffset);
|
||||||
WriteParam(msg, in.structuredSrcSize);
|
WriteParam(writer, in.structuredSrcSize);
|
||||||
MOZ_RELEASE_ASSERT(!in.image);
|
MOZ_RELEASE_ASSERT(!in.image);
|
||||||
WriteIPDLParam(msg, actor, std::move(in.sd));
|
WriteIPDLParam(writer, actor, std::move(in.sd));
|
||||||
MOZ_RELEASE_ASSERT(!in.dataSurf);
|
MOZ_RELEASE_ASSERT(!in.dataSurf);
|
||||||
WriteParam(msg, in.unpacking);
|
WriteParam(writer, in.unpacking);
|
||||||
WriteParam(msg, in.applyUnpackTransforms);
|
WriteParam(writer, in.applyUnpackTransforms);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* const msg, PickleIterator* const itr,
|
static bool Read(IPC::MessageReader* const reader, IProtocol* actor,
|
||||||
IProtocol* actor, T* const out) {
|
T* const out) {
|
||||||
return ReadParam(msg, itr, &out->imageTarget) &&
|
return ReadParam(reader, &out->imageTarget) &&
|
||||||
ReadParam(msg, itr, &out->size) &&
|
ReadParam(reader, &out->size) &&
|
||||||
ReadParam(msg, itr, &out->srcAlphaType) &&
|
ReadParam(reader, &out->srcAlphaType) &&
|
||||||
ReadParam(msg, itr, &out->structuredSrcSize) &&
|
ReadParam(reader, &out->structuredSrcSize) &&
|
||||||
ReadIPDLParam(msg, itr, actor, &out->sd) &&
|
ReadIPDLParam(reader, actor, &out->sd) &&
|
||||||
ReadParam(msg, itr, &out->unpacking) &&
|
ReadParam(reader, &out->unpacking) &&
|
||||||
ReadParam(msg, itr, &out->applyUnpackTransforms);
|
ReadParam(reader, &out->applyUnpackTransforms);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -216,14 +217,13 @@ bool ValidateParam(const T& val) {
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct ValidatedPlainOldDataSerializer : public PlainOldDataSerializer<T> {
|
struct ValidatedPlainOldDataSerializer : public PlainOldDataSerializer<T> {
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
MOZ_ASSERT(ValidateParam(in));
|
MOZ_ASSERT(ValidateParam(in));
|
||||||
PlainOldDataSerializer<T>::Write(msg, in);
|
PlainOldDataSerializer<T>::Write(writer, in);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
if (!PlainOldDataSerializer<T>::Read(reader, out)) return false;
|
||||||
if (!PlainOldDataSerializer<T>::Read(msg, itr, out)) return false;
|
|
||||||
return ValidateParam(*out);
|
return ValidateParam(*out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,19 +276,17 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::InitContextResult> final {
|
struct ParamTraits<mozilla::webgl::InitContextResult> final {
|
||||||
using T = mozilla::webgl::InitContextResult;
|
using T = mozilla::webgl::InitContextResult;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.error);
|
WriteParam(writer, in.error);
|
||||||
WriteParam(msg, in.options);
|
WriteParam(writer, in.options);
|
||||||
WriteParam(msg, in.limits);
|
WriteParam(writer, in.limits);
|
||||||
WriteParam(msg, in.uploadableSdTypes);
|
WriteParam(writer, in.uploadableSdTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->error) && ReadParam(reader, &out->options) &&
|
||||||
return ReadParam(msg, itr, &out->error) &&
|
ReadParam(reader, &out->limits) &&
|
||||||
ReadParam(msg, itr, &out->options) &&
|
ReadParam(reader, &out->uploadableSdTypes);
|
||||||
ReadParam(msg, itr, &out->limits) &&
|
|
||||||
ReadParam(msg, itr, &out->uploadableSdTypes);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -313,18 +311,17 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::ReadPixelsDesc> final {
|
struct ParamTraits<mozilla::webgl::ReadPixelsDesc> final {
|
||||||
using T = mozilla::webgl::ReadPixelsDesc;
|
using T = mozilla::webgl::ReadPixelsDesc;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.srcOffset);
|
WriteParam(writer, in.srcOffset);
|
||||||
WriteParam(msg, in.size);
|
WriteParam(writer, in.size);
|
||||||
WriteParam(msg, in.pi);
|
WriteParam(writer, in.pi);
|
||||||
WriteParam(msg, in.packState);
|
WriteParam(writer, in.packState);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->srcOffset) &&
|
||||||
return ReadParam(msg, itr, &out->srcOffset) &&
|
ReadParam(reader, &out->size) && ReadParam(reader, &out->pi) &&
|
||||||
ReadParam(msg, itr, &out->size) && ReadParam(msg, itr, &out->pi) &&
|
ReadParam(reader, &out->packState);
|
||||||
ReadParam(msg, itr, &out->packState);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -334,14 +331,13 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::PackingInfo> final {
|
struct ParamTraits<mozilla::webgl::PackingInfo> final {
|
||||||
using T = mozilla::webgl::PackingInfo;
|
using T = mozilla::webgl::PackingInfo;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.format);
|
WriteParam(writer, in.format);
|
||||||
WriteParam(msg, in.type);
|
WriteParam(writer, in.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->format) && ReadParam(reader, &out->type);
|
||||||
return ReadParam(msg, itr, &out->format) && ReadParam(msg, itr, &out->type);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -351,19 +347,17 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::CompileResult> final {
|
struct ParamTraits<mozilla::webgl::CompileResult> final {
|
||||||
using T = mozilla::webgl::CompileResult;
|
using T = mozilla::webgl::CompileResult;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.pending);
|
WriteParam(writer, in.pending);
|
||||||
WriteParam(msg, in.log);
|
WriteParam(writer, in.log);
|
||||||
WriteParam(msg, in.translatedSource);
|
WriteParam(writer, in.translatedSource);
|
||||||
WriteParam(msg, in.success);
|
WriteParam(writer, in.success);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->pending) && ReadParam(reader, &out->log) &&
|
||||||
return ReadParam(msg, itr, &out->pending) &&
|
ReadParam(reader, &out->translatedSource) &&
|
||||||
ReadParam(msg, itr, &out->log) &&
|
ReadParam(reader, &out->success);
|
||||||
ReadParam(msg, itr, &out->translatedSource) &&
|
|
||||||
ReadParam(msg, itr, &out->success);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -373,21 +367,19 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::LinkResult> final {
|
struct ParamTraits<mozilla::webgl::LinkResult> final {
|
||||||
using T = mozilla::webgl::LinkResult;
|
using T = mozilla::webgl::LinkResult;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.pending);
|
WriteParam(writer, in.pending);
|
||||||
WriteParam(msg, in.log);
|
WriteParam(writer, in.log);
|
||||||
WriteParam(msg, in.success);
|
WriteParam(writer, in.success);
|
||||||
WriteParam(msg, in.active);
|
WriteParam(writer, in.active);
|
||||||
WriteParam(msg, in.tfBufferMode);
|
WriteParam(writer, in.tfBufferMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->pending) && ReadParam(reader, &out->log) &&
|
||||||
return ReadParam(msg, itr, &out->pending) &&
|
ReadParam(reader, &out->success) &&
|
||||||
ReadParam(msg, itr, &out->log) &&
|
ReadParam(reader, &out->active) &&
|
||||||
ReadParam(msg, itr, &out->success) &&
|
ReadParam(reader, &out->tfBufferMode);
|
||||||
ReadParam(msg, itr, &out->active) &&
|
|
||||||
ReadParam(msg, itr, &out->tfBufferMode);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -397,19 +389,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::LinkActiveInfo> final {
|
struct ParamTraits<mozilla::webgl::LinkActiveInfo> final {
|
||||||
using T = mozilla::webgl::LinkActiveInfo;
|
using T = mozilla::webgl::LinkActiveInfo;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.activeAttribs);
|
WriteParam(writer, in.activeAttribs);
|
||||||
WriteParam(msg, in.activeUniforms);
|
WriteParam(writer, in.activeUniforms);
|
||||||
WriteParam(msg, in.activeUniformBlocks);
|
WriteParam(writer, in.activeUniformBlocks);
|
||||||
WriteParam(msg, in.activeTfVaryings);
|
WriteParam(writer, in.activeTfVaryings);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->activeAttribs) &&
|
||||||
return ReadParam(msg, itr, &out->activeAttribs) &&
|
ReadParam(reader, &out->activeUniforms) &&
|
||||||
ReadParam(msg, itr, &out->activeUniforms) &&
|
ReadParam(reader, &out->activeUniformBlocks) &&
|
||||||
ReadParam(msg, itr, &out->activeUniformBlocks) &&
|
ReadParam(reader, &out->activeTfVaryings);
|
||||||
ReadParam(msg, itr, &out->activeTfVaryings);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -419,17 +410,15 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::ActiveInfo> final {
|
struct ParamTraits<mozilla::webgl::ActiveInfo> final {
|
||||||
using T = mozilla::webgl::ActiveInfo;
|
using T = mozilla::webgl::ActiveInfo;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.elemType);
|
WriteParam(writer, in.elemType);
|
||||||
WriteParam(msg, in.elemCount);
|
WriteParam(writer, in.elemCount);
|
||||||
WriteParam(msg, in.name);
|
WriteParam(writer, in.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->elemType) &&
|
||||||
return ReadParam(msg, itr, &out->elemType) &&
|
ReadParam(reader, &out->elemCount) && ReadParam(reader, &out->name);
|
||||||
ReadParam(msg, itr, &out->elemCount) &&
|
|
||||||
ReadParam(msg, itr, &out->name);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -439,17 +428,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::ActiveAttribInfo> final {
|
struct ParamTraits<mozilla::webgl::ActiveAttribInfo> final {
|
||||||
using T = mozilla::webgl::ActiveAttribInfo;
|
using T = mozilla::webgl::ActiveAttribInfo;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, static_cast<const mozilla::webgl::ActiveInfo&>(in));
|
WriteParam(writer, static_cast<const mozilla::webgl::ActiveInfo&>(in));
|
||||||
WriteParam(msg, in.location);
|
WriteParam(writer, in.location);
|
||||||
WriteParam(msg, in.baseType);
|
WriteParam(writer, in.baseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, static_cast<mozilla::webgl::ActiveInfo*>(out)) &&
|
||||||
return ReadParam(msg, itr, static_cast<mozilla::webgl::ActiveInfo*>(out)) &&
|
ReadParam(reader, &out->location) &&
|
||||||
ReadParam(msg, itr, &out->location) &&
|
ReadParam(reader, &out->baseType);
|
||||||
ReadParam(msg, itr, &out->baseType);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -459,25 +447,24 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::ActiveUniformInfo> final {
|
struct ParamTraits<mozilla::webgl::ActiveUniformInfo> final {
|
||||||
using T = mozilla::webgl::ActiveUniformInfo;
|
using T = mozilla::webgl::ActiveUniformInfo;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, static_cast<const mozilla::webgl::ActiveInfo&>(in));
|
WriteParam(writer, static_cast<const mozilla::webgl::ActiveInfo&>(in));
|
||||||
WriteParam(msg, in.locByIndex);
|
WriteParam(writer, in.locByIndex);
|
||||||
WriteParam(msg, in.block_index);
|
WriteParam(writer, in.block_index);
|
||||||
WriteParam(msg, in.block_offset);
|
WriteParam(writer, in.block_offset);
|
||||||
WriteParam(msg, in.block_arrayStride);
|
WriteParam(writer, in.block_arrayStride);
|
||||||
WriteParam(msg, in.block_matrixStride);
|
WriteParam(writer, in.block_matrixStride);
|
||||||
WriteParam(msg, in.block_isRowMajor);
|
WriteParam(writer, in.block_isRowMajor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, static_cast<mozilla::webgl::ActiveInfo*>(out)) &&
|
||||||
return ReadParam(msg, itr, static_cast<mozilla::webgl::ActiveInfo*>(out)) &&
|
ReadParam(reader, &out->locByIndex) &&
|
||||||
ReadParam(msg, itr, &out->locByIndex) &&
|
ReadParam(reader, &out->block_index) &&
|
||||||
ReadParam(msg, itr, &out->block_index) &&
|
ReadParam(reader, &out->block_offset) &&
|
||||||
ReadParam(msg, itr, &out->block_offset) &&
|
ReadParam(reader, &out->block_arrayStride) &&
|
||||||
ReadParam(msg, itr, &out->block_arrayStride) &&
|
ReadParam(reader, &out->block_matrixStride) &&
|
||||||
ReadParam(msg, itr, &out->block_matrixStride) &&
|
ReadParam(reader, &out->block_isRowMajor);
|
||||||
ReadParam(msg, itr, &out->block_isRowMajor);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -487,21 +474,19 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::ActiveUniformBlockInfo> final {
|
struct ParamTraits<mozilla::webgl::ActiveUniformBlockInfo> final {
|
||||||
using T = mozilla::webgl::ActiveUniformBlockInfo;
|
using T = mozilla::webgl::ActiveUniformBlockInfo;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.name);
|
WriteParam(writer, in.name);
|
||||||
WriteParam(msg, in.dataSize);
|
WriteParam(writer, in.dataSize);
|
||||||
WriteParam(msg, in.activeUniformIndices);
|
WriteParam(writer, in.activeUniformIndices);
|
||||||
WriteParam(msg, in.referencedByVertexShader);
|
WriteParam(writer, in.referencedByVertexShader);
|
||||||
WriteParam(msg, in.referencedByFragmentShader);
|
WriteParam(writer, in.referencedByFragmentShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->name) && ReadParam(reader, &out->dataSize) &&
|
||||||
return ReadParam(msg, itr, &out->name) &&
|
ReadParam(reader, &out->activeUniformIndices) &&
|
||||||
ReadParam(msg, itr, &out->dataSize) &&
|
ReadParam(reader, &out->referencedByVertexShader) &&
|
||||||
ReadParam(msg, itr, &out->activeUniformIndices) &&
|
ReadParam(reader, &out->referencedByFragmentShader);
|
||||||
ReadParam(msg, itr, &out->referencedByVertexShader) &&
|
|
||||||
ReadParam(msg, itr, &out->referencedByFragmentShader);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -511,17 +496,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::ShaderPrecisionFormat> final {
|
struct ParamTraits<mozilla::webgl::ShaderPrecisionFormat> final {
|
||||||
using T = mozilla::webgl::ShaderPrecisionFormat;
|
using T = mozilla::webgl::ShaderPrecisionFormat;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.rangeMin);
|
WriteParam(writer, in.rangeMin);
|
||||||
WriteParam(msg, in.rangeMax);
|
WriteParam(writer, in.rangeMax);
|
||||||
WriteParam(msg, in.precision);
|
WriteParam(writer, in.precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->rangeMin) &&
|
||||||
return ReadParam(msg, itr, &out->rangeMin) &&
|
ReadParam(reader, &out->rangeMax) &&
|
||||||
ReadParam(msg, itr, &out->rangeMax) &&
|
ReadParam(reader, &out->precision);
|
||||||
ReadParam(msg, itr, &out->precision);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -534,16 +518,15 @@ struct ParamTraits<U[N]> final {
|
|||||||
|
|
||||||
static_assert(std::is_trivial<U>::value);
|
static_assert(std::is_trivial<U>::value);
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
msg->WriteBytes(in, kByteSize);
|
writer->WriteBytes(in, kByteSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
if (!reader->HasBytesAvailable(kByteSize)) {
|
||||||
if (!msg->HasBytesAvailable(itr, kByteSize)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return msg->ReadBytesInto(itr, *out, kByteSize);
|
return reader->ReadBytesInto(*out, kByteSize);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -553,15 +536,14 @@ template <>
|
|||||||
struct ParamTraits<mozilla::webgl::GetUniformData> final {
|
struct ParamTraits<mozilla::webgl::GetUniformData> final {
|
||||||
using T = mozilla::webgl::GetUniformData;
|
using T = mozilla::webgl::GetUniformData;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
ParamTraits<decltype(in.data)>::Write(msg, in.data);
|
ParamTraits<decltype(in.data)>::Write(writer, in.data);
|
||||||
WriteParam(msg, in.type);
|
WriteParam(writer, in.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ParamTraits<decltype(out->data)>::Read(reader, &out->data) &&
|
||||||
return ParamTraits<decltype(out->data)>::Read(msg, itr, &out->data) &&
|
ReadParam(reader, &out->type);
|
||||||
ReadParam(msg, itr, &out->type);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -571,14 +553,13 @@ template <typename U>
|
|||||||
struct ParamTraits<mozilla::avec2<U>> final {
|
struct ParamTraits<mozilla::avec2<U>> final {
|
||||||
using T = mozilla::avec2<U>;
|
using T = mozilla::avec2<U>;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.x);
|
WriteParam(writer, in.x);
|
||||||
WriteParam(msg, in.y);
|
WriteParam(writer, in.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->x) && ReadParam(reader, &out->y);
|
||||||
return ReadParam(msg, itr, &out->x) && ReadParam(msg, itr, &out->y);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -588,16 +569,15 @@ template <typename U>
|
|||||||
struct ParamTraits<mozilla::avec3<U>> final {
|
struct ParamTraits<mozilla::avec3<U>> final {
|
||||||
using T = mozilla::avec3<U>;
|
using T = mozilla::avec3<U>;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.x);
|
WriteParam(writer, in.x);
|
||||||
WriteParam(msg, in.y);
|
WriteParam(writer, in.y);
|
||||||
WriteParam(msg, in.z);
|
WriteParam(writer, in.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
return ReadParam(reader, &out->x) && ReadParam(reader, &out->y) &&
|
||||||
return ReadParam(msg, itr, &out->x) && ReadParam(msg, itr, &out->y) &&
|
ReadParam(reader, &out->z);
|
||||||
ReadParam(msg, itr, &out->z);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -780,38 +780,39 @@ double Event::TimeStamp() {
|
|||||||
workerPrivate->CrossOriginIsolated());
|
workerPrivate->CrossOriginIsolated());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) {
|
void Event::Serialize(IPC::MessageWriter* aWriter,
|
||||||
|
bool aSerializeInterfaceType) {
|
||||||
if (aSerializeInterfaceType) {
|
if (aSerializeInterfaceType) {
|
||||||
IPC::WriteParam(aMsg, u"event"_ns);
|
IPC::WriteParam(aWriter, u"event"_ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsString type;
|
nsString type;
|
||||||
GetType(type);
|
GetType(type);
|
||||||
IPC::WriteParam(aMsg, type);
|
IPC::WriteParam(aWriter, type);
|
||||||
|
|
||||||
IPC::WriteParam(aMsg, Bubbles());
|
IPC::WriteParam(aWriter, Bubbles());
|
||||||
IPC::WriteParam(aMsg, Cancelable());
|
IPC::WriteParam(aWriter, Cancelable());
|
||||||
IPC::WriteParam(aMsg, IsTrusted());
|
IPC::WriteParam(aWriter, IsTrusted());
|
||||||
IPC::WriteParam(aMsg, Composed());
|
IPC::WriteParam(aWriter, Composed());
|
||||||
|
|
||||||
// No timestamp serialization for now!
|
// No timestamp serialization for now!
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Event::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) {
|
bool Event::Deserialize(IPC::MessageReader* aReader) {
|
||||||
nsString type;
|
nsString type;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &type), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &type), false);
|
||||||
|
|
||||||
bool bubbles = false;
|
bool bubbles = false;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &bubbles), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &bubbles), false);
|
||||||
|
|
||||||
bool cancelable = false;
|
bool cancelable = false;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &cancelable), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &cancelable), false);
|
||||||
|
|
||||||
bool trusted = false;
|
bool trusted = false;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &trusted), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &trusted), false);
|
||||||
|
|
||||||
bool composed = false;
|
bool composed = false;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &composed), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &composed), false);
|
||||||
|
|
||||||
InitEvent(type, bubbles, cancelable);
|
InitEvent(type, bubbles, cancelable);
|
||||||
SetTrusted(trusted);
|
SetTrusted(trusted);
|
||||||
|
@ -144,8 +144,9 @@ class Event : public nsISupports, public nsWrapperCache {
|
|||||||
const WidgetEvent* WidgetEventPtr() const {
|
const WidgetEvent* WidgetEventPtr() const {
|
||||||
return const_cast<Event*>(this)->WidgetEventPtr();
|
return const_cast<Event*>(this)->WidgetEventPtr();
|
||||||
}
|
}
|
||||||
virtual void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
|
virtual void Serialize(IPC::MessageWriter* aWriter,
|
||||||
virtual bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter);
|
bool aSerializeInterfaceType);
|
||||||
|
virtual bool Deserialize(IPC::MessageReader* aReader);
|
||||||
void SetOwner(EventTarget* aOwner);
|
void SetOwner(EventTarget* aOwner);
|
||||||
void StopCrossProcessForwarding();
|
void StopCrossProcessForwarding();
|
||||||
void SetTrusted(bool aTrusted);
|
void SetTrusted(bool aTrusted);
|
||||||
|
@ -79,31 +79,30 @@ already_AddRefed<PaintRequestList> NotifyPaintEvent::PaintRequests(
|
|||||||
return requests.forget();
|
return requests.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyPaintEvent::Serialize(IPC::Message* aMsg,
|
void NotifyPaintEvent::Serialize(IPC::MessageWriter* aWriter,
|
||||||
bool aSerializeInterfaceType) {
|
bool aSerializeInterfaceType) {
|
||||||
if (aSerializeInterfaceType) {
|
if (aSerializeInterfaceType) {
|
||||||
IPC::WriteParam(aMsg, u"notifypaintevent"_ns);
|
IPC::WriteParam(aWriter, u"notifypaintevent"_ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::Serialize(aMsg, false);
|
Event::Serialize(aWriter, false);
|
||||||
|
|
||||||
uint32_t length = mInvalidateRequests.Length();
|
uint32_t length = mInvalidateRequests.Length();
|
||||||
IPC::WriteParam(aMsg, length);
|
IPC::WriteParam(aWriter, length);
|
||||||
for (uint32_t i = 0; i < length; ++i) {
|
for (uint32_t i = 0; i < length; ++i) {
|
||||||
IPC::WriteParam(aMsg, mInvalidateRequests[i]);
|
IPC::WriteParam(aWriter, mInvalidateRequests[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotifyPaintEvent::Deserialize(const IPC::Message* aMsg,
|
bool NotifyPaintEvent::Deserialize(IPC::MessageReader* aReader) {
|
||||||
PickleIterator* aIter) {
|
NS_ENSURE_TRUE(Event::Deserialize(aReader), false);
|
||||||
NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
|
|
||||||
|
|
||||||
uint32_t length = 0;
|
uint32_t length = 0;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &length), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &length), false);
|
||||||
mInvalidateRequests.SetCapacity(length);
|
mInvalidateRequests.SetCapacity(length);
|
||||||
for (uint32_t i = 0; i < length; ++i) {
|
for (uint32_t i = 0; i < length; ++i) {
|
||||||
nsRect req;
|
nsRect req;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &req), false);
|
||||||
mInvalidateRequests.AppendElement(req);
|
mInvalidateRequests.AppendElement(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,9 @@ class NotifyPaintEvent : public Event {
|
|||||||
|
|
||||||
NS_INLINE_DECL_REFCOUNTING_INHERITED(NotifyPaintEvent, Event)
|
NS_INLINE_DECL_REFCOUNTING_INHERITED(NotifyPaintEvent, Event)
|
||||||
|
|
||||||
void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
|
void Serialize(IPC::MessageWriter* aWriter,
|
||||||
bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
|
bool aSerializeInterfaceType) override;
|
||||||
|
bool Deserialize(IPC::MessageReader* aReader) override;
|
||||||
|
|
||||||
virtual JSObject* WrapObjectInternal(
|
virtual JSObject* WrapObjectInternal(
|
||||||
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
|
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
|
||||||
|
@ -38,29 +38,28 @@ void ScrollAreaEvent::InitScrollAreaEvent(const nsAString& aEventType,
|
|||||||
mClientArea->SetRect(aX, aY, aWidth, aHeight);
|
mClientArea->SetRect(aX, aY, aWidth, aHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollAreaEvent::Serialize(IPC::Message* aMsg,
|
void ScrollAreaEvent::Serialize(IPC::MessageWriter* aWriter,
|
||||||
bool aSerializeInterfaceType) {
|
bool aSerializeInterfaceType) {
|
||||||
if (aSerializeInterfaceType) {
|
if (aSerializeInterfaceType) {
|
||||||
IPC::WriteParam(aMsg, u"scrollareaevent"_ns);
|
IPC::WriteParam(aWriter, u"scrollareaevent"_ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::Serialize(aMsg, false);
|
Event::Serialize(aWriter, false);
|
||||||
|
|
||||||
IPC::WriteParam(aMsg, X());
|
IPC::WriteParam(aWriter, X());
|
||||||
IPC::WriteParam(aMsg, Y());
|
IPC::WriteParam(aWriter, Y());
|
||||||
IPC::WriteParam(aMsg, Width());
|
IPC::WriteParam(aWriter, Width());
|
||||||
IPC::WriteParam(aMsg, Height());
|
IPC::WriteParam(aWriter, Height());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScrollAreaEvent::Deserialize(const IPC::Message* aMsg,
|
bool ScrollAreaEvent::Deserialize(IPC::MessageReader* aReader) {
|
||||||
PickleIterator* aIter) {
|
NS_ENSURE_TRUE(Event::Deserialize(aReader), false);
|
||||||
NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
|
|
||||||
|
|
||||||
float x, y, width, height;
|
float x, y, width, height;
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &x), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &x), false);
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &y), false);
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &width), false);
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &height), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &height), false);
|
||||||
mClientArea->SetRect(x, y, width, height);
|
mClientArea->SetRect(x, y, width, height);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -24,8 +24,9 @@ class ScrollAreaEvent : public UIEvent {
|
|||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ScrollAreaEvent, UIEvent)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ScrollAreaEvent, UIEvent)
|
||||||
|
|
||||||
void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
|
void Serialize(IPC::MessageWriter* aWriter,
|
||||||
bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
|
bool aSerializeInterfaceType) override;
|
||||||
|
bool Deserialize(IPC::MessageReader* aReader) override;
|
||||||
|
|
||||||
virtual JSObject* WrapObjectInternal(
|
virtual JSObject* WrapObjectInternal(
|
||||||
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
|
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
|
||||||
|
@ -207,19 +207,20 @@ void UIEvent::DuplicatePrivateData() {
|
|||||||
mEvent->mRefPoint = RoundedToInt(screenPoint * scale);
|
mEvent->mRefPoint = RoundedToInt(screenPoint * scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIEvent::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) {
|
void UIEvent::Serialize(IPC::MessageWriter* aWriter,
|
||||||
|
bool aSerializeInterfaceType) {
|
||||||
if (aSerializeInterfaceType) {
|
if (aSerializeInterfaceType) {
|
||||||
IPC::WriteParam(aMsg, u"uievent"_ns);
|
IPC::WriteParam(aWriter, u"uievent"_ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::Serialize(aMsg, false);
|
Event::Serialize(aWriter, false);
|
||||||
|
|
||||||
IPC::WriteParam(aMsg, Detail());
|
IPC::WriteParam(aWriter, Detail());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UIEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) {
|
bool UIEvent::Deserialize(IPC::MessageReader* aReader) {
|
||||||
NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
|
NS_ENSURE_TRUE(Event::Deserialize(aReader), false);
|
||||||
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &mDetail), false);
|
NS_ENSURE_TRUE(IPC::ReadParam(aReader, &mDetail), false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,9 @@ class UIEvent : public Event {
|
|||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(UIEvent, Event)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(UIEvent, Event)
|
||||||
|
|
||||||
void DuplicatePrivateData() override;
|
void DuplicatePrivateData() override;
|
||||||
void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
|
void Serialize(IPC::MessageWriter* aWriter,
|
||||||
bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
|
bool aSerializeInterfaceType) override;
|
||||||
|
bool Deserialize(IPC::MessageReader* aReader) override;
|
||||||
|
|
||||||
static already_AddRefed<UIEvent> Constructor(const GlobalObject& aGlobal,
|
static already_AddRefed<UIEvent> Constructor(const GlobalObject& aGlobal,
|
||||||
const nsAString& aType,
|
const nsAString& aType,
|
||||||
|
@ -195,32 +195,33 @@ nsresult SerializeUntyped(BlobImpl* aBlobImpl, IProtocol* aActor,
|
|||||||
|
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
void IPDLParamTraits<mozilla::dom::BlobImpl*>::Write(
|
void IPDLParamTraits<mozilla::dom::BlobImpl*>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor, mozilla::dom::BlobImpl* aParam) {
|
IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
mozilla::dom::BlobImpl* aParam) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
mozilla::dom::IPCBlob ipcblob;
|
mozilla::dom::IPCBlob ipcblob;
|
||||||
if (aParam) {
|
if (aParam) {
|
||||||
rv = mozilla::dom::IPCBlobUtils::SerializeUntyped(aParam, aActor, ipcblob);
|
rv = mozilla::dom::IPCBlobUtils::SerializeUntyped(aParam, aActor, ipcblob);
|
||||||
}
|
}
|
||||||
if (!aParam || NS_WARN_IF(NS_FAILED(rv))) {
|
if (!aParam || NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
WriteIPDLParam(aMsg, aActor, false);
|
WriteIPDLParam(aWriter, aActor, false);
|
||||||
} else {
|
} else {
|
||||||
WriteIPDLParam(aMsg, aActor, true);
|
WriteIPDLParam(aWriter, aActor, true);
|
||||||
WriteIPDLParam(aMsg, aActor, ipcblob);
|
WriteIPDLParam(aWriter, aActor, ipcblob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<mozilla::dom::BlobImpl*>::Read(
|
bool IPDLParamTraits<mozilla::dom::BlobImpl*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
RefPtr<mozilla::dom::BlobImpl>* aResult) {
|
RefPtr<mozilla::dom::BlobImpl>* aResult) {
|
||||||
*aResult = nullptr;
|
*aResult = nullptr;
|
||||||
|
|
||||||
bool notnull = false;
|
bool notnull = false;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, ¬null)) {
|
if (!ReadIPDLParam(aReader, aActor, ¬null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (notnull) {
|
if (notnull) {
|
||||||
mozilla::dom::IPCBlob ipcblob;
|
mozilla::dom::IPCBlob ipcblob;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &ipcblob)) {
|
if (!ReadIPDLParam(aReader, aActor, &ipcblob)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aResult = mozilla::dom::IPCBlobUtils::Deserialize(ipcblob);
|
*aResult = mozilla::dom::IPCBlobUtils::Deserialize(ipcblob);
|
||||||
|
@ -285,10 +285,10 @@ namespace ipc {
|
|||||||
// __always make sure to handle null!__
|
// __always make sure to handle null!__
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<mozilla::dom::BlobImpl*> {
|
struct IPDLParamTraits<mozilla::dom::BlobImpl*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
mozilla::dom::BlobImpl* aParam);
|
mozilla::dom::BlobImpl* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<mozilla::dom::BlobImpl>* aResult);
|
RefPtr<mozilla::dom::BlobImpl>* aResult);
|
||||||
};
|
};
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -47,55 +47,54 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::GamepadPoseState> {
|
struct ParamTraits<mozilla::dom::GamepadPoseState> {
|
||||||
typedef mozilla::dom::GamepadPoseState paramType;
|
typedef mozilla::dom::GamepadPoseState paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.flags);
|
WriteParam(aWriter, aParam.flags);
|
||||||
WriteParam(aMsg, aParam.orientation[0]);
|
WriteParam(aWriter, aParam.orientation[0]);
|
||||||
WriteParam(aMsg, aParam.orientation[1]);
|
WriteParam(aWriter, aParam.orientation[1]);
|
||||||
WriteParam(aMsg, aParam.orientation[2]);
|
WriteParam(aWriter, aParam.orientation[2]);
|
||||||
WriteParam(aMsg, aParam.orientation[3]);
|
WriteParam(aWriter, aParam.orientation[3]);
|
||||||
WriteParam(aMsg, aParam.position[0]);
|
WriteParam(aWriter, aParam.position[0]);
|
||||||
WriteParam(aMsg, aParam.position[1]);
|
WriteParam(aWriter, aParam.position[1]);
|
||||||
WriteParam(aMsg, aParam.position[2]);
|
WriteParam(aWriter, aParam.position[2]);
|
||||||
WriteParam(aMsg, aParam.angularVelocity[0]);
|
WriteParam(aWriter, aParam.angularVelocity[0]);
|
||||||
WriteParam(aMsg, aParam.angularVelocity[1]);
|
WriteParam(aWriter, aParam.angularVelocity[1]);
|
||||||
WriteParam(aMsg, aParam.angularVelocity[2]);
|
WriteParam(aWriter, aParam.angularVelocity[2]);
|
||||||
WriteParam(aMsg, aParam.angularAcceleration[0]);
|
WriteParam(aWriter, aParam.angularAcceleration[0]);
|
||||||
WriteParam(aMsg, aParam.angularAcceleration[1]);
|
WriteParam(aWriter, aParam.angularAcceleration[1]);
|
||||||
WriteParam(aMsg, aParam.angularAcceleration[2]);
|
WriteParam(aWriter, aParam.angularAcceleration[2]);
|
||||||
WriteParam(aMsg, aParam.linearVelocity[0]);
|
WriteParam(aWriter, aParam.linearVelocity[0]);
|
||||||
WriteParam(aMsg, aParam.linearVelocity[1]);
|
WriteParam(aWriter, aParam.linearVelocity[1]);
|
||||||
WriteParam(aMsg, aParam.linearVelocity[2]);
|
WriteParam(aWriter, aParam.linearVelocity[2]);
|
||||||
WriteParam(aMsg, aParam.linearAcceleration[0]);
|
WriteParam(aWriter, aParam.linearAcceleration[0]);
|
||||||
WriteParam(aMsg, aParam.linearAcceleration[1]);
|
WriteParam(aWriter, aParam.linearAcceleration[1]);
|
||||||
WriteParam(aMsg, aParam.linearAcceleration[2]);
|
WriteParam(aWriter, aParam.linearAcceleration[2]);
|
||||||
WriteParam(aMsg, aParam.isPositionValid);
|
WriteParam(aWriter, aParam.isPositionValid);
|
||||||
WriteParam(aMsg, aParam.isOrientationValid);
|
WriteParam(aWriter, aParam.isOrientationValid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->flags)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->flags)) ||
|
!ReadParam(aReader, &(aResult->orientation[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->orientation[0])) ||
|
!ReadParam(aReader, &(aResult->orientation[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->orientation[1])) ||
|
!ReadParam(aReader, &(aResult->orientation[2])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->orientation[2])) ||
|
!ReadParam(aReader, &(aResult->orientation[3])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->orientation[3])) ||
|
!ReadParam(aReader, &(aResult->position[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->position[0])) ||
|
!ReadParam(aReader, &(aResult->position[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->position[1])) ||
|
!ReadParam(aReader, &(aResult->position[2])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->position[2])) ||
|
!ReadParam(aReader, &(aResult->angularVelocity[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->angularVelocity[0])) ||
|
!ReadParam(aReader, &(aResult->angularVelocity[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->angularVelocity[1])) ||
|
!ReadParam(aReader, &(aResult->angularVelocity[2])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->angularVelocity[2])) ||
|
!ReadParam(aReader, &(aResult->angularAcceleration[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->angularAcceleration[0])) ||
|
!ReadParam(aReader, &(aResult->angularAcceleration[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->angularAcceleration[1])) ||
|
!ReadParam(aReader, &(aResult->angularAcceleration[2])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->angularAcceleration[2])) ||
|
!ReadParam(aReader, &(aResult->linearVelocity[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->linearVelocity[0])) ||
|
!ReadParam(aReader, &(aResult->linearVelocity[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->linearVelocity[1])) ||
|
!ReadParam(aReader, &(aResult->linearVelocity[2])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->linearVelocity[2])) ||
|
!ReadParam(aReader, &(aResult->linearAcceleration[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[0])) ||
|
!ReadParam(aReader, &(aResult->linearAcceleration[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[1])) ||
|
!ReadParam(aReader, &(aResult->linearAcceleration[2])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->linearAcceleration[2])) ||
|
!ReadParam(aReader, &(aResult->isPositionValid)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->isPositionValid)) ||
|
!ReadParam(aReader, &(aResult->isOrientationValid))) {
|
||||||
!ReadParam(aMsg, aIter, &(aResult->isOrientationValid))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -106,25 +105,24 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::GamepadTouchState> {
|
struct ParamTraits<mozilla::dom::GamepadTouchState> {
|
||||||
typedef mozilla::dom::GamepadTouchState paramType;
|
typedef mozilla::dom::GamepadTouchState paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.touchId);
|
WriteParam(aWriter, aParam.touchId);
|
||||||
WriteParam(aMsg, aParam.surfaceId);
|
WriteParam(aWriter, aParam.surfaceId);
|
||||||
WriteParam(aMsg, aParam.position[0]);
|
WriteParam(aWriter, aParam.position[0]);
|
||||||
WriteParam(aMsg, aParam.position[1]);
|
WriteParam(aWriter, aParam.position[1]);
|
||||||
WriteParam(aMsg, aParam.surfaceDimensions[0]);
|
WriteParam(aWriter, aParam.surfaceDimensions[0]);
|
||||||
WriteParam(aMsg, aParam.surfaceDimensions[1]);
|
WriteParam(aWriter, aParam.surfaceDimensions[1]);
|
||||||
WriteParam(aMsg, aParam.isSurfaceDimensionsValid);
|
WriteParam(aWriter, aParam.isSurfaceDimensionsValid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->touchId)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->touchId)) ||
|
!ReadParam(aReader, &(aResult->surfaceId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->surfaceId)) ||
|
!ReadParam(aReader, &(aResult->position[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->position[0])) ||
|
!ReadParam(aReader, &(aResult->position[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->position[1])) ||
|
!ReadParam(aReader, &(aResult->surfaceDimensions[0])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->surfaceDimensions[0])) ||
|
!ReadParam(aReader, &(aResult->surfaceDimensions[1])) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->surfaceDimensions[1])) ||
|
!ReadParam(aReader, &(aResult->isSurfaceDimensionsValid))) {
|
||||||
!ReadParam(aMsg, aIter, &(aResult->isSurfaceDimensionsValid))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -141,14 +139,13 @@ struct ParamTraits<mozilla::dom::GamepadHandleKind>
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::dom::GamepadHandle> {
|
struct ParamTraits<mozilla::dom::GamepadHandle> {
|
||||||
typedef mozilla::dom::GamepadHandle paramType;
|
typedef mozilla::dom::GamepadHandle paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mValue);
|
WriteParam(aWriter, aParam.mValue);
|
||||||
WriteParam(aMsg, aParam.mKind);
|
WriteParam(aWriter, aParam.mKind);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aParam) {
|
||||||
paramType* aParam) {
|
return ReadParam(aReader, &aParam->mValue) &&
|
||||||
return ReadParam(aMsg, aIter, &aParam->mValue) &&
|
ReadParam(aReader, &aParam->mKind);
|
||||||
ReadParam(aMsg, aIter, &aParam->mKind);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,42 +16,42 @@ namespace IPC {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<nsIDOMGeoPositionCoords*> {
|
struct ParamTraits<nsIDOMGeoPositionCoords*> {
|
||||||
// Function to serialize a geoposition
|
// Function to serialize a geoposition
|
||||||
static void Write(Message* aMsg, nsIDOMGeoPositionCoords* aParam) {
|
static void Write(MessageWriter* aWriter, nsIDOMGeoPositionCoords* aParam) {
|
||||||
bool isNull = !aParam;
|
bool isNull = !aParam;
|
||||||
WriteParam(aMsg, isNull);
|
WriteParam(aWriter, isNull);
|
||||||
// If it is a null object, then we are done
|
// If it is a null object, then we are done
|
||||||
if (isNull) return;
|
if (isNull) return;
|
||||||
|
|
||||||
double coordData;
|
double coordData;
|
||||||
|
|
||||||
aParam->GetLatitude(&coordData);
|
aParam->GetLatitude(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
|
|
||||||
aParam->GetLongitude(&coordData);
|
aParam->GetLongitude(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
|
|
||||||
aParam->GetAltitude(&coordData);
|
aParam->GetAltitude(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
|
|
||||||
aParam->GetAccuracy(&coordData);
|
aParam->GetAccuracy(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
|
|
||||||
aParam->GetAltitudeAccuracy(&coordData);
|
aParam->GetAltitudeAccuracy(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
|
|
||||||
aParam->GetHeading(&coordData);
|
aParam->GetHeading(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
|
|
||||||
aParam->GetSpeed(&coordData);
|
aParam->GetSpeed(&coordData);
|
||||||
WriteParam(aMsg, coordData);
|
WriteParam(aWriter, coordData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to de-serialize a geoposition
|
// Function to de-serialize a geoposition
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader,
|
||||||
RefPtr<nsIDOMGeoPositionCoords>* aResult) {
|
RefPtr<nsIDOMGeoPositionCoords>* aResult) {
|
||||||
// Check if it is the null pointer we have transfered
|
// Check if it is the null pointer we have transfered
|
||||||
bool isNull;
|
bool isNull;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) return false;
|
if (!ReadParam(aReader, &isNull)) return false;
|
||||||
|
|
||||||
if (isNull) {
|
if (isNull) {
|
||||||
*aResult = nullptr;
|
*aResult = nullptr;
|
||||||
@ -67,12 +67,10 @@ struct ParamTraits<nsIDOMGeoPositionCoords*> {
|
|||||||
double speed;
|
double speed;
|
||||||
|
|
||||||
// It's not important to us where it fails, but rather if it fails
|
// It's not important to us where it fails, but rather if it fails
|
||||||
if (!(ReadParam(aMsg, aIter, &latitude) &&
|
if (!(ReadParam(aReader, &latitude) && ReadParam(aReader, &longitude) &&
|
||||||
ReadParam(aMsg, aIter, &longitude) &&
|
ReadParam(aReader, &altitude) && ReadParam(aReader, &accuracy) &&
|
||||||
ReadParam(aMsg, aIter, &altitude) &&
|
ReadParam(aReader, &altitudeAccuracy) &&
|
||||||
ReadParam(aMsg, aIter, &accuracy) &&
|
ReadParam(aReader, &heading) && ReadParam(aReader, &speed)))
|
||||||
ReadParam(aMsg, aIter, &altitudeAccuracy) &&
|
|
||||||
ReadParam(aMsg, aIter, &heading) && ReadParam(aMsg, aIter, &speed)))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We now have all the data
|
// We now have all the data
|
||||||
@ -91,27 +89,26 @@ struct ParamTraits<nsIDOMGeoPositionCoords*> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<nsIDOMGeoPosition*> {
|
struct ParamTraits<nsIDOMGeoPosition*> {
|
||||||
// Function to serialize a geoposition
|
// Function to serialize a geoposition
|
||||||
static void Write(Message* aMsg, nsIDOMGeoPosition* aParam) {
|
static void Write(MessageWriter* aWriter, nsIDOMGeoPosition* aParam) {
|
||||||
bool isNull = !aParam;
|
bool isNull = !aParam;
|
||||||
WriteParam(aMsg, isNull);
|
WriteParam(aWriter, isNull);
|
||||||
// If it is a null object, then we are done
|
// If it is a null object, then we are done
|
||||||
if (isNull) return;
|
if (isNull) return;
|
||||||
|
|
||||||
EpochTimeStamp timeStamp;
|
EpochTimeStamp timeStamp;
|
||||||
aParam->GetTimestamp(&timeStamp);
|
aParam->GetTimestamp(&timeStamp);
|
||||||
WriteParam(aMsg, timeStamp);
|
WriteParam(aWriter, timeStamp);
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMGeoPositionCoords> coords;
|
nsCOMPtr<nsIDOMGeoPositionCoords> coords;
|
||||||
aParam->GetCoords(getter_AddRefs(coords));
|
aParam->GetCoords(getter_AddRefs(coords));
|
||||||
WriteParam(aMsg, coords);
|
WriteParam(aWriter, coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to de-serialize a geoposition
|
// Function to de-serialize a geoposition
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, RefPtr<nsIDOMGeoPosition>* aResult) {
|
||||||
RefPtr<nsIDOMGeoPosition>* aResult) {
|
|
||||||
// Check if it is the null pointer we have transfered
|
// Check if it is the null pointer we have transfered
|
||||||
bool isNull;
|
bool isNull;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) return false;
|
if (!ReadParam(aReader, &isNull)) return false;
|
||||||
|
|
||||||
if (isNull) {
|
if (isNull) {
|
||||||
*aResult = nullptr;
|
*aResult = nullptr;
|
||||||
@ -122,8 +119,7 @@ struct ParamTraits<nsIDOMGeoPosition*> {
|
|||||||
RefPtr<nsIDOMGeoPositionCoords> coords;
|
RefPtr<nsIDOMGeoPositionCoords> coords;
|
||||||
|
|
||||||
// It's not important to us where it fails, but rather if it fails
|
// It's not important to us where it fails, but rather if it fails
|
||||||
if (!ReadParam(aMsg, aIter, &timeStamp) ||
|
if (!ReadParam(aReader, &timeStamp) || !ReadParam(aReader, &coords)) {
|
||||||
!ReadParam(aMsg, aIter, &coords)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,13 +28,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::indexedDB::Key> {
|
struct ParamTraits<mozilla::dom::indexedDB::Key> {
|
||||||
typedef mozilla::dom::indexedDB::Key paramType;
|
typedef mozilla::dom::indexedDB::Key paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mBuffer);
|
WriteParam(aWriter, aParam.mBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mBuffer);
|
||||||
return ReadParam(aMsg, aIter, &aResult->mBuffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -53,15 +52,14 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::indexedDB::KeyPath> {
|
struct ParamTraits<mozilla::dom::indexedDB::KeyPath> {
|
||||||
typedef mozilla::dom::indexedDB::KeyPath paramType;
|
typedef mozilla::dom::indexedDB::KeyPath paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mType);
|
WriteParam(aWriter, aParam.mType);
|
||||||
WriteParam(aMsg, aParam.mStrings);
|
WriteParam(aWriter, aParam.mStrings);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mType) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mType) &&
|
ReadParam(aReader, &aResult->mStrings);
|
||||||
ReadParam(aMsg, aIter, &aResult->mStrings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
|
@ -14,23 +14,22 @@ namespace IPC {
|
|||||||
using namespace mozilla::ipc;
|
using namespace mozilla::ipc;
|
||||||
|
|
||||||
void ParamTraits<nsIContentSecurityPolicy*>::Write(
|
void ParamTraits<nsIContentSecurityPolicy*>::Write(
|
||||||
Message* aMsg, nsIContentSecurityPolicy* aParam) {
|
MessageWriter* aWriter, nsIContentSecurityPolicy* aParam) {
|
||||||
bool isNull = !aParam;
|
bool isNull = !aParam;
|
||||||
WriteParam(aMsg, isNull);
|
WriteParam(aWriter, isNull);
|
||||||
if (isNull) {
|
if (isNull) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSPInfo csp;
|
CSPInfo csp;
|
||||||
mozilla::Unused << NS_WARN_IF(NS_FAILED(CSPToCSPInfo(aParam, &csp)));
|
mozilla::Unused << NS_WARN_IF(NS_FAILED(CSPToCSPInfo(aParam, &csp)));
|
||||||
IPDLParamTraits<CSPInfo>::Write(aMsg, nullptr, csp);
|
IPDLParamTraits<CSPInfo>::Write(aWriter, nullptr, csp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParamTraits<nsIContentSecurityPolicy*>::Read(
|
bool ParamTraits<nsIContentSecurityPolicy*>::Read(
|
||||||
const Message* aMsg, PickleIterator* aIter,
|
MessageReader* aReader, RefPtr<nsIContentSecurityPolicy>* aResult) {
|
||||||
RefPtr<nsIContentSecurityPolicy>* aResult) {
|
|
||||||
bool isNull;
|
bool isNull;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) {
|
if (!ReadParam(aReader, &isNull)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ bool ParamTraits<nsIContentSecurityPolicy*>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
CSPInfo csp;
|
CSPInfo csp;
|
||||||
if (!IPDLParamTraits<CSPInfo>::Read(aMsg, aIter, nullptr, &csp)) {
|
if (!IPDLParamTraits<CSPInfo>::Read(aReader, nullptr, &csp)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ namespace IPC {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<nsIContentSecurityPolicy*> {
|
struct ParamTraits<nsIContentSecurityPolicy*> {
|
||||||
static void Write(Message* aMsg, nsIContentSecurityPolicy* aParam);
|
static void Write(MessageWriter* aWriter, nsIContentSecurityPolicy* aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader,
|
||||||
RefPtr<nsIContentSecurityPolicy>* aResult);
|
RefPtr<nsIContentSecurityPolicy>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,18 +11,18 @@
|
|||||||
|
|
||||||
namespace mozilla::ipc {
|
namespace mozilla::ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<nsDocShellLoadState*>::Write(IPC::Message* aMsg,
|
void IPDLParamTraits<nsDocShellLoadState*>::Write(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
nsDocShellLoadState* aParam) {
|
nsDocShellLoadState* aParam) {
|
||||||
MOZ_RELEASE_ASSERT(aParam);
|
MOZ_RELEASE_ASSERT(aParam);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam->Serialize());
|
WriteIPDLParam(aWriter, aActor, aParam->Serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<nsDocShellLoadState*>::Read(
|
bool IPDLParamTraits<nsDocShellLoadState*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
RefPtr<nsDocShellLoadState>* aResult) {
|
RefPtr<nsDocShellLoadState>* aResult) {
|
||||||
dom::DocShellLoadStateInit loadState;
|
dom::DocShellLoadStateInit loadState;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &loadState)) {
|
if (!ReadIPDLParam(aReader, aActor, &loadState)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@ namespace ipc {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsDocShellLoadState*> {
|
struct IPDLParamTraits<nsDocShellLoadState*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsDocShellLoadState* aParam);
|
nsDocShellLoadState* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<nsDocShellLoadState>* aResult);
|
RefPtr<nsDocShellLoadState>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -52,13 +52,12 @@ template <typename T>
|
|||||||
struct ParamTraits<mozilla::dom::IdType<T>> {
|
struct ParamTraits<mozilla::dom::IdType<T>> {
|
||||||
using paramType = mozilla::dom::IdType<T>;
|
using paramType = mozilla::dom::IdType<T>;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mId);
|
WriteParam(aWriter, aParam.mId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mId);
|
||||||
return ReadParam(aMsg, aIter, &aResult->mId);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
namespace mozilla::ipc {
|
namespace mozilla::ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<nsIPrincipal*>::Write(IPC::Message* aMsg,
|
void IPDLParamTraits<nsIPrincipal*>::Write(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
nsIPrincipal* aParam) {
|
nsIPrincipal* aParam) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread());
|
MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread());
|
||||||
@ -24,15 +24,14 @@ void IPDLParamTraits<nsIPrincipal*>::Write(IPC::Message* aMsg,
|
|||||||
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
|
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteIPDLParam(aMsg, aActor, info);
|
WriteIPDLParam(aWriter, aActor, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<nsIPrincipal*>::Read(const IPC::Message* aMsg,
|
bool IPDLParamTraits<nsIPrincipal*>::Read(IPC::MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
RefPtr<nsIPrincipal>* aResult) {
|
RefPtr<nsIPrincipal>* aResult) {
|
||||||
Maybe<PrincipalInfo> info;
|
Maybe<PrincipalInfo> info;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &info)) {
|
if (!ReadIPDLParam(aReader, aActor, &info)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,16 +40,16 @@ namespace ipc {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsIPrincipal*> {
|
struct IPDLParamTraits<nsIPrincipal*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsIPrincipal* aParam);
|
nsIPrincipal* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<nsIPrincipal>* aResult);
|
RefPtr<nsIPrincipal>* aResult);
|
||||||
|
|
||||||
// Overload to support deserializing nsCOMPtr<nsIPrincipal> directly.
|
// Overload to support deserializing nsCOMPtr<nsIPrincipal> directly.
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, nsCOMPtr<nsIPrincipal>* aResult) {
|
nsCOMPtr<nsIPrincipal>* aResult) {
|
||||||
RefPtr<nsIPrincipal> result;
|
RefPtr<nsIPrincipal> result;
|
||||||
if (!Read(aMsg, aIter, aActor, &result)) {
|
if (!Read(aReader, aActor, &result)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aResult = std::move(result);
|
*aResult = std::move(result);
|
||||||
@ -60,13 +60,13 @@ struct IPDLParamTraits<nsIPrincipal*> {
|
|||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<IPC::Principal> {
|
struct IPDLParamTraits<IPC::Principal> {
|
||||||
typedef IPC::Principal paramType;
|
typedef IPC::Principal paramType;
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mPrincipal);
|
WriteIPDLParam(aWriter, aActor, aParam.mPrincipal);
|
||||||
}
|
}
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
return ReadIPDLParam(aMsg, aIter, aActor, &aResult->mPrincipal);
|
return ReadIPDLParam(aReader, aActor, &aResult->mPrincipal);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,8 @@ using namespace mozilla::dom;
|
|||||||
|
|
||||||
namespace mozilla::ipc {
|
namespace mozilla::ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<nsIVariant*>::Write(Message* aMsg, IProtocol* aActor,
|
void IPDLParamTraits<nsIVariant*>::Write(MessageWriter* aWriter,
|
||||||
|
IProtocol* aActor,
|
||||||
nsIVariant* aParam) {
|
nsIVariant* aParam) {
|
||||||
IDPLVariant variant;
|
IDPLVariant variant;
|
||||||
|
|
||||||
@ -130,15 +131,14 @@ void IPDLParamTraits<nsIVariant*>::Write(Message* aMsg, IProtocol* aActor,
|
|||||||
MOZ_CRASH("Non handled variant type, patch welcome");
|
MOZ_CRASH("Non handled variant type, patch welcome");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
WriteIPDLParam(aMsg, aActor, variant);
|
WriteIPDLParam(aWriter, aActor, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<nsIVariant*>::Read(const Message* aMsg,
|
bool IPDLParamTraits<nsIVariant*>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
RefPtr<nsIVariant>* aResult) {
|
RefPtr<nsIVariant>* aResult) {
|
||||||
IDPLVariant value;
|
IDPLVariant value;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &value)) {
|
if (!ReadIPDLParam(aReader, aActor, &value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,8 @@ bool IPDLParamTraits<nsIVariant*>::Read(const Message* aMsg,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<nsIPropertyBag2*>::Write(Message* aMsg, IProtocol* aActor,
|
void IPDLParamTraits<nsIPropertyBag2*>::Write(MessageWriter* aWriter,
|
||||||
|
IProtocol* aActor,
|
||||||
nsIPropertyBag2* aParam) {
|
nsIPropertyBag2* aParam) {
|
||||||
// We send a nsIPropertyBag as an array of IPDLProperty
|
// We send a nsIPropertyBag as an array of IPDLProperty
|
||||||
nsTArray<IPDLProperty> bag;
|
nsTArray<IPDLProperty> bag;
|
||||||
@ -235,15 +236,14 @@ void IPDLParamTraits<nsIPropertyBag2*>::Write(Message* aMsg, IProtocol* aActor,
|
|||||||
bag.AppendElement(IPDLProperty{name, value});
|
bag.AppendElement(IPDLProperty{name, value});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteIPDLParam(aMsg, aActor, bag);
|
WriteIPDLParam(aWriter, aActor, bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<nsIPropertyBag2*>::Read(const Message* aMsg,
|
bool IPDLParamTraits<nsIPropertyBag2*>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
RefPtr<nsIPropertyBag2>* aResult) {
|
RefPtr<nsIPropertyBag2>* aResult) {
|
||||||
nsTArray<IPDLProperty> bag;
|
nsTArray<IPDLProperty> bag;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &bag)) {
|
if (!ReadIPDLParam(aReader, aActor, &bag)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,17 +20,18 @@ namespace ipc {
|
|||||||
*/
|
*/
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsIVariant*> {
|
struct IPDLParamTraits<nsIVariant*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, nsIVariant* aParam);
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
nsIVariant* aParam);
|
||||||
IProtocol* aActor, RefPtr<nsIVariant>* aResult);
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
|
RefPtr<nsIVariant>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsIPropertyBag2*> {
|
struct IPDLParamTraits<nsIPropertyBag2*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsIPropertyBag2* aParam);
|
nsIPropertyBag2* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<nsIPropertyBag2>* aResult);
|
RefPtr<nsIPropertyBag2>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
void ParamTraits<nsIReferrerInfo*>::Write(Message* aMsg,
|
void ParamTraits<nsIReferrerInfo*>::Write(MessageWriter* aWriter,
|
||||||
nsIReferrerInfo* aParam) {
|
nsIReferrerInfo* aParam) {
|
||||||
bool isNull = !aParam;
|
bool isNull = !aParam;
|
||||||
WriteParam(aMsg, isNull);
|
WriteParam(aWriter, isNull);
|
||||||
if (isNull) {
|
if (isNull) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -25,14 +25,13 @@ void ParamTraits<nsIReferrerInfo*>::Write(Message* aMsg,
|
|||||||
MOZ_CRASH("Unable to serialize referrer info.");
|
MOZ_CRASH("Unable to serialize referrer info.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WriteParam(aMsg, infoString);
|
WriteParam(aWriter, infoString);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParamTraits<nsIReferrerInfo*>::Read(const Message* aMsg,
|
bool ParamTraits<nsIReferrerInfo*>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
RefPtr<nsIReferrerInfo>* aResult) {
|
RefPtr<nsIReferrerInfo>* aResult) {
|
||||||
bool isNull;
|
bool isNull;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) {
|
if (!ReadParam(aReader, &isNull)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isNull) {
|
if (isNull) {
|
||||||
@ -40,7 +39,7 @@ bool ParamTraits<nsIReferrerInfo*>::Read(const Message* aMsg,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
nsAutoCString infoString;
|
nsAutoCString infoString;
|
||||||
if (!ReadParam(aMsg, aIter, &infoString)) {
|
if (!ReadParam(aReader, &infoString)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsISupports> iSupports;
|
nsCOMPtr<nsISupports> iSupports;
|
||||||
|
@ -15,9 +15,8 @@ namespace IPC {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<nsIReferrerInfo*> {
|
struct ParamTraits<nsIReferrerInfo*> {
|
||||||
static void Write(Message* aMsg, nsIReferrerInfo* aParam);
|
static void Write(MessageWriter* aWriter, nsIReferrerInfo* aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, RefPtr<nsIReferrerInfo>* aResult);
|
||||||
RefPtr<nsIReferrerInfo>* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -379,15 +379,14 @@ void StructuredCloneData::StealFromClonedMessageDataForBackgroundChild(
|
|||||||
UnpackClonedMessageData<StealMemory, Child>(aClonedData, *this);
|
UnpackClonedMessageData<StealMemory, Child>(aClonedData, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StructuredCloneData::WriteIPCParams(IPC::Message* aMsg) const {
|
void StructuredCloneData::WriteIPCParams(IPC::MessageWriter* aWriter) const {
|
||||||
WriteParam(aMsg, Data());
|
WriteParam(aWriter, Data());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StructuredCloneData::ReadIPCParams(const IPC::Message* aMsg,
|
bool StructuredCloneData::ReadIPCParams(IPC::MessageReader* aReader) {
|
||||||
PickleIterator* aIter) {
|
|
||||||
MOZ_ASSERT(!mInitialized);
|
MOZ_ASSERT(!mInitialized);
|
||||||
JSStructuredCloneData data(JS::StructuredCloneScope::DifferentProcess);
|
JSStructuredCloneData data(JS::StructuredCloneScope::DifferentProcess);
|
||||||
if (!ReadParam(aMsg, aIter, &data)) {
|
if (!ReadParam(aReader, &data)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mSharedData = new SharedJSAllocatedData(std::move(data));
|
mSharedData = new SharedJSAllocatedData(std::move(data));
|
||||||
|
@ -280,8 +280,8 @@ class StructuredCloneData : public StructuredCloneHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For IPC serialization
|
// For IPC serialization
|
||||||
void WriteIPCParams(IPC::Message* aMessage) const;
|
void WriteIPCParams(IPC::MessageWriter* aWriter) const;
|
||||||
bool ReadIPCParams(const IPC::Message* aMessage, PickleIterator* aIter);
|
bool ReadIPCParams(IPC::MessageReader* aReader);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
already_AddRefed<SharedJSAllocatedData> TakeSharedData();
|
already_AddRefed<SharedJSAllocatedData> TakeSharedData();
|
||||||
|
@ -12,11 +12,10 @@
|
|||||||
|
|
||||||
namespace mozilla::dom {
|
namespace mozilla::dom {
|
||||||
|
|
||||||
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool ReadRemoteEvent(IPC::MessageReader* aReader, RemoteDOMEvent* aResult) {
|
||||||
RemoteDOMEvent* aResult) {
|
|
||||||
aResult->mEvent = nullptr;
|
aResult->mEvent = nullptr;
|
||||||
nsString type;
|
nsString type;
|
||||||
NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &type), false);
|
NS_ENSURE_TRUE(ReadParam(aReader, &type), false);
|
||||||
|
|
||||||
aResult->mEvent =
|
aResult->mEvent =
|
||||||
EventDispatcher::CreateEvent(nullptr, nullptr, nullptr, type);
|
EventDispatcher::CreateEvent(nullptr, nullptr, nullptr, type);
|
||||||
@ -24,7 +23,7 @@ bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
|
|||||||
// In a controlled environment, we should always have a valid event.
|
// In a controlled environment, we should always have a valid event.
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
if (aResult->mEvent) {
|
if (aResult->mEvent) {
|
||||||
ret = aResult->mEvent->Deserialize(aMsg, aIter);
|
ret = aResult->mEvent->Deserialize(aReader);
|
||||||
}
|
}
|
||||||
MOZ_ASSERT_UNLESS_FUZZING(ret);
|
MOZ_ASSERT_UNLESS_FUZZING(ret);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace mozilla::dom {
|
namespace mozilla::dom {
|
||||||
|
|
||||||
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool ReadRemoteEvent(IPC::MessageReader* aReader,
|
||||||
mozilla::dom::RemoteDOMEvent* aResult);
|
mozilla::dom::RemoteDOMEvent* aResult);
|
||||||
|
|
||||||
} // namespace mozilla::dom
|
} // namespace mozilla::dom
|
||||||
@ -31,13 +31,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::RemoteDOMEvent> {
|
struct ParamTraits<mozilla::dom::RemoteDOMEvent> {
|
||||||
typedef mozilla::dom::RemoteDOMEvent paramType;
|
typedef mozilla::dom::RemoteDOMEvent paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aParam.mEvent->Serialize(aMsg, true);
|
aParam.mEvent->Serialize(aWriter, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return mozilla::dom::ReadRemoteEvent(aReader, aResult);
|
||||||
return mozilla::dom::ReadRemoteEvent(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {}
|
static void Log(const paramType& aParam, std::wstring* aLog) {}
|
||||||
@ -65,19 +64,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::EffectsInfo> {
|
struct ParamTraits<mozilla::dom::EffectsInfo> {
|
||||||
typedef mozilla::dom::EffectsInfo paramType;
|
typedef mozilla::dom::EffectsInfo paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mVisibleRect);
|
WriteParam(aWriter, aParam.mVisibleRect);
|
||||||
WriteParam(aMsg, aParam.mScaleX);
|
WriteParam(aWriter, aParam.mScaleX);
|
||||||
WriteParam(aMsg, aParam.mScaleY);
|
WriteParam(aWriter, aParam.mScaleY);
|
||||||
WriteParam(aMsg, aParam.mTransformToAncestorScale);
|
WriteParam(aWriter, aParam.mTransformToAncestorScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mVisibleRect) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mVisibleRect) &&
|
ReadParam(aReader, &aResult->mScaleX) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mScaleX) &&
|
ReadParam(aReader, &aResult->mScaleY) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mScaleY) &&
|
ReadParam(aReader, &aResult->mTransformToAncestorScale);
|
||||||
ReadParam(aMsg, aIter, &aResult->mTransformToAncestorScale);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,25 +94,24 @@ template <>
|
|||||||
struct ParamTraits<mozilla::ScrollAxis> {
|
struct ParamTraits<mozilla::ScrollAxis> {
|
||||||
typedef mozilla::ScrollAxis paramType;
|
typedef mozilla::ScrollAxis paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mWhereToScroll);
|
WriteParam(aWriter, aParam.mWhereToScroll);
|
||||||
WriteParam(aMsg, aParam.mWhenToScroll);
|
WriteParam(aWriter, aParam.mWhenToScroll);
|
||||||
WriteParam(aMsg, aParam.mOnlyIfPerceivedScrollableDirection);
|
WriteParam(aWriter, aParam.mOnlyIfPerceivedScrollableDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &aResult->mWhereToScroll)) {
|
||||||
if (!ReadParam(aMsg, aIter, &aResult->mWhereToScroll)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadParam(aMsg, aIter, &aResult->mWhenToScroll)) {
|
if (!ReadParam(aReader, &aResult->mWhenToScroll)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't set mOnlyIfPerceivedScrollableDirection directly since it's
|
// We can't set mOnlyIfPerceivedScrollableDirection directly since it's
|
||||||
// a bitfield.
|
// a bitfield.
|
||||||
bool value;
|
bool value;
|
||||||
if (!ReadParam(aMsg, aIter, &value)) {
|
if (!ReadParam(aReader, &value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
aResult->mOnlyIfPerceivedScrollableDirection = value;
|
aResult->mOnlyIfPerceivedScrollableDirection = value;
|
||||||
|
@ -42,19 +42,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::LSValue> {
|
struct ParamTraits<mozilla::dom::LSValue> {
|
||||||
typedef mozilla::dom::LSValue paramType;
|
typedef mozilla::dom::LSValue paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mBuffer);
|
WriteParam(aWriter, aParam.mBuffer);
|
||||||
WriteParam(aMsg, aParam.mUTF16Length);
|
WriteParam(aWriter, aParam.mUTF16Length);
|
||||||
WriteParam(aMsg, aParam.mConversionType);
|
WriteParam(aWriter, aParam.mConversionType);
|
||||||
WriteParam(aMsg, aParam.mCompressionType);
|
WriteParam(aWriter, aParam.mCompressionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mBuffer) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mBuffer) &&
|
ReadParam(aReader, &aResult->mUTF16Length) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mUTF16Length) &&
|
ReadParam(aReader, &aResult->mConversionType) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mConversionType) &&
|
ReadParam(aReader, &aResult->mCompressionType);
|
||||||
ReadParam(aMsg, aIter, &aResult->mCompressionType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
|
@ -65,25 +65,24 @@ template <>
|
|||||||
struct ParamTraits<GMPSimulcastStream> {
|
struct ParamTraits<GMPSimulcastStream> {
|
||||||
typedef GMPSimulcastStream paramType;
|
typedef GMPSimulcastStream paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mWidth);
|
WriteParam(aWriter, aParam.mWidth);
|
||||||
WriteParam(aMsg, aParam.mHeight);
|
WriteParam(aWriter, aParam.mHeight);
|
||||||
WriteParam(aMsg, aParam.mNumberOfTemporalLayers);
|
WriteParam(aWriter, aParam.mNumberOfTemporalLayers);
|
||||||
WriteParam(aMsg, aParam.mMaxBitrate);
|
WriteParam(aWriter, aParam.mMaxBitrate);
|
||||||
WriteParam(aMsg, aParam.mTargetBitrate);
|
WriteParam(aWriter, aParam.mTargetBitrate);
|
||||||
WriteParam(aMsg, aParam.mMinBitrate);
|
WriteParam(aWriter, aParam.mMinBitrate);
|
||||||
WriteParam(aMsg, aParam.mQPMax);
|
WriteParam(aWriter, aParam.mQPMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (ReadParam(aReader, &(aResult->mWidth)) &&
|
||||||
if (ReadParam(aMsg, aIter, &(aResult->mWidth)) &&
|
ReadParam(aReader, &(aResult->mHeight)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mHeight)) &&
|
ReadParam(aReader, &(aResult->mNumberOfTemporalLayers)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mNumberOfTemporalLayers)) &&
|
ReadParam(aReader, &(aResult->mMaxBitrate)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mMaxBitrate)) &&
|
ReadParam(aReader, &(aResult->mTargetBitrate)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mTargetBitrate)) &&
|
ReadParam(aReader, &(aResult->mMinBitrate)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mMinBitrate)) &&
|
ReadParam(aReader, &(aResult->mQPMax))) {
|
||||||
ReadParam(aMsg, aIter, &(aResult->mQPMax))) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -101,41 +100,40 @@ template <>
|
|||||||
struct ParamTraits<GMPVideoCodec> {
|
struct ParamTraits<GMPVideoCodec> {
|
||||||
typedef GMPVideoCodec paramType;
|
typedef GMPVideoCodec paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mGMPApiVersion);
|
WriteParam(aWriter, aParam.mGMPApiVersion);
|
||||||
WriteParam(aMsg, aParam.mCodecType);
|
WriteParam(aWriter, aParam.mCodecType);
|
||||||
WriteParam(aMsg, static_cast<const nsCString&>(
|
WriteParam(aWriter, static_cast<const nsCString&>(
|
||||||
nsDependentCString(aParam.mPLName)));
|
nsDependentCString(aParam.mPLName)));
|
||||||
WriteParam(aMsg, aParam.mPLType);
|
WriteParam(aWriter, aParam.mPLType);
|
||||||
WriteParam(aMsg, aParam.mWidth);
|
WriteParam(aWriter, aParam.mWidth);
|
||||||
WriteParam(aMsg, aParam.mHeight);
|
WriteParam(aWriter, aParam.mHeight);
|
||||||
WriteParam(aMsg, aParam.mStartBitrate);
|
WriteParam(aWriter, aParam.mStartBitrate);
|
||||||
WriteParam(aMsg, aParam.mMaxBitrate);
|
WriteParam(aWriter, aParam.mMaxBitrate);
|
||||||
WriteParam(aMsg, aParam.mMinBitrate);
|
WriteParam(aWriter, aParam.mMinBitrate);
|
||||||
WriteParam(aMsg, aParam.mMaxFramerate);
|
WriteParam(aWriter, aParam.mMaxFramerate);
|
||||||
WriteParam(aMsg, aParam.mFrameDroppingOn);
|
WriteParam(aWriter, aParam.mFrameDroppingOn);
|
||||||
WriteParam(aMsg, aParam.mKeyFrameInterval);
|
WriteParam(aWriter, aParam.mKeyFrameInterval);
|
||||||
WriteParam(aMsg, aParam.mQPMax);
|
WriteParam(aWriter, aParam.mQPMax);
|
||||||
WriteParam(aMsg, aParam.mNumberOfSimulcastStreams);
|
WriteParam(aWriter, aParam.mNumberOfSimulcastStreams);
|
||||||
for (uint32_t i = 0; i < aParam.mNumberOfSimulcastStreams; i++) {
|
for (uint32_t i = 0; i < aParam.mNumberOfSimulcastStreams; i++) {
|
||||||
WriteParam(aMsg, aParam.mSimulcastStream[i]);
|
WriteParam(aWriter, aParam.mSimulcastStream[i]);
|
||||||
}
|
}
|
||||||
WriteParam(aMsg, aParam.mMode);
|
WriteParam(aWriter, aParam.mMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
// NOTE: make sure this matches any versions supported
|
// NOTE: make sure this matches any versions supported
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mGMPApiVersion)) ||
|
if (!ReadParam(aReader, &(aResult->mGMPApiVersion)) ||
|
||||||
aResult->mGMPApiVersion != kGMPVersion33) {
|
aResult->mGMPApiVersion != kGMPVersion33) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mCodecType))) {
|
if (!ReadParam(aReader, &(aResult->mCodecType))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoCString plName;
|
nsAutoCString plName;
|
||||||
if (!ReadParam(aMsg, aIter, &plName) ||
|
if (!ReadParam(aReader, &plName) ||
|
||||||
plName.Length() > kGMPPayloadNameSize - 1) {
|
plName.Length() > kGMPPayloadNameSize - 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -143,20 +141,20 @@ struct ParamTraits<GMPVideoCodec> {
|
|||||||
memset(aResult->mPLName + plName.Length(), 0,
|
memset(aResult->mPLName + plName.Length(), 0,
|
||||||
kGMPPayloadNameSize - plName.Length());
|
kGMPPayloadNameSize - plName.Length());
|
||||||
|
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mPLType)) ||
|
if (!ReadParam(aReader, &(aResult->mPLType)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mWidth)) ||
|
!ReadParam(aReader, &(aResult->mWidth)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mHeight)) ||
|
!ReadParam(aReader, &(aResult->mHeight)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mStartBitrate)) ||
|
!ReadParam(aReader, &(aResult->mStartBitrate)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mMaxBitrate)) ||
|
!ReadParam(aReader, &(aResult->mMaxBitrate)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mMinBitrate)) ||
|
!ReadParam(aReader, &(aResult->mMinBitrate)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mMaxFramerate)) ||
|
!ReadParam(aReader, &(aResult->mMaxFramerate)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mFrameDroppingOn)) ||
|
!ReadParam(aReader, &(aResult->mFrameDroppingOn)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mKeyFrameInterval))) {
|
!ReadParam(aReader, &(aResult->mKeyFrameInterval))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mQPMax)) ||
|
if (!ReadParam(aReader, &(aResult->mQPMax)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mNumberOfSimulcastStreams))) {
|
!ReadParam(aReader, &(aResult->mNumberOfSimulcastStreams))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,12 +163,12 @@ struct ParamTraits<GMPVideoCodec> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aResult->mNumberOfSimulcastStreams; i++) {
|
for (uint32_t i = 0; i < aResult->mNumberOfSimulcastStreams; i++) {
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mSimulcastStream[i]))) {
|
if (!ReadParam(aReader, &(aResult->mSimulcastStream[i]))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mMode))) {
|
if (!ReadParam(aReader, &(aResult->mMode))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,40 +19,39 @@ template <>
|
|||||||
struct ParamTraits<mozilla::VideoInfo> {
|
struct ParamTraits<mozilla::VideoInfo> {
|
||||||
typedef mozilla::VideoInfo paramType;
|
typedef mozilla::VideoInfo paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
// TrackInfo
|
// TrackInfo
|
||||||
WriteParam(aMsg, aParam.mMimeType);
|
WriteParam(aWriter, aParam.mMimeType);
|
||||||
|
|
||||||
// VideoInfo
|
// VideoInfo
|
||||||
WriteParam(aMsg, aParam.mDisplay);
|
WriteParam(aWriter, aParam.mDisplay);
|
||||||
WriteParam(aMsg, aParam.mStereoMode);
|
WriteParam(aWriter, aParam.mStereoMode);
|
||||||
WriteParam(aMsg, aParam.mImage);
|
WriteParam(aWriter, aParam.mImage);
|
||||||
WriteParam(aMsg, aParam.mImageRect);
|
WriteParam(aWriter, aParam.mImageRect);
|
||||||
WriteParam(aMsg, *aParam.mCodecSpecificConfig);
|
WriteParam(aWriter, *aParam.mCodecSpecificConfig);
|
||||||
WriteParam(aMsg, *aParam.mExtraData);
|
WriteParam(aWriter, *aParam.mExtraData);
|
||||||
WriteParam(aMsg, aParam.mRotation);
|
WriteParam(aWriter, aParam.mRotation);
|
||||||
WriteParam(aMsg, aParam.mColorDepth);
|
WriteParam(aWriter, aParam.mColorDepth);
|
||||||
WriteParam(aMsg, aParam.mColorSpace);
|
WriteParam(aWriter, aParam.mColorSpace);
|
||||||
WriteParam(aMsg, aParam.mColorRange);
|
WriteParam(aWriter, aParam.mColorRange);
|
||||||
WriteParam(aMsg, aParam.HasAlpha());
|
WriteParam(aWriter, aParam.HasAlpha());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
mozilla::gfx::IntRect imageRect;
|
mozilla::gfx::IntRect imageRect;
|
||||||
bool alphaPresent;
|
bool alphaPresent;
|
||||||
if (ReadParam(aMsg, aIter, &aResult->mMimeType) &&
|
if (ReadParam(aReader, &aResult->mMimeType) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mDisplay) &&
|
ReadParam(aReader, &aResult->mDisplay) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mStereoMode) &&
|
ReadParam(aReader, &aResult->mStereoMode) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mImage) &&
|
ReadParam(aReader, &aResult->mImage) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mImageRect) &&
|
ReadParam(aReader, &aResult->mImageRect) &&
|
||||||
ReadParam(aMsg, aIter, aResult->mCodecSpecificConfig.get()) &&
|
ReadParam(aReader, aResult->mCodecSpecificConfig.get()) &&
|
||||||
ReadParam(aMsg, aIter, aResult->mExtraData.get()) &&
|
ReadParam(aReader, aResult->mExtraData.get()) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mRotation) &&
|
ReadParam(aReader, &aResult->mRotation) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mColorDepth) &&
|
ReadParam(aReader, &aResult->mColorDepth) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mColorSpace) &&
|
ReadParam(aReader, &aResult->mColorSpace) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mColorRange) &&
|
ReadParam(aReader, &aResult->mColorRange) &&
|
||||||
ReadParam(aMsg, aIter, &alphaPresent)) {
|
ReadParam(aReader, &alphaPresent)) {
|
||||||
aResult->SetAlpha(alphaPresent);
|
aResult->SetAlpha(alphaPresent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -83,32 +82,31 @@ template <>
|
|||||||
struct ParamTraits<mozilla::AudioInfo> {
|
struct ParamTraits<mozilla::AudioInfo> {
|
||||||
typedef mozilla::AudioInfo paramType;
|
typedef mozilla::AudioInfo paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
// TrackInfo
|
// TrackInfo
|
||||||
WriteParam(aMsg, aParam.mMimeType);
|
WriteParam(aWriter, aParam.mMimeType);
|
||||||
|
|
||||||
// AudioInfo
|
// AudioInfo
|
||||||
WriteParam(aMsg, aParam.mRate);
|
WriteParam(aWriter, aParam.mRate);
|
||||||
WriteParam(aMsg, aParam.mChannels);
|
WriteParam(aWriter, aParam.mChannels);
|
||||||
WriteParam(aMsg, aParam.mChannelMap);
|
WriteParam(aWriter, aParam.mChannelMap);
|
||||||
WriteParam(aMsg, aParam.mBitDepth);
|
WriteParam(aWriter, aParam.mBitDepth);
|
||||||
WriteParam(aMsg, aParam.mProfile);
|
WriteParam(aWriter, aParam.mProfile);
|
||||||
WriteParam(aMsg, aParam.mExtendedProfile);
|
WriteParam(aWriter, aParam.mExtendedProfile);
|
||||||
WriteParam(aMsg, *aParam.mCodecSpecificConfig);
|
WriteParam(aWriter, *aParam.mCodecSpecificConfig);
|
||||||
WriteParam(aMsg, *aParam.mExtraData);
|
WriteParam(aWriter, *aParam.mExtraData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (ReadParam(aReader, &aResult->mMimeType) &&
|
||||||
if (ReadParam(aMsg, aIter, &aResult->mMimeType) &&
|
ReadParam(aReader, &aResult->mRate) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mRate) &&
|
ReadParam(aReader, &aResult->mChannels) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mChannels) &&
|
ReadParam(aReader, &aResult->mChannelMap) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mChannelMap) &&
|
ReadParam(aReader, &aResult->mBitDepth) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mBitDepth) &&
|
ReadParam(aReader, &aResult->mProfile) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mProfile) &&
|
ReadParam(aReader, &aResult->mExtendedProfile) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mExtendedProfile) &&
|
ReadParam(aReader, aResult->mCodecSpecificConfig.get()) &&
|
||||||
ReadParam(aMsg, aIter, aResult->mCodecSpecificConfig.get()) &&
|
ReadParam(aReader, aResult->mExtraData.get())) {
|
||||||
ReadParam(aMsg, aIter, aResult->mExtraData.get())) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -127,16 +125,15 @@ template <>
|
|||||||
struct ParamTraits<mozilla::media::TimeUnit> {
|
struct ParamTraits<mozilla::media::TimeUnit> {
|
||||||
typedef mozilla::media::TimeUnit paramType;
|
typedef mozilla::media::TimeUnit paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.IsValid());
|
WriteParam(aWriter, aParam.IsValid());
|
||||||
WriteParam(aMsg, aParam.IsValid() ? aParam.ToMicroseconds() : 0);
|
WriteParam(aWriter, aParam.IsValid() ? aParam.ToMicroseconds() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
bool valid;
|
bool valid;
|
||||||
int64_t value;
|
int64_t value;
|
||||||
if (ReadParam(aMsg, aIter, &valid) && ReadParam(aMsg, aIter, &value)) {
|
if (ReadParam(aReader, &valid) && ReadParam(aReader, &value)) {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
*aResult = mozilla::media::TimeUnit::Invalid();
|
*aResult = mozilla::media::TimeUnit::Invalid();
|
||||||
} else {
|
} else {
|
||||||
@ -152,17 +149,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::media::TimeInterval> {
|
struct ParamTraits<mozilla::media::TimeInterval> {
|
||||||
typedef mozilla::media::TimeInterval paramType;
|
typedef mozilla::media::TimeInterval paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mStart);
|
WriteParam(aWriter, aParam.mStart);
|
||||||
WriteParam(aMsg, aParam.mEnd);
|
WriteParam(aWriter, aParam.mEnd);
|
||||||
WriteParam(aMsg, aParam.mFuzz);
|
WriteParam(aWriter, aParam.mFuzz);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (ReadParam(aReader, &aResult->mStart) &&
|
||||||
if (ReadParam(aMsg, aIter, &aResult->mStart) &&
|
ReadParam(aReader, &aResult->mEnd) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mEnd) &&
|
ReadParam(aReader, &aResult->mFuzz)) {
|
||||||
ReadParam(aMsg, aIter, &aResult->mFuzz)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -173,16 +169,15 @@ template <>
|
|||||||
struct ParamTraits<mozilla::MediaResult> {
|
struct ParamTraits<mozilla::MediaResult> {
|
||||||
typedef mozilla::MediaResult paramType;
|
typedef mozilla::MediaResult paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.Code());
|
WriteParam(aWriter, aParam.Code());
|
||||||
WriteParam(aMsg, aParam.Message());
|
WriteParam(aWriter, aParam.Message());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsresult result;
|
nsresult result;
|
||||||
nsCString message;
|
nsCString message;
|
||||||
if (ReadParam(aMsg, aIter, &result) && ReadParam(aMsg, aIter, &message)) {
|
if (ReadParam(aReader, &result) && ReadParam(aReader, &message)) {
|
||||||
*aResult = paramType(result, std::move(message));
|
*aResult = paramType(result, std::move(message));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -194,19 +189,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::DecoderDoctorDiagnostics> {
|
struct ParamTraits<mozilla::DecoderDoctorDiagnostics> {
|
||||||
typedef mozilla::DecoderDoctorDiagnostics paramType;
|
typedef mozilla::DecoderDoctorDiagnostics paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mDiagnosticsType);
|
WriteParam(aWriter, aParam.mDiagnosticsType);
|
||||||
WriteParam(aMsg, aParam.mFormat);
|
WriteParam(aWriter, aParam.mFormat);
|
||||||
WriteParam(aMsg, aParam.mFlags);
|
WriteParam(aWriter, aParam.mFlags);
|
||||||
WriteParam(aMsg, aParam.mEvent);
|
WriteParam(aWriter, aParam.mEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (ReadParam(aReader, &aResult->mDiagnosticsType) &&
|
||||||
if (ReadParam(aMsg, aIter, &aResult->mDiagnosticsType) &&
|
ReadParam(aReader, &aResult->mFormat) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mFormat) &&
|
ReadParam(aReader, &aResult->mFlags) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mFlags) &&
|
ReadParam(aReader, &aResult->mEvent)) {
|
||||||
ReadParam(aMsg, aIter, &aResult->mEvent)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -225,17 +219,15 @@ template <>
|
|||||||
struct ParamTraits<mozilla::DecoderDoctorEvent> {
|
struct ParamTraits<mozilla::DecoderDoctorEvent> {
|
||||||
typedef mozilla::DecoderDoctorEvent paramType;
|
typedef mozilla::DecoderDoctorEvent paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
int domain = aParam.mDomain;
|
int domain = aParam.mDomain;
|
||||||
WriteParam(aMsg, domain);
|
WriteParam(aWriter, domain);
|
||||||
WriteParam(aMsg, aParam.mResult);
|
WriteParam(aWriter, aParam.mResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
int domain = 0;
|
int domain = 0;
|
||||||
if (ReadParam(aMsg, aIter, &domain) &&
|
if (ReadParam(aReader, &domain) && ReadParam(aReader, &aResult->mResult)) {
|
||||||
ReadParam(aMsg, aIter, &aResult->mResult)) {
|
|
||||||
aResult->mDomain = paramType::Domain(domain);
|
aResult->mDomain = paramType::Domain(domain);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -138,21 +138,22 @@ RemoteImageHolder::~RemoteImageHolder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void ipc::IPDLParamTraits<RemoteImageHolder>::Write(
|
/* static */ void ipc::IPDLParamTraits<RemoteImageHolder>::Write(
|
||||||
IPC::Message* aMsg, ipc::IProtocol* aActor, RemoteImageHolder&& aParam) {
|
IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSource);
|
RemoteImageHolder&& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSize);
|
WriteIPDLParam(aWriter, aActor, aParam.mSource);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSD);
|
WriteIPDLParam(aWriter, aActor, aParam.mSize);
|
||||||
|
WriteIPDLParam(aWriter, aActor, aParam.mSD);
|
||||||
// Empty this holder.
|
// Empty this holder.
|
||||||
aParam.mSD = Nothing();
|
aParam.mSD = Nothing();
|
||||||
aParam.mManager = nullptr;
|
aParam.mManager = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool ipc::IPDLParamTraits<RemoteImageHolder>::Read(
|
/* static */ bool ipc::IPDLParamTraits<RemoteImageHolder>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, ipc::IProtocol* aActor,
|
IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
RemoteImageHolder* aResult) {
|
RemoteImageHolder* aResult) {
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSource) ||
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mSource) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSize) ||
|
!ReadIPDLParam(aReader, aActor, &aResult->mSize) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSD)) {
|
!ReadIPDLParam(aReader, aActor, &aResult->mSD)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!aResult->IsEmpty()) {
|
if (!aResult->IsEmpty()) {
|
||||||
|
@ -53,10 +53,10 @@ class RemoteImageHolder final {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ipc::IPDLParamTraits<RemoteImageHolder> {
|
struct ipc::IPDLParamTraits<RemoteImageHolder> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
RemoteImageHolder&& aParam);
|
RemoteImageHolder&& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RemoteImageHolder* aResult);
|
RemoteImageHolder* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -107,26 +107,26 @@ already_AddRefed<MediaByteBuffer> RemoteArrayOfByteBuffer::MediaByteBufferAt(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static */ void ipc::IPDLParamTraits<RemoteArrayOfByteBuffer>::Write(
|
/*static */ void ipc::IPDLParamTraits<RemoteArrayOfByteBuffer>::Write(
|
||||||
IPC::Message* aMsg, ipc::IProtocol* aActor,
|
IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
const RemoteArrayOfByteBuffer& aVar) {
|
const RemoteArrayOfByteBuffer& aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mIsValid);
|
WriteIPDLParam(aWriter, aActor, aVar.mIsValid);
|
||||||
// We need the following gymnastic as the Shmem transfered over IPC will be
|
// We need the following gymnastic as the Shmem transfered over IPC will be
|
||||||
// revoked. We must create a temporary one instead so that it can be recycled
|
// revoked. We must create a temporary one instead so that it can be recycled
|
||||||
// later back into the original ShmemPool.
|
// later back into the original ShmemPool.
|
||||||
if (aVar.mBuffers) {
|
if (aVar.mBuffers) {
|
||||||
WriteIPDLParam(aMsg, aActor, Some(ipc::Shmem(*aVar.mBuffers)));
|
WriteIPDLParam(aWriter, aActor, Some(ipc::Shmem(*aVar.mBuffers)));
|
||||||
} else {
|
} else {
|
||||||
WriteIPDLParam(aMsg, aActor, Maybe<ipc::Shmem>());
|
WriteIPDLParam(aWriter, aActor, Maybe<ipc::Shmem>());
|
||||||
}
|
}
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mOffsets);
|
WriteIPDLParam(aWriter, aActor, aVar.mOffsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool ipc::IPDLParamTraits<RemoteArrayOfByteBuffer>::Read(
|
/* static */ bool ipc::IPDLParamTraits<RemoteArrayOfByteBuffer>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter,
|
IPC::MessageReader* aReader, mozilla::ipc::IProtocol* aActor,
|
||||||
mozilla::ipc::IProtocol* aActor, RemoteArrayOfByteBuffer* aVar) {
|
RemoteArrayOfByteBuffer* aVar) {
|
||||||
return ReadIPDLParam(aMsg, aIter, aActor, &aVar->mIsValid) &&
|
return ReadIPDLParam(aReader, aActor, &aVar->mIsValid) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aVar->mBuffers) &&
|
ReadIPDLParam(aReader, aActor, &aVar->mBuffers) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aVar->mOffsets);
|
ReadIPDLParam(aReader, aActor, &aVar->mOffsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ArrayOfRemoteMediaRawData::Fill(
|
bool ArrayOfRemoteMediaRawData::Fill(
|
||||||
@ -211,22 +211,22 @@ already_AddRefed<MediaRawData> ArrayOfRemoteMediaRawData::ElementAt(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static */ void ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData*>::Write(
|
/*static */ void ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData*>::Write(
|
||||||
IPC::Message* aMsg, ipc::IProtocol* aActor,
|
IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
ArrayOfRemoteMediaRawData* aVar) {
|
ArrayOfRemoteMediaRawData* aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mSamples));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mSamples));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mBuffers));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mBuffers));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mAlphaBuffers));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mAlphaBuffers));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mExtraDatas));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mExtraDatas));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData*>::Read(
|
/* static */ bool ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter,
|
IPC::MessageReader* aReader, mozilla::ipc::IProtocol* aActor,
|
||||||
mozilla::ipc::IProtocol* aActor, RefPtr<ArrayOfRemoteMediaRawData>* aVar) {
|
RefPtr<ArrayOfRemoteMediaRawData>* aVar) {
|
||||||
auto array = MakeRefPtr<ArrayOfRemoteMediaRawData>();
|
auto array = MakeRefPtr<ArrayOfRemoteMediaRawData>();
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &array->mSamples) ||
|
if (!ReadIPDLParam(aReader, aActor, &array->mSamples) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &array->mBuffers) ||
|
!ReadIPDLParam(aReader, aActor, &array->mBuffers) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &array->mAlphaBuffers) ||
|
!ReadIPDLParam(aReader, aActor, &array->mAlphaBuffers) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &array->mExtraDatas)) {
|
!ReadIPDLParam(aReader, aActor, &array->mExtraDatas)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aVar = std::move(array);
|
*aVar = std::move(array);
|
||||||
@ -235,24 +235,24 @@ already_AddRefed<MediaRawData> ArrayOfRemoteMediaRawData::ElementAt(
|
|||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData::RemoteMediaRawData>::Write(
|
ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData::RemoteMediaRawData>::Write(
|
||||||
IPC::Message* aMsg, ipc::IProtocol* aActor, const paramType& aVar) {
|
IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mBase);
|
const paramType& aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mEOS);
|
WriteIPDLParam(aWriter, aActor, aVar.mBase);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mHeight);
|
WriteIPDLParam(aWriter, aActor, aVar.mEOS);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mDiscardPadding);
|
WriteIPDLParam(aWriter, aActor, aVar.mHeight);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mOriginalPresentationWindow);
|
WriteIPDLParam(aWriter, aActor, aVar.mDiscardPadding);
|
||||||
|
WriteIPDLParam(aWriter, aActor, aVar.mOriginalPresentationWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool
|
/* static */ bool
|
||||||
ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData::RemoteMediaRawData>::Read(
|
ipc::IPDLParamTraits<ArrayOfRemoteMediaRawData::RemoteMediaRawData>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, ipc::IProtocol* aActor,
|
IPC::MessageReader* aReader, ipc::IProtocol* aActor, paramType* aVar) {
|
||||||
paramType* aVar) {
|
|
||||||
MediaDataIPDL mBase;
|
MediaDataIPDL mBase;
|
||||||
return ReadIPDLParam(aMsg, aIter, aActor, &aVar->mBase) &&
|
return ReadIPDLParam(aReader, aActor, &aVar->mBase) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aVar->mEOS) &&
|
ReadIPDLParam(aReader, aActor, &aVar->mEOS) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aVar->mHeight) &&
|
ReadIPDLParam(aReader, aActor, &aVar->mHeight) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aVar->mDiscardPadding) &&
|
ReadIPDLParam(aReader, aActor, &aVar->mDiscardPadding) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aVar->mOriginalPresentationWindow);
|
ReadIPDLParam(aReader, aActor, &aVar->mOriginalPresentationWindow);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ArrayOfRemoteAudioData::Fill(
|
bool ArrayOfRemoteAudioData::Fill(
|
||||||
@ -304,17 +304,18 @@ already_AddRefed<AudioData> ArrayOfRemoteAudioData::ElementAt(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*static */ void ipc::IPDLParamTraits<ArrayOfRemoteAudioData*>::Write(
|
/*static */ void ipc::IPDLParamTraits<ArrayOfRemoteAudioData*>::Write(
|
||||||
IPC::Message* aMsg, ipc::IProtocol* aActor, ArrayOfRemoteAudioData* aVar) {
|
IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mSamples));
|
ArrayOfRemoteAudioData* aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mBuffers));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mSamples));
|
||||||
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mBuffers));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool ipc::IPDLParamTraits<ArrayOfRemoteAudioData*>::Read(
|
/* static */ bool ipc::IPDLParamTraits<ArrayOfRemoteAudioData*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter,
|
IPC::MessageReader* aReader, mozilla::ipc::IProtocol* aActor,
|
||||||
mozilla::ipc::IProtocol* aActor, RefPtr<ArrayOfRemoteAudioData>* aVar) {
|
RefPtr<ArrayOfRemoteAudioData>* aVar) {
|
||||||
auto array = MakeRefPtr<ArrayOfRemoteAudioData>();
|
auto array = MakeRefPtr<ArrayOfRemoteAudioData>();
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &array->mSamples) ||
|
if (!ReadIPDLParam(aReader, aActor, &array->mSamples) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &array->mBuffers)) {
|
!ReadIPDLParam(aReader, aActor, &array->mBuffers)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aVar = std::move(array);
|
*aVar = std::move(array);
|
||||||
@ -323,30 +324,30 @@ already_AddRefed<AudioData> ArrayOfRemoteAudioData::ElementAt(
|
|||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
ipc::IPDLParamTraits<ArrayOfRemoteAudioData::RemoteAudioData>::Write(
|
ipc::IPDLParamTraits<ArrayOfRemoteAudioData::RemoteAudioData>::Write(
|
||||||
IPC::Message* aMsg, ipc::IProtocol* aActor, const paramType& aVar) {
|
IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mBase);
|
const paramType& aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mChannels);
|
WriteIPDLParam(aWriter, aActor, aVar.mBase);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mRate);
|
WriteIPDLParam(aWriter, aActor, aVar.mChannels);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mChannelMap);
|
WriteIPDLParam(aWriter, aActor, aVar.mRate);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mOriginalTime);
|
WriteIPDLParam(aWriter, aActor, aVar.mChannelMap);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mTrimWindow);
|
WriteIPDLParam(aWriter, aActor, aVar.mOriginalTime);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mFrames);
|
WriteIPDLParam(aWriter, aActor, aVar.mTrimWindow);
|
||||||
WriteIPDLParam(aMsg, aActor, aVar.mDataOffset);
|
WriteIPDLParam(aWriter, aActor, aVar.mFrames);
|
||||||
|
WriteIPDLParam(aWriter, aActor, aVar.mDataOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool
|
/* static */ bool
|
||||||
ipc::IPDLParamTraits<ArrayOfRemoteAudioData::RemoteAudioData>::Read(
|
ipc::IPDLParamTraits<ArrayOfRemoteAudioData::RemoteAudioData>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, ipc::IProtocol* aActor,
|
IPC::MessageReader* aReader, ipc::IProtocol* aActor, paramType* aVar) {
|
||||||
paramType* aVar) {
|
|
||||||
MediaDataIPDL mBase;
|
MediaDataIPDL mBase;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mBase) ||
|
if (!ReadIPDLParam(aReader, aActor, &aVar->mBase) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mChannels) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mChannels) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mRate) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mRate) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mChannelMap) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mChannelMap) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mOriginalTime) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mOriginalTime) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mTrimWindow) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mTrimWindow) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mFrames) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mFrames) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mDataOffset)) {
|
!ReadIPDLParam(aReader, aActor, &aVar->mDataOffset)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -296,20 +296,20 @@ namespace ipc {
|
|||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<RemoteVideoData> {
|
struct IPDLParamTraits<RemoteVideoData> {
|
||||||
typedef RemoteVideoData paramType;
|
typedef RemoteVideoData paramType;
|
||||||
static void Write(IPC::Message* aMsg, ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
paramType&& aVar) {
|
paramType&& aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar.mBase));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar.mBase));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar.mDisplay));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar.mDisplay));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar.mImage));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar.mImage));
|
||||||
aMsg->WriteBytes(&aVar.mFrameID, 4);
|
aWriter->WriteBytes(&aVar.mFrameID, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, mozilla::ipc::IProtocol* aActor,
|
||||||
mozilla::ipc::IProtocol* aActor, paramType* aVar) {
|
paramType* aVar) {
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mBase) ||
|
if (!ReadIPDLParam(aReader, aActor, &aVar->mBase) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mDisplay) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mDisplay) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &aVar->mImage) ||
|
!ReadIPDLParam(aReader, aActor, &aVar->mImage) ||
|
||||||
!aMsg->ReadBytesInto(aIter, &aVar->mFrameID, 4)) {
|
!aReader->ReadBytesInto(&aVar->mFrameID, 4)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -319,15 +319,15 @@ struct IPDLParamTraits<RemoteVideoData> {
|
|||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<ArrayOfRemoteVideoData*> {
|
struct IPDLParamTraits<ArrayOfRemoteVideoData*> {
|
||||||
typedef ArrayOfRemoteVideoData paramType;
|
typedef ArrayOfRemoteVideoData paramType;
|
||||||
static void Write(IPC::Message* aMsg, mozilla::ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter,
|
||||||
paramType* aVar) {
|
mozilla::ipc::IProtocol* aActor, paramType* aVar) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aVar->mArray));
|
WriteIPDLParam(aWriter, aActor, std::move(aVar->mArray));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
ipc::IProtocol* aActor, RefPtr<paramType>* aVar) {
|
RefPtr<paramType>* aVar) {
|
||||||
nsTArray<RemoteVideoData> array;
|
nsTArray<RemoteVideoData> array;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &array)) {
|
if (!ReadIPDLParam(aReader, aActor, &array)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto results = MakeRefPtr<ArrayOfRemoteVideoData>(std::move(array));
|
auto results = MakeRefPtr<ArrayOfRemoteVideoData>(std::move(array));
|
||||||
@ -341,51 +341,51 @@ struct IPDLParamTraits<RemoteArrayOfByteBuffer> {
|
|||||||
typedef RemoteArrayOfByteBuffer paramType;
|
typedef RemoteArrayOfByteBuffer paramType;
|
||||||
// We do not want to move the RemoteArrayOfByteBuffer as we want to recycle
|
// We do not want to move the RemoteArrayOfByteBuffer as we want to recycle
|
||||||
// the shmem it contains for another time.
|
// the shmem it contains for another time.
|
||||||
static void Write(IPC::Message* aMsg, ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
const paramType& aVar);
|
const paramType& aVar);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
ipc::IProtocol* aActor, paramType* aVar);
|
paramType* aVar);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<ArrayOfRemoteMediaRawData::RemoteMediaRawData> {
|
struct IPDLParamTraits<ArrayOfRemoteMediaRawData::RemoteMediaRawData> {
|
||||||
typedef ArrayOfRemoteMediaRawData::RemoteMediaRawData paramType;
|
typedef ArrayOfRemoteMediaRawData::RemoteMediaRawData paramType;
|
||||||
static void Write(IPC::Message* aMsg, ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
const paramType& aVar);
|
const paramType& aVar);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
ipc::IProtocol* aActor, paramType* aVar);
|
paramType* aVar);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<ArrayOfRemoteMediaRawData*> {
|
struct IPDLParamTraits<ArrayOfRemoteMediaRawData*> {
|
||||||
typedef ArrayOfRemoteMediaRawData paramType;
|
typedef ArrayOfRemoteMediaRawData paramType;
|
||||||
static void Write(IPC::Message* aMsg, ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
paramType* aVar);
|
paramType* aVar);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
ipc::IProtocol* aActor, RefPtr<paramType>* aVar);
|
RefPtr<paramType>* aVar);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<ArrayOfRemoteAudioData::RemoteAudioData> {
|
struct IPDLParamTraits<ArrayOfRemoteAudioData::RemoteAudioData> {
|
||||||
typedef ArrayOfRemoteAudioData::RemoteAudioData paramType;
|
typedef ArrayOfRemoteAudioData::RemoteAudioData paramType;
|
||||||
static void Write(IPC::Message* aMsg, ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
const paramType& aVar);
|
const paramType& aVar);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
ipc::IProtocol* aActor, paramType* aVar);
|
paramType* aVar);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<ArrayOfRemoteAudioData*> {
|
struct IPDLParamTraits<ArrayOfRemoteAudioData*> {
|
||||||
typedef ArrayOfRemoteAudioData paramType;
|
typedef ArrayOfRemoteAudioData paramType;
|
||||||
static void Write(IPC::Message* aMsg, ipc::IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, ipc::IProtocol* aActor,
|
||||||
paramType* aVar);
|
paramType* aVar);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, ipc::IProtocol* aActor,
|
||||||
ipc::IProtocol* aActor, RefPtr<paramType>* aVar);
|
RefPtr<paramType>* aVar);
|
||||||
};
|
};
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
|
||||||
|
@ -38,15 +38,14 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::SeekDetails> {
|
struct ParamTraits<mozilla::dom::SeekDetails> {
|
||||||
typedef mozilla::dom::SeekDetails paramType;
|
typedef mozilla::dom::SeekDetails paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mSeekTime);
|
WriteParam(aWriter, aParam.mSeekTime);
|
||||||
WriteParam(aMsg, aParam.mFastSeek);
|
WriteParam(aWriter, aParam.mFastSeek);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &aResult->mSeekTime) ||
|
||||||
if (!ReadParam(aMsg, aIter, &aResult->mSeekTime) ||
|
!ReadParam(aReader, &aResult->mFastSeek)) {
|
||||||
!ReadParam(aMsg, aIter, &aResult->mFastSeek)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -57,15 +56,14 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::MediaControlAction> {
|
struct ParamTraits<mozilla::dom::MediaControlAction> {
|
||||||
typedef mozilla::dom::MediaControlAction paramType;
|
typedef mozilla::dom::MediaControlAction paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mKey);
|
WriteParam(aWriter, aParam.mKey);
|
||||||
WriteParam(aMsg, aParam.mDetails);
|
WriteParam(aWriter, aParam.mDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &aResult->mKey) ||
|
||||||
if (!ReadParam(aMsg, aIter, &aResult->mKey) ||
|
!ReadParam(aReader, &aResult->mDetails)) {
|
||||||
!ReadParam(aMsg, aIter, &aResult->mDetails)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -25,17 +25,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::MediaImage> {
|
struct ParamTraits<mozilla::dom::MediaImage> {
|
||||||
typedef mozilla::dom::MediaImage paramType;
|
typedef mozilla::dom::MediaImage paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mSizes);
|
WriteParam(aWriter, aParam.mSizes);
|
||||||
WriteParam(aMsg, aParam.mSrc);
|
WriteParam(aWriter, aParam.mSrc);
|
||||||
WriteParam(aMsg, aParam.mType);
|
WriteParam(aWriter, aParam.mType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mSizes)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mSizes)) ||
|
!ReadParam(aReader, &(aResult->mSrc)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mSrc)) ||
|
!ReadParam(aReader, &(aResult->mType))) {
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mType))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -46,19 +45,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::MediaMetadataBase> {
|
struct ParamTraits<mozilla::dom::MediaMetadataBase> {
|
||||||
typedef mozilla::dom::MediaMetadataBase paramType;
|
typedef mozilla::dom::MediaMetadataBase paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mTitle);
|
WriteParam(aWriter, aParam.mTitle);
|
||||||
WriteParam(aMsg, aParam.mArtist);
|
WriteParam(aWriter, aParam.mArtist);
|
||||||
WriteParam(aMsg, aParam.mAlbum);
|
WriteParam(aWriter, aParam.mAlbum);
|
||||||
WriteParam(aMsg, aParam.mArtwork);
|
WriteParam(aWriter, aParam.mArtwork);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mTitle)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mTitle)) ||
|
!ReadParam(aReader, &(aResult->mArtist)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mArtist)) ||
|
!ReadParam(aReader, &(aResult->mAlbum)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mAlbum)) ||
|
!ReadParam(aReader, &(aResult->mArtwork))) {
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mArtwork))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -69,17 +67,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::PositionState> {
|
struct ParamTraits<mozilla::dom::PositionState> {
|
||||||
typedef mozilla::dom::PositionState paramType;
|
typedef mozilla::dom::PositionState paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mDuration);
|
WriteParam(aWriter, aParam.mDuration);
|
||||||
WriteParam(aMsg, aParam.mPlaybackRate);
|
WriteParam(aWriter, aParam.mPlaybackRate);
|
||||||
WriteParam(aMsg, aParam.mLastReportedPlaybackPosition);
|
WriteParam(aWriter, aParam.mLastReportedPlaybackPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mDuration)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mDuration)) ||
|
!ReadParam(aReader, &(aResult->mPlaybackRate)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mPlaybackRate)) ||
|
!ReadParam(aReader, &(aResult->mLastReportedPlaybackPosition))) {
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mLastReportedPlaybackPosition))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -99,13 +99,12 @@ struct ParamTraits<
|
|||||||
mozilla::dom::NotReallyMovableButLetsPretendItIsRTCStatsCollection> {
|
mozilla::dom::NotReallyMovableButLetsPretendItIsRTCStatsCollection> {
|
||||||
typedef mozilla::dom::NotReallyMovableButLetsPretendItIsRTCStatsCollection
|
typedef mozilla::dom::NotReallyMovableButLetsPretendItIsRTCStatsCollection
|
||||||
paramType;
|
paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg,
|
WriteParam(aWriter,
|
||||||
static_cast<const mozilla::dom::RTCStatsCollection&>(aParam));
|
static_cast<const mozilla::dom::RTCStatsCollection&>(aParam));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader,
|
||||||
return ReadParam(aMsg, aIter,
|
|
||||||
static_cast<mozilla::dom::RTCStatsCollection*>(aResult));
|
static_cast<mozilla::dom::RTCStatsCollection*>(aResult));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -133,17 +132,18 @@ DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::dom::RTCSdpHistoryEntryInternal,
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::dom::RTCStatsCollection> {
|
struct ParamTraits<mozilla::dom::RTCStatsCollection> {
|
||||||
static void Write(Message* aMsg,
|
static void Write(MessageWriter* aWriter,
|
||||||
const mozilla::dom::RTCStatsCollection& aParam) {
|
const mozilla::dom::RTCStatsCollection& aParam) {
|
||||||
mozilla::dom::ForAllRTCStatsCollectionMembers(
|
mozilla::dom::ForAllRTCStatsCollectionMembers(
|
||||||
aParam, [&](const auto&... aMember) { WriteParams(aMsg, aMember...); });
|
aParam,
|
||||||
|
[&](const auto&... aMember) { WriteParams(aWriter, aMember...); });
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader,
|
||||||
mozilla::dom::RTCStatsCollection* aResult) {
|
mozilla::dom::RTCStatsCollection* aResult) {
|
||||||
return mozilla::dom::ForAllRTCStatsCollectionMembers(
|
return mozilla::dom::ForAllRTCStatsCollectionMembers(
|
||||||
*aResult,
|
*aResult,
|
||||||
[&](auto&... aMember) { return ReadParams(aMsg, aIter, aMember...); });
|
[&](auto&... aMember) { return ReadParams(aReader, aMember...); });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -154,19 +154,18 @@ DEFINE_IPC_SERIALIZER_WITH_SUPER_CLASS_AND_FIELDS(
|
|||||||
|
|
||||||
typedef mozilla::dom::RTCStats RTCStats;
|
typedef mozilla::dom::RTCStats RTCStats;
|
||||||
|
|
||||||
static void WriteRTCStats(Message* aMsg, const RTCStats& aParam) {
|
static void WriteRTCStats(MessageWriter* aWriter, const RTCStats& aParam) {
|
||||||
// RTCStats base class
|
// RTCStats base class
|
||||||
WriteParam(aMsg, aParam.mId);
|
WriteParam(aWriter, aParam.mId);
|
||||||
WriteParam(aMsg, aParam.mTimestamp);
|
WriteParam(aWriter, aParam.mTimestamp);
|
||||||
WriteParam(aMsg, aParam.mType);
|
WriteParam(aWriter, aParam.mType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadRTCStats(const Message* aMsg, PickleIterator* aIter,
|
static bool ReadRTCStats(MessageReader* aReader, RTCStats* aResult) {
|
||||||
RTCStats* aResult) {
|
|
||||||
// RTCStats base class
|
// RTCStats base class
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mId)) ||
|
if (!ReadParam(aReader, &(aResult->mId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mTimestamp)) ||
|
!ReadParam(aReader, &(aResult->mTimestamp)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mType))) {
|
!ReadParam(aReader, &(aResult->mType))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,41 +176,40 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::RTCIceCandidatePairStats> {
|
struct ParamTraits<mozilla::dom::RTCIceCandidatePairStats> {
|
||||||
typedef mozilla::dom::RTCIceCandidatePairStats paramType;
|
typedef mozilla::dom::RTCIceCandidatePairStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mTransportId);
|
WriteParam(aWriter, aParam.mTransportId);
|
||||||
WriteParam(aMsg, aParam.mLocalCandidateId);
|
WriteParam(aWriter, aParam.mLocalCandidateId);
|
||||||
WriteParam(aMsg, aParam.mPriority);
|
WriteParam(aWriter, aParam.mPriority);
|
||||||
WriteParam(aMsg, aParam.mNominated);
|
WriteParam(aWriter, aParam.mNominated);
|
||||||
WriteParam(aMsg, aParam.mWritable);
|
WriteParam(aWriter, aParam.mWritable);
|
||||||
WriteParam(aMsg, aParam.mReadable);
|
WriteParam(aWriter, aParam.mReadable);
|
||||||
WriteParam(aMsg, aParam.mRemoteCandidateId);
|
WriteParam(aWriter, aParam.mRemoteCandidateId);
|
||||||
WriteParam(aMsg, aParam.mSelected);
|
WriteParam(aWriter, aParam.mSelected);
|
||||||
WriteParam(aMsg, aParam.mComponentId);
|
WriteParam(aWriter, aParam.mComponentId);
|
||||||
WriteParam(aMsg, aParam.mState);
|
WriteParam(aWriter, aParam.mState);
|
||||||
WriteParam(aMsg, aParam.mBytesSent);
|
WriteParam(aWriter, aParam.mBytesSent);
|
||||||
WriteParam(aMsg, aParam.mBytesReceived);
|
WriteParam(aWriter, aParam.mBytesReceived);
|
||||||
WriteParam(aMsg, aParam.mLastPacketSentTimestamp);
|
WriteParam(aWriter, aParam.mLastPacketSentTimestamp);
|
||||||
WriteParam(aMsg, aParam.mLastPacketReceivedTimestamp);
|
WriteParam(aWriter, aParam.mLastPacketReceivedTimestamp);
|
||||||
WriteRTCStats(aMsg, aParam);
|
WriteRTCStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mTransportId)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mTransportId)) ||
|
!ReadParam(aReader, &(aResult->mLocalCandidateId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mLocalCandidateId)) ||
|
!ReadParam(aReader, &(aResult->mPriority)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mPriority)) ||
|
!ReadParam(aReader, &(aResult->mNominated)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mNominated)) ||
|
!ReadParam(aReader, &(aResult->mWritable)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mWritable)) ||
|
!ReadParam(aReader, &(aResult->mReadable)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mReadable)) ||
|
!ReadParam(aReader, &(aResult->mRemoteCandidateId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mRemoteCandidateId)) ||
|
!ReadParam(aReader, &(aResult->mSelected)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mSelected)) ||
|
!ReadParam(aReader, &(aResult->mComponentId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mComponentId)) ||
|
!ReadParam(aReader, &(aResult->mState)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mState)) ||
|
!ReadParam(aReader, &(aResult->mBytesSent)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mBytesSent)) ||
|
!ReadParam(aReader, &(aResult->mBytesReceived)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mBytesReceived)) ||
|
!ReadParam(aReader, &(aResult->mLastPacketSentTimestamp)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mLastPacketSentTimestamp)) ||
|
!ReadParam(aReader, &(aResult->mLastPacketReceivedTimestamp)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mLastPacketReceivedTimestamp)) ||
|
!ReadRTCStats(aReader, aResult)) {
|
||||||
!ReadRTCStats(aMsg, aIter, aResult)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,29 +221,28 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::RTCIceCandidateStats> {
|
struct ParamTraits<mozilla::dom::RTCIceCandidateStats> {
|
||||||
typedef mozilla::dom::RTCIceCandidateStats paramType;
|
typedef mozilla::dom::RTCIceCandidateStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mCandidateType);
|
WriteParam(aWriter, aParam.mCandidateType);
|
||||||
WriteParam(aMsg, aParam.mPriority);
|
WriteParam(aWriter, aParam.mPriority);
|
||||||
WriteParam(aMsg, aParam.mTransportId);
|
WriteParam(aWriter, aParam.mTransportId);
|
||||||
WriteParam(aMsg, aParam.mAddress);
|
WriteParam(aWriter, aParam.mAddress);
|
||||||
WriteParam(aMsg, aParam.mRelayProtocol);
|
WriteParam(aWriter, aParam.mRelayProtocol);
|
||||||
WriteParam(aMsg, aParam.mPort);
|
WriteParam(aWriter, aParam.mPort);
|
||||||
WriteParam(aMsg, aParam.mProtocol);
|
WriteParam(aWriter, aParam.mProtocol);
|
||||||
WriteParam(aMsg, aParam.mProxied);
|
WriteParam(aWriter, aParam.mProxied);
|
||||||
WriteRTCStats(aMsg, aParam);
|
WriteRTCStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mCandidateType)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mCandidateType)) ||
|
!ReadParam(aReader, &(aResult->mPriority)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mPriority)) ||
|
!ReadParam(aReader, &(aResult->mTransportId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mTransportId)) ||
|
!ReadParam(aReader, &(aResult->mAddress)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mAddress)) ||
|
!ReadParam(aReader, &(aResult->mRelayProtocol)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mRelayProtocol)) ||
|
!ReadParam(aReader, &(aResult->mPort)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mPort)) ||
|
!ReadParam(aReader, &(aResult->mProtocol)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mProtocol)) ||
|
!ReadParam(aReader, &(aResult->mProxied)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mProxied)) ||
|
!ReadRTCStats(aReader, aResult)) {
|
||||||
!ReadRTCStats(aMsg, aIter, aResult)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,110 +251,107 @@ struct ParamTraits<mozilla::dom::RTCIceCandidateStats> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void WriteRTCRtpStreamStats(
|
static void WriteRTCRtpStreamStats(
|
||||||
Message* aMsg, const mozilla::dom::RTCRtpStreamStats& aParam) {
|
MessageWriter* aWriter, const mozilla::dom::RTCRtpStreamStats& aParam) {
|
||||||
WriteParam(aMsg, aParam.mSsrc);
|
WriteParam(aWriter, aParam.mSsrc);
|
||||||
WriteParam(aMsg, aParam.mMediaType);
|
WriteParam(aWriter, aParam.mMediaType);
|
||||||
WriteParam(aMsg, aParam.mKind);
|
WriteParam(aWriter, aParam.mKind);
|
||||||
WriteParam(aMsg, aParam.mTransportId);
|
WriteParam(aWriter, aParam.mTransportId);
|
||||||
WriteParam(aMsg, aParam.mCodecId);
|
WriteParam(aWriter, aParam.mCodecId);
|
||||||
WriteRTCStats(aMsg, aParam);
|
WriteRTCStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadRTCRtpStreamStats(const Message* aMsg, PickleIterator* aIter,
|
static bool ReadRTCRtpStreamStats(MessageReader* aReader,
|
||||||
mozilla::dom::RTCRtpStreamStats* aResult) {
|
mozilla::dom::RTCRtpStreamStats* aResult) {
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mSsrc)) &&
|
return ReadParam(aReader, &(aResult->mSsrc)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mMediaType)) &&
|
ReadParam(aReader, &(aResult->mMediaType)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mKind)) &&
|
ReadParam(aReader, &(aResult->mKind)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mTransportId)) &&
|
ReadParam(aReader, &(aResult->mTransportId)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mCodecId)) &&
|
ReadParam(aReader, &(aResult->mCodecId)) &&
|
||||||
ReadRTCStats(aMsg, aIter, aResult);
|
ReadRTCStats(aReader, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteRTCReceivedRtpStreamStats(
|
static void WriteRTCReceivedRtpStreamStats(
|
||||||
Message* aMsg, const mozilla::dom::RTCReceivedRtpStreamStats& aParam) {
|
MessageWriter* aWriter,
|
||||||
WriteParam(aMsg, aParam.mPacketsReceived);
|
const mozilla::dom::RTCReceivedRtpStreamStats& aParam) {
|
||||||
WriteParam(aMsg, aParam.mPacketsLost);
|
WriteParam(aWriter, aParam.mPacketsReceived);
|
||||||
WriteParam(aMsg, aParam.mJitter);
|
WriteParam(aWriter, aParam.mPacketsLost);
|
||||||
WriteParam(aMsg, aParam.mDiscardedPackets);
|
WriteParam(aWriter, aParam.mJitter);
|
||||||
WriteParam(aMsg, aParam.mPacketsDiscarded);
|
WriteParam(aWriter, aParam.mDiscardedPackets);
|
||||||
WriteRTCRtpStreamStats(aMsg, aParam);
|
WriteParam(aWriter, aParam.mPacketsDiscarded);
|
||||||
|
WriteRTCRtpStreamStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadRTCReceivedRtpStreamStats(
|
static bool ReadRTCReceivedRtpStreamStats(
|
||||||
const Message* aMsg, PickleIterator* aIter,
|
MessageReader* aReader, mozilla::dom::RTCReceivedRtpStreamStats* aResult) {
|
||||||
mozilla::dom::RTCReceivedRtpStreamStats* aResult) {
|
return ReadParam(aReader, &(aResult->mPacketsReceived)) &&
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mPacketsReceived)) &&
|
ReadParam(aReader, &(aResult->mPacketsLost)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mPacketsLost)) &&
|
ReadParam(aReader, &(aResult->mJitter)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mJitter)) &&
|
ReadParam(aReader, &(aResult->mDiscardedPackets)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mDiscardedPackets)) &&
|
ReadParam(aReader, &(aResult->mPacketsDiscarded)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mPacketsDiscarded)) &&
|
ReadRTCRtpStreamStats(aReader, aResult);
|
||||||
ReadRTCRtpStreamStats(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::dom::RTCInboundRtpStreamStats> {
|
struct ParamTraits<mozilla::dom::RTCInboundRtpStreamStats> {
|
||||||
typedef mozilla::dom::RTCInboundRtpStreamStats paramType;
|
typedef mozilla::dom::RTCInboundRtpStreamStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mRemoteId);
|
WriteParam(aWriter, aParam.mRemoteId);
|
||||||
WriteParam(aMsg, aParam.mFramesDecoded);
|
WriteParam(aWriter, aParam.mFramesDecoded);
|
||||||
WriteParam(aMsg, aParam.mBytesReceived);
|
WriteParam(aWriter, aParam.mBytesReceived);
|
||||||
WriteParam(aMsg, aParam.mNackCount);
|
WriteParam(aWriter, aParam.mNackCount);
|
||||||
WriteParam(aMsg, aParam.mFirCount);
|
WriteParam(aWriter, aParam.mFirCount);
|
||||||
WriteParam(aMsg, aParam.mPliCount);
|
WriteParam(aWriter, aParam.mPliCount);
|
||||||
WriteRTCReceivedRtpStreamStats(aMsg, aParam);
|
WriteRTCReceivedRtpStreamStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mRemoteId)) &&
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mRemoteId)) &&
|
ReadParam(aReader, &(aResult->mFramesDecoded)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mFramesDecoded)) &&
|
ReadParam(aReader, &(aResult->mBytesReceived)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mBytesReceived)) &&
|
ReadParam(aReader, &(aResult->mNackCount)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mNackCount)) &&
|
ReadParam(aReader, &(aResult->mFirCount)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mFirCount)) &&
|
ReadParam(aReader, &(aResult->mPliCount)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mPliCount)) &&
|
ReadRTCReceivedRtpStreamStats(aReader, aResult);
|
||||||
ReadRTCReceivedRtpStreamStats(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void WriteRTCSentRtpStreamStats(
|
static void WriteRTCSentRtpStreamStats(
|
||||||
Message* aMsg, const mozilla::dom::RTCSentRtpStreamStats& aParam) {
|
MessageWriter* aWriter, const mozilla::dom::RTCSentRtpStreamStats& aParam) {
|
||||||
WriteParam(aMsg, aParam.mPacketsSent);
|
WriteParam(aWriter, aParam.mPacketsSent);
|
||||||
WriteParam(aMsg, aParam.mBytesSent);
|
WriteParam(aWriter, aParam.mBytesSent);
|
||||||
WriteRTCRtpStreamStats(aMsg, aParam);
|
WriteRTCRtpStreamStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadRTCSentRtpStreamStats(
|
static bool ReadRTCSentRtpStreamStats(
|
||||||
const Message* aMsg, PickleIterator* aIter,
|
MessageReader* aReader, mozilla::dom::RTCSentRtpStreamStats* aResult) {
|
||||||
mozilla::dom::RTCSentRtpStreamStats* aResult) {
|
return ReadParam(aReader, &(aResult->mPacketsSent)) &&
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mPacketsSent)) &&
|
ReadParam(aReader, &(aResult->mBytesSent)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mBytesSent)) &&
|
ReadRTCRtpStreamStats(aReader, aResult);
|
||||||
ReadRTCRtpStreamStats(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::dom::RTCOutboundRtpStreamStats> {
|
struct ParamTraits<mozilla::dom::RTCOutboundRtpStreamStats> {
|
||||||
typedef mozilla::dom::RTCOutboundRtpStreamStats paramType;
|
typedef mozilla::dom::RTCOutboundRtpStreamStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mRemoteId);
|
WriteParam(aWriter, aParam.mRemoteId);
|
||||||
WriteParam(aMsg, aParam.mFramesEncoded);
|
WriteParam(aWriter, aParam.mFramesEncoded);
|
||||||
WriteParam(aMsg, aParam.mQpSum);
|
WriteParam(aWriter, aParam.mQpSum);
|
||||||
WriteParam(aMsg, aParam.mNackCount);
|
WriteParam(aWriter, aParam.mNackCount);
|
||||||
WriteParam(aMsg, aParam.mFirCount);
|
WriteParam(aWriter, aParam.mFirCount);
|
||||||
WriteParam(aMsg, aParam.mPliCount);
|
WriteParam(aWriter, aParam.mPliCount);
|
||||||
WriteRTCSentRtpStreamStats(aMsg, aParam);
|
WriteRTCSentRtpStreamStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mRemoteId)) &&
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mRemoteId)) &&
|
ReadParam(aReader, &(aResult->mFramesEncoded)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mFramesEncoded)) &&
|
ReadParam(aReader, &(aResult->mQpSum)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mQpSum)) &&
|
ReadParam(aReader, &(aResult->mNackCount)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mNackCount)) &&
|
ReadParam(aReader, &(aResult->mFirCount)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mFirCount)) &&
|
ReadParam(aReader, &(aResult->mPliCount)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mPliCount)) &&
|
ReadRTCSentRtpStreamStats(aReader, aResult);
|
||||||
ReadRTCSentRtpStreamStats(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -365,17 +359,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::RTCRemoteInboundRtpStreamStats> {
|
struct ParamTraits<mozilla::dom::RTCRemoteInboundRtpStreamStats> {
|
||||||
typedef mozilla::dom::RTCRemoteInboundRtpStreamStats paramType;
|
typedef mozilla::dom::RTCRemoteInboundRtpStreamStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mLocalId);
|
WriteParam(aWriter, aParam.mLocalId);
|
||||||
WriteParam(aMsg, aParam.mRoundTripTime);
|
WriteParam(aWriter, aParam.mRoundTripTime);
|
||||||
WriteRTCReceivedRtpStreamStats(aMsg, aParam);
|
WriteRTCReceivedRtpStreamStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mLocalId)) &&
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mLocalId)) &&
|
ReadParam(aReader, &(aResult->mRoundTripTime)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mRoundTripTime)) &&
|
ReadRTCReceivedRtpStreamStats(aReader, aResult);
|
||||||
ReadRTCReceivedRtpStreamStats(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -383,17 +376,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::RTCRemoteOutboundRtpStreamStats> {
|
struct ParamTraits<mozilla::dom::RTCRemoteOutboundRtpStreamStats> {
|
||||||
typedef mozilla::dom::RTCRemoteOutboundRtpStreamStats paramType;
|
typedef mozilla::dom::RTCRemoteOutboundRtpStreamStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mLocalId);
|
WriteParam(aWriter, aParam.mLocalId);
|
||||||
WriteParam(aMsg, aParam.mRemoteTimestamp);
|
WriteParam(aWriter, aParam.mRemoteTimestamp);
|
||||||
WriteRTCSentRtpStreamStats(aMsg, aParam);
|
WriteRTCSentRtpStreamStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &(aResult->mLocalId)) &&
|
||||||
return ReadParam(aMsg, aIter, &(aResult->mLocalId)) &&
|
ReadParam(aReader, &(aResult->mRemoteTimestamp)) &&
|
||||||
ReadParam(aMsg, aIter, &(aResult->mRemoteTimestamp)) &&
|
ReadRTCSentRtpStreamStats(aReader, aResult);
|
||||||
ReadRTCSentRtpStreamStats(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -401,17 +393,16 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::RTCRTPContributingSourceStats> {
|
struct ParamTraits<mozilla::dom::RTCRTPContributingSourceStats> {
|
||||||
typedef mozilla::dom::RTCRTPContributingSourceStats paramType;
|
typedef mozilla::dom::RTCRTPContributingSourceStats paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mContributorSsrc);
|
WriteParam(aWriter, aParam.mContributorSsrc);
|
||||||
WriteParam(aMsg, aParam.mInboundRtpStreamId);
|
WriteParam(aWriter, aParam.mInboundRtpStreamId);
|
||||||
WriteRTCStats(aMsg, aParam);
|
WriteRTCStats(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mContributorSsrc)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mContributorSsrc)) ||
|
!ReadParam(aReader, &(aResult->mInboundRtpStreamId)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mInboundRtpStreamId)) ||
|
!ReadRTCStats(aReader, aResult)) {
|
||||||
!ReadRTCStats(aMsg, aIter, aResult)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -30,22 +30,21 @@ struct ParamTraits<mozilla::dom::OwningStringOrStringSequence> {
|
|||||||
// private generated code. So we have to re-create it.
|
// private generated code. So we have to re-create it.
|
||||||
enum Type { kUninitialized, kString, kStringSequence };
|
enum Type { kUninitialized, kString, kStringSequence };
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
if (aParam.IsString()) {
|
if (aParam.IsString()) {
|
||||||
aMsg->WriteInt16(kString);
|
aWriter->WriteInt16(kString);
|
||||||
WriteParam(aMsg, aParam.GetAsString());
|
WriteParam(aWriter, aParam.GetAsString());
|
||||||
} else if (aParam.IsStringSequence()) {
|
} else if (aParam.IsStringSequence()) {
|
||||||
aMsg->WriteInt16(kStringSequence);
|
aWriter->WriteInt16(kStringSequence);
|
||||||
WriteParam(aMsg, aParam.GetAsStringSequence());
|
WriteParam(aWriter, aParam.GetAsStringSequence());
|
||||||
} else {
|
} else {
|
||||||
aMsg->WriteInt16(kUninitialized);
|
aWriter->WriteInt16(kUninitialized);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
int16_t type;
|
int16_t type;
|
||||||
if (!aMsg->ReadInt16(aIter, &type)) {
|
if (!aReader->ReadInt16(&type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,9 +53,9 @@ struct ParamTraits<mozilla::dom::OwningStringOrStringSequence> {
|
|||||||
aResult->Uninit();
|
aResult->Uninit();
|
||||||
return true;
|
return true;
|
||||||
case kString:
|
case kString:
|
||||||
return ReadParam(aMsg, aIter, &aResult->SetAsString());
|
return ReadParam(aReader, &aResult->SetAsString());
|
||||||
case kStringSequence:
|
case kStringSequence:
|
||||||
return ReadParam(aMsg, aIter, &aResult->SetAsStringSequence());
|
return ReadParam(aReader, &aResult->SetAsStringSequence());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -20,22 +20,22 @@ namespace IPC {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::NrIceStunAddr> {
|
struct ParamTraits<mozilla::NrIceStunAddr> {
|
||||||
static void Write(Message* aMsg, const mozilla::NrIceStunAddr& aParam) {
|
static void Write(MessageWriter* aWriter,
|
||||||
|
const mozilla::NrIceStunAddr& aParam) {
|
||||||
#ifdef MOZ_WEBRTC
|
#ifdef MOZ_WEBRTC
|
||||||
const size_t bufSize = aParam.SerializationBufferSize();
|
const size_t bufSize = aParam.SerializationBufferSize();
|
||||||
char* buffer = new char[bufSize];
|
char* buffer = new char[bufSize];
|
||||||
aParam.Serialize(buffer, bufSize);
|
aParam.Serialize(buffer, bufSize);
|
||||||
aMsg->WriteBytes((void*)buffer, bufSize);
|
aWriter->WriteBytes((void*)buffer, bufSize);
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, mozilla::NrIceStunAddr* aResult) {
|
||||||
mozilla::NrIceStunAddr* aResult) {
|
|
||||||
#ifdef MOZ_WEBRTC
|
#ifdef MOZ_WEBRTC
|
||||||
const size_t bufSize = aResult->SerializationBufferSize();
|
const size_t bufSize = aResult->SerializationBufferSize();
|
||||||
char* buffer = new char[bufSize];
|
char* buffer = new char[bufSize];
|
||||||
bool result = aMsg->ReadBytesInto(aIter, (void*)buffer, bufSize);
|
bool result = aReader->ReadBytesInto((void*)buffer, bufSize);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
result = result && (NS_OK == aResult->Deserialize(buffer, bufSize));
|
result = result && (NS_OK == aResult->Deserialize(buffer, bufSize));
|
||||||
|
@ -26,34 +26,34 @@ void MediaPacket::Copy(const uint8_t* data, size_t len, size_t capacity) {
|
|||||||
memcpy(data_.get(), data, len);
|
memcpy(data_.get(), data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaPacket::Serialize(IPC::Message* aMsg) const {
|
void MediaPacket::Serialize(IPC::MessageWriter* aWriter) const {
|
||||||
aMsg->WriteUInt32(len_);
|
aWriter->WriteUInt32(len_);
|
||||||
aMsg->WriteUInt32(capacity_);
|
aWriter->WriteUInt32(capacity_);
|
||||||
if (len_) {
|
if (len_) {
|
||||||
aMsg->WriteBytes(data_.get(), len_);
|
aWriter->WriteBytes(data_.get(), len_);
|
||||||
}
|
}
|
||||||
aMsg->WriteUInt32(encrypted_len_);
|
aWriter->WriteUInt32(encrypted_len_);
|
||||||
if (encrypted_len_) {
|
if (encrypted_len_) {
|
||||||
aMsg->WriteBytes(encrypted_data_.get(), encrypted_len_);
|
aWriter->WriteBytes(encrypted_data_.get(), encrypted_len_);
|
||||||
}
|
}
|
||||||
aMsg->WriteInt32(sdp_level_.isSome() ? *sdp_level_ : -1);
|
aWriter->WriteInt32(sdp_level_.isSome() ? *sdp_level_ : -1);
|
||||||
aMsg->WriteInt32(type_);
|
aWriter->WriteInt32(type_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MediaPacket::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) {
|
bool MediaPacket::Deserialize(IPC::MessageReader* aReader) {
|
||||||
Reset();
|
Reset();
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
if (!aMsg->ReadUInt32(aIter, &len)) {
|
if (!aReader->ReadUInt32(&len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
uint32_t capacity;
|
uint32_t capacity;
|
||||||
if (!aMsg->ReadUInt32(aIter, &capacity)) {
|
if (!aReader->ReadUInt32(&capacity)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (len) {
|
if (len) {
|
||||||
MOZ_RELEASE_ASSERT(capacity >= len);
|
MOZ_RELEASE_ASSERT(capacity >= len);
|
||||||
UniquePtr<uint8_t[]> data(new uint8_t[capacity]);
|
UniquePtr<uint8_t[]> data(new uint8_t[capacity]);
|
||||||
if (!aMsg->ReadBytesInto(aIter, data.get(), len)) {
|
if (!aReader->ReadBytesInto(data.get(), len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
data_ = std::move(data);
|
data_ = std::move(data);
|
||||||
@ -61,12 +61,12 @@ bool MediaPacket::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) {
|
|||||||
capacity_ = capacity;
|
capacity_ = capacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!aMsg->ReadUInt32(aIter, &len)) {
|
if (!aReader->ReadUInt32(&len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (len) {
|
if (len) {
|
||||||
UniquePtr<uint8_t[]> data(new uint8_t[len]);
|
UniquePtr<uint8_t[]> data(new uint8_t[len]);
|
||||||
if (!aMsg->ReadBytesInto(aIter, data.get(), len)) {
|
if (!aReader->ReadBytesInto(data.get(), len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
encrypted_data_ = std::move(data);
|
encrypted_data_ = std::move(data);
|
||||||
@ -74,7 +74,7 @@ bool MediaPacket::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t sdp_level;
|
int32_t sdp_level;
|
||||||
if (!aMsg->ReadInt32(aIter, &sdp_level)) {
|
if (!aReader->ReadInt32(&sdp_level)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ bool MediaPacket::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t type;
|
int32_t type;
|
||||||
if (!aMsg->ReadInt32(aIter, &type)) {
|
if (!aReader->ReadInt32(&type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
type_ = static_cast<Type>(type);
|
type_ = static_cast<Type>(type);
|
||||||
|
@ -80,8 +80,8 @@ class MediaPacket {
|
|||||||
|
|
||||||
Type type() const { return type_; }
|
Type type() const { return type_; }
|
||||||
|
|
||||||
void Serialize(IPC::Message* aMsg) const;
|
void Serialize(IPC::MessageWriter* aWriter) const;
|
||||||
bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter);
|
bool Deserialize(IPC::MessageReader* aReader);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UniquePtr<uint8_t[]> data_;
|
UniquePtr<uint8_t[]> data_;
|
||||||
@ -102,13 +102,13 @@ struct ParamTraits;
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::MediaPacket> {
|
struct ParamTraits<mozilla::MediaPacket> {
|
||||||
static void Write(Message* aMsg, const mozilla::MediaPacket& aParam) {
|
static void Write(MessageWriter* aWriter,
|
||||||
aParam.Serialize(aMsg);
|
const mozilla::MediaPacket& aParam) {
|
||||||
|
aParam.Serialize(aWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, mozilla::MediaPacket* aResult) {
|
||||||
mozilla::MediaPacket* aResult) {
|
return aResult->Deserialize(aReader);
|
||||||
return aResult->Deserialize(aMsg, aIter);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -428,127 +428,126 @@ namespace ipc {
|
|||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<mozilla::dom::PerformanceTimingData> {
|
struct IPDLParamTraits<mozilla::dom::PerformanceTimingData> {
|
||||||
using paramType = mozilla::dom::PerformanceTimingData;
|
using paramType = mozilla::dom::PerformanceTimingData;
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mServerTiming);
|
WriteIPDLParam(aWriter, aActor, aParam.mServerTiming);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mNextHopProtocol);
|
WriteIPDLParam(aWriter, aActor, aParam.mNextHopProtocol);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mAsyncOpen);
|
WriteIPDLParam(aWriter, aActor, aParam.mAsyncOpen);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mRedirectStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mRedirectStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mRedirectEnd);
|
WriteIPDLParam(aWriter, aActor, aParam.mRedirectEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mDomainLookupStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mDomainLookupStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mDomainLookupEnd);
|
WriteIPDLParam(aWriter, aActor, aParam.mDomainLookupEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mConnectStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mConnectStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSecureConnectionStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mSecureConnectionStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mConnectEnd);
|
WriteIPDLParam(aWriter, aActor, aParam.mConnectEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mRequestStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mRequestStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mResponseStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mResponseStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mCacheReadStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mCacheReadStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mResponseEnd);
|
WriteIPDLParam(aWriter, aActor, aParam.mResponseEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mCacheReadEnd);
|
WriteIPDLParam(aWriter, aActor, aParam.mCacheReadEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mWorkerStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mWorkerStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mWorkerRequestStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mWorkerRequestStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mWorkerResponseEnd);
|
WriteIPDLParam(aWriter, aActor, aParam.mWorkerResponseEnd);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mZeroTime);
|
WriteIPDLParam(aWriter, aActor, aParam.mZeroTime);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mFetchStart);
|
WriteIPDLParam(aWriter, aActor, aParam.mFetchStart);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mEncodedBodySize);
|
WriteIPDLParam(aWriter, aActor, aParam.mEncodedBodySize);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mTransferSize);
|
WriteIPDLParam(aWriter, aActor, aParam.mTransferSize);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mDecodedBodySize);
|
WriteIPDLParam(aWriter, aActor, aParam.mDecodedBodySize);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mRedirectCount);
|
WriteIPDLParam(aWriter, aActor, aParam.mRedirectCount);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mAllRedirectsSameOrigin);
|
WriteIPDLParam(aWriter, aActor, aParam.mAllRedirectsSameOrigin);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mAllRedirectsPassTAO);
|
WriteIPDLParam(aWriter, aActor, aParam.mAllRedirectsPassTAO);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSecureConnection);
|
WriteIPDLParam(aWriter, aActor, aParam.mSecureConnection);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mTimingAllowed);
|
WriteIPDLParam(aWriter, aActor, aParam.mTimingAllowed);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mInitialized);
|
WriteIPDLParam(aWriter, aActor, aParam.mInitialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mServerTiming)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mServerTiming)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mNextHopProtocol)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mNextHopProtocol)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mAsyncOpen)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mAsyncOpen)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRedirectStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mRedirectStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRedirectEnd)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mRedirectEnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDomainLookupStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mDomainLookupStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDomainLookupEnd)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mDomainLookupEnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mConnectStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mConnectStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSecureConnectionStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mSecureConnectionStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mConnectEnd)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mConnectEnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRequestStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mRequestStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResponseStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mResponseStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCacheReadStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mCacheReadStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResponseEnd)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mResponseEnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCacheReadEnd)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mCacheReadEnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mWorkerStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mWorkerStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mWorkerRequestStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mWorkerRequestStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mWorkerResponseEnd)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mWorkerResponseEnd)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mZeroTime)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mZeroTime)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mFetchStart)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mFetchStart)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mEncodedBodySize)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mEncodedBodySize)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mTransferSize)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mTransferSize)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDecodedBodySize)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mDecodedBodySize)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRedirectCount)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mRedirectCount)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor,
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mAllRedirectsSameOrigin)) {
|
||||||
&aResult->mAllRedirectsSameOrigin)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mAllRedirectsPassTAO)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mAllRedirectsPassTAO)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSecureConnection)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mSecureConnection)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mTimingAllowed)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mTimingAllowed)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &aResult->mInitialized)) {
|
if (!ReadIPDLParam(aReader, aActor, &aResult->mInitialized)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -558,7 +557,7 @@ struct IPDLParamTraits<mozilla::dom::PerformanceTimingData> {
|
|||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsCOMPtr<nsIServerTiming>> {
|
struct IPDLParamTraits<nsCOMPtr<nsIServerTiming>> {
|
||||||
using paramType = nsCOMPtr<nsIServerTiming>;
|
using paramType = nsCOMPtr<nsIServerTiming>;
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
nsAutoCString name;
|
nsAutoCString name;
|
||||||
Unused << aParam->GetName(name);
|
Unused << aParam->GetName(name);
|
||||||
@ -566,23 +565,23 @@ struct IPDLParamTraits<nsCOMPtr<nsIServerTiming>> {
|
|||||||
Unused << aParam->GetDuration(&duration);
|
Unused << aParam->GetDuration(&duration);
|
||||||
nsAutoCString description;
|
nsAutoCString description;
|
||||||
Unused << aParam->GetDescription(description);
|
Unused << aParam->GetDescription(description);
|
||||||
WriteIPDLParam(aMsg, aActor, name);
|
WriteIPDLParam(aWriter, aActor, name);
|
||||||
WriteIPDLParam(aMsg, aActor, duration);
|
WriteIPDLParam(aWriter, aActor, duration);
|
||||||
WriteIPDLParam(aMsg, aActor, description);
|
WriteIPDLParam(aWriter, aActor, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
nsAutoCString name;
|
nsAutoCString name;
|
||||||
double duration;
|
double duration;
|
||||||
nsAutoCString description;
|
nsAutoCString description;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &name)) {
|
if (!ReadIPDLParam(aReader, aActor, &name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &duration)) {
|
if (!ReadIPDLParam(aReader, aActor, &duration)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &description)) {
|
if (!ReadIPDLParam(aReader, aActor, &description)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,23 +34,22 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::quota::FullOriginMetadata> {
|
struct ParamTraits<mozilla::dom::quota::FullOriginMetadata> {
|
||||||
using ParamType = mozilla::dom::quota::FullOriginMetadata;
|
using ParamType = mozilla::dom::quota::FullOriginMetadata;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const ParamType& aParam) {
|
static void Write(MessageWriter* aWriter, const ParamType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mSuffix);
|
WriteParam(aWriter, aParam.mSuffix);
|
||||||
WriteParam(aMsg, aParam.mGroup);
|
WriteParam(aWriter, aParam.mGroup);
|
||||||
WriteParam(aMsg, aParam.mOrigin);
|
WriteParam(aWriter, aParam.mOrigin);
|
||||||
WriteParam(aMsg, aParam.mPersistenceType);
|
WriteParam(aWriter, aParam.mPersistenceType);
|
||||||
WriteParam(aMsg, aParam.mPersisted);
|
WriteParam(aWriter, aParam.mPersisted);
|
||||||
WriteParam(aMsg, aParam.mLastAccessTime);
|
WriteParam(aWriter, aParam.mLastAccessTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, ParamType* aResult) {
|
||||||
ParamType* aResult) {
|
return ReadParam(aReader, &aResult->mSuffix) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mSuffix) &&
|
ReadParam(aReader, &aResult->mGroup) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mGroup) &&
|
ReadParam(aReader, &aResult->mOrigin) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mOrigin) &&
|
ReadParam(aReader, &aResult->mPersistenceType) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mPersistenceType) &&
|
ReadParam(aReader, &aResult->mPersisted) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mPersisted) &&
|
ReadParam(aReader, &aResult->mLastAccessTime);
|
||||||
ReadParam(aMsg, aIter, &aResult->mLastAccessTime);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,21 +57,20 @@ template <>
|
|||||||
struct ParamTraits<mozilla::OriginAttributesPattern> {
|
struct ParamTraits<mozilla::OriginAttributesPattern> {
|
||||||
typedef mozilla::OriginAttributesPattern paramType;
|
typedef mozilla::OriginAttributesPattern paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mFirstPartyDomain);
|
WriteParam(aWriter, aParam.mFirstPartyDomain);
|
||||||
WriteParam(aMsg, aParam.mInIsolatedMozBrowser);
|
WriteParam(aWriter, aParam.mInIsolatedMozBrowser);
|
||||||
WriteParam(aMsg, aParam.mPrivateBrowsingId);
|
WriteParam(aWriter, aParam.mPrivateBrowsingId);
|
||||||
WriteParam(aMsg, aParam.mUserContextId);
|
WriteParam(aWriter, aParam.mUserContextId);
|
||||||
WriteParam(aMsg, aParam.mGeckoViewSessionContextId);
|
WriteParam(aWriter, aParam.mGeckoViewSessionContextId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mFirstPartyDomain) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mFirstPartyDomain) &&
|
ReadParam(aReader, &aResult->mInIsolatedMozBrowser) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mInIsolatedMozBrowser) &&
|
ReadParam(aReader, &aResult->mPrivateBrowsingId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mPrivateBrowsingId) &&
|
ReadParam(aReader, &aResult->mUserContextId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mUserContextId) &&
|
ReadParam(aReader, &aResult->mGeckoViewSessionContextId);
|
||||||
ReadParam(aMsg, aIter, &aResult->mGeckoViewSessionContextId);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -242,15 +242,15 @@ void FeaturePolicyUtils::ReportViolation(Document* aDocument,
|
|||||||
} // namespace dom
|
} // namespace dom
|
||||||
|
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
void IPDLParamTraits<dom::FeaturePolicy*>::Write(IPC::Message* aMsg,
|
void IPDLParamTraits<dom::FeaturePolicy*>::Write(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
dom::FeaturePolicy* aParam) {
|
dom::FeaturePolicy* aParam) {
|
||||||
if (!aParam) {
|
if (!aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, false);
|
WriteIPDLParam(aWriter, aActor, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteIPDLParam(aMsg, aActor, true);
|
WriteIPDLParam(aWriter, aActor, true);
|
||||||
|
|
||||||
dom::FeaturePolicyInfo info;
|
dom::FeaturePolicyInfo info;
|
||||||
info.defaultOrigin() = aParam->DefaultOrigin();
|
info.defaultOrigin() = aParam->DefaultOrigin();
|
||||||
@ -263,15 +263,15 @@ void IPDLParamTraits<dom::FeaturePolicy*>::Write(IPC::Message* aMsg,
|
|||||||
info.attributeEnabledFeatureNames() =
|
info.attributeEnabledFeatureNames() =
|
||||||
aParam->AttributeEnabledFeatureNames().Clone();
|
aParam->AttributeEnabledFeatureNames().Clone();
|
||||||
|
|
||||||
WriteIPDLParam(aMsg, aActor, info);
|
WriteIPDLParam(aWriter, aActor, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<dom::FeaturePolicy*>::Read(
|
bool IPDLParamTraits<dom::FeaturePolicy*>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
RefPtr<dom::FeaturePolicy>* aResult) {
|
RefPtr<dom::FeaturePolicy>* aResult) {
|
||||||
*aResult = nullptr;
|
*aResult = nullptr;
|
||||||
bool notnull = false;
|
bool notnull = false;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, ¬null)) {
|
if (!ReadIPDLParam(aReader, aActor, ¬null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ bool IPDLParamTraits<dom::FeaturePolicy*>::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
dom::FeaturePolicyInfo info;
|
dom::FeaturePolicyInfo info;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &info)) {
|
if (!ReadIPDLParam(aReader, aActor, &info)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,10 +80,9 @@ struct IPDLParamTraits;
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<mozilla::dom::FeaturePolicy*> {
|
struct IPDLParamTraits<mozilla::dom::FeaturePolicy*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
mozilla::dom::FeaturePolicy* aParam);
|
mozilla::dom::FeaturePolicy* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor,
|
|
||||||
RefPtr<mozilla::dom::FeaturePolicy>* aResult);
|
RefPtr<mozilla::dom::FeaturePolicy>* aResult);
|
||||||
};
|
};
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -18,16 +18,15 @@ struct ParamTraits<
|
|||||||
mozilla::PermissionDelegateHandler::DelegatedPermissionList> {
|
mozilla::PermissionDelegateHandler::DelegatedPermissionList> {
|
||||||
typedef mozilla::PermissionDelegateHandler::DelegatedPermissionList paramType;
|
typedef mozilla::PermissionDelegateHandler::DelegatedPermissionList paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
for (auto& permission : aParam.mPermissions) {
|
for (auto& permission : aParam.mPermissions) {
|
||||||
WriteParam(aMsg, permission);
|
WriteParam(aWriter, permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
for (auto& permission : aResult->mPermissions) {
|
for (auto& permission : aResult->mPermissions) {
|
||||||
if (!ReadParam(aMsg, aIter, &permission)) {
|
if (!ReadParam(aReader, &permission)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,40 +27,39 @@ const DXGI_ADAPTER_DESC& DxgiAdapterDesc::ToDesc() const {
|
|||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
void ParamTraits<DxgiAdapterDesc>::Write(Message* aMsg,
|
void ParamTraits<DxgiAdapterDesc>::Write(MessageWriter* aWriter,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
aMsg->WriteBytes(aParam.Description, sizeof(aParam.Description));
|
aWriter->WriteBytes(aParam.Description, sizeof(aParam.Description));
|
||||||
WriteParam(aMsg, aParam.VendorId);
|
WriteParam(aWriter, aParam.VendorId);
|
||||||
WriteParam(aMsg, aParam.DeviceId);
|
WriteParam(aWriter, aParam.DeviceId);
|
||||||
WriteParam(aMsg, aParam.SubSysId);
|
WriteParam(aWriter, aParam.SubSysId);
|
||||||
WriteParam(aMsg, aParam.Revision);
|
WriteParam(aWriter, aParam.Revision);
|
||||||
WriteParam(aMsg, aParam.DedicatedVideoMemory);
|
WriteParam(aWriter, aParam.DedicatedVideoMemory);
|
||||||
WriteParam(aMsg, aParam.DedicatedSystemMemory);
|
WriteParam(aWriter, aParam.DedicatedSystemMemory);
|
||||||
WriteParam(aMsg, aParam.SharedSystemMemory);
|
WriteParam(aWriter, aParam.SharedSystemMemory);
|
||||||
WriteParam(aMsg, aParam.AdapterLuid.LowPart);
|
WriteParam(aWriter, aParam.AdapterLuid.LowPart);
|
||||||
WriteParam(aMsg, aParam.AdapterLuid.HighPart);
|
WriteParam(aWriter, aParam.AdapterLuid.HighPart);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParamTraits<DxgiAdapterDesc>::Read(const Message* aMsg,
|
bool ParamTraits<DxgiAdapterDesc>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
paramType* aResult) {
|
paramType* aResult) {
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
if (!aMsg->ReadBytesInto(aIter, aResult->Description,
|
if (!aReader->ReadBytesInto(aResult->Description,
|
||||||
sizeof(aResult->Description))) {
|
sizeof(aResult->Description))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ReadParam(aMsg, aIter, &aResult->VendorId) &&
|
if (ReadParam(aReader, &aResult->VendorId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->DeviceId) &&
|
ReadParam(aReader, &aResult->DeviceId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->SubSysId) &&
|
ReadParam(aReader, &aResult->SubSysId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->Revision) &&
|
ReadParam(aReader, &aResult->Revision) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->DedicatedVideoMemory) &&
|
ReadParam(aReader, &aResult->DedicatedVideoMemory) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->DedicatedSystemMemory) &&
|
ReadParam(aReader, &aResult->DedicatedSystemMemory) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->SharedSystemMemory) &&
|
ReadParam(aReader, &aResult->SharedSystemMemory) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->AdapterLuid.LowPart) &&
|
ReadParam(aReader, &aResult->AdapterLuid.LowPart) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->AdapterLuid.HighPart)) {
|
ReadParam(aReader, &aResult->AdapterLuid.HighPart)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -37,9 +37,8 @@ namespace IPC {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<DxgiAdapterDesc> {
|
struct ParamTraits<DxgiAdapterDesc> {
|
||||||
typedef DxgiAdapterDesc paramType;
|
typedef DxgiAdapterDesc paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam);
|
static void Write(MessageWriter* aWriter, const paramType& aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult);
|
||||||
paramType* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -180,21 +180,20 @@ template <>
|
|||||||
struct ParamTraits<mozilla::layers::APZTestData> {
|
struct ParamTraits<mozilla::layers::APZTestData> {
|
||||||
typedef mozilla::layers::APZTestData paramType;
|
typedef mozilla::layers::APZTestData paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mPaints);
|
WriteParam(aWriter, aParam.mPaints);
|
||||||
WriteParam(aMsg, aParam.mRepaintRequests);
|
WriteParam(aWriter, aParam.mRepaintRequests);
|
||||||
WriteParam(aMsg, aParam.mHitResults);
|
WriteParam(aWriter, aParam.mHitResults);
|
||||||
WriteParam(aMsg, aParam.mSampledResults);
|
WriteParam(aWriter, aParam.mSampledResults);
|
||||||
WriteParam(aMsg, aParam.mAdditionalData);
|
WriteParam(aWriter, aParam.mAdditionalData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return (ReadParam(aReader, &aResult->mPaints) &&
|
||||||
return (ReadParam(aMsg, aIter, &aResult->mPaints) &&
|
ReadParam(aReader, &aResult->mRepaintRequests) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mRepaintRequests) &&
|
ReadParam(aReader, &aResult->mHitResults) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mHitResults) &&
|
ReadParam(aReader, &aResult->mSampledResults) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mSampledResults) &&
|
ReadParam(aReader, &aResult->mAdditionalData));
|
||||||
ReadParam(aMsg, aIter, &aResult->mAdditionalData));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -214,19 +213,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::layers::APZTestData::HitResult> {
|
struct ParamTraits<mozilla::layers::APZTestData::HitResult> {
|
||||||
typedef mozilla::layers::APZTestData::HitResult paramType;
|
typedef mozilla::layers::APZTestData::HitResult paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.point);
|
WriteParam(aWriter, aParam.point);
|
||||||
WriteParam(aMsg, aParam.result);
|
WriteParam(aWriter, aParam.result);
|
||||||
WriteParam(aMsg, aParam.layersId);
|
WriteParam(aWriter, aParam.layersId);
|
||||||
WriteParam(aMsg, aParam.scrollId);
|
WriteParam(aWriter, aParam.scrollId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return (ReadParam(aReader, &aResult->point) &&
|
||||||
return (ReadParam(aMsg, aIter, &aResult->point) &&
|
ReadParam(aReader, &aResult->result) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->result) &&
|
ReadParam(aReader, &aResult->layersId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->layersId) &&
|
ReadParam(aReader, &aResult->scrollId));
|
||||||
ReadParam(aMsg, aIter, &aResult->scrollId));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -234,19 +232,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::layers::APZTestData::SampledResult> {
|
struct ParamTraits<mozilla::layers::APZTestData::SampledResult> {
|
||||||
typedef mozilla::layers::APZTestData::SampledResult paramType;
|
typedef mozilla::layers::APZTestData::SampledResult paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.scrollOffset);
|
WriteParam(aWriter, aParam.scrollOffset);
|
||||||
WriteParam(aMsg, aParam.sampledTimeStamp);
|
WriteParam(aWriter, aParam.sampledTimeStamp);
|
||||||
WriteParam(aMsg, aParam.layersId);
|
WriteParam(aWriter, aParam.layersId);
|
||||||
WriteParam(aMsg, aParam.scrollId);
|
WriteParam(aWriter, aParam.scrollId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return (ReadParam(aReader, &aResult->scrollOffset) &&
|
||||||
return (ReadParam(aMsg, aIter, &aResult->scrollOffset) &&
|
ReadParam(aReader, &aResult->sampledTimeStamp) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->sampledTimeStamp) &&
|
ReadParam(aReader, &aResult->layersId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->layersId) &&
|
ReadParam(aReader, &aResult->scrollId));
|
||||||
ReadParam(aMsg, aIter, &aResult->scrollId));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,14 +34,13 @@ template <>
|
|||||||
struct ParamTraits<mozilla::layers::FrameUniformityData> {
|
struct ParamTraits<mozilla::layers::FrameUniformityData> {
|
||||||
typedef mozilla::layers::FrameUniformityData paramType;
|
typedef mozilla::layers::FrameUniformityData paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mUniformities);
|
WriteParam(aWriter, aParam.mUniformities);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
return ParamTraitsStd<std::map<uintptr_t, float>>::Read(
|
return ParamTraitsStd<std::map<uintptr_t, float>>::Read(
|
||||||
aMsg, aIter, &aResult->mUniformities);
|
aReader, &aResult->mUniformities);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -40,13 +40,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::layers::SharedSurfacesMemoryReport> {
|
struct ParamTraits<mozilla::layers::SharedSurfacesMemoryReport> {
|
||||||
typedef mozilla::layers::SharedSurfacesMemoryReport paramType;
|
typedef mozilla::layers::SharedSurfacesMemoryReport paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mSurfaces);
|
WriteParam(aWriter, aParam.mSurfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mSurfaces);
|
||||||
return ReadParam(aMsg, aIter, &aResult->mSurfaces);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,57 +12,56 @@ namespace mozilla {
|
|||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
void IPDLParamTraits<mozilla::layers::DisplayListData>::Write(
|
void IPDLParamTraits<mozilla::layers::DisplayListData>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam) {
|
IPC::MessageWriter* aWriter, IProtocol* aActor, paramType&& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mIdNamespace);
|
WriteIPDLParam(aWriter, aActor, aParam.mIdNamespace);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mRect);
|
WriteIPDLParam(aWriter, aActor, aParam.mRect);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mCommands);
|
WriteIPDLParam(aWriter, aActor, aParam.mCommands);
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mDLItems));
|
WriteIPDLParam(aWriter, aActor, std::move(aParam.mDLItems));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mDLCache));
|
WriteIPDLParam(aWriter, aActor, std::move(aParam.mDLCache));
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mDLSpatialTree));
|
WriteIPDLParam(aWriter, aActor, std::move(aParam.mDLSpatialTree));
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mDLDesc);
|
WriteIPDLParam(aWriter, aActor, aParam.mDLDesc);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mRemotePipelineIds);
|
WriteIPDLParam(aWriter, aActor, aParam.mRemotePipelineIds);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mResourceUpdates);
|
WriteIPDLParam(aWriter, aActor, aParam.mResourceUpdates);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSmallShmems);
|
WriteIPDLParam(aWriter, aActor, aParam.mSmallShmems);
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mLargeShmems));
|
WriteIPDLParam(aWriter, aActor, std::move(aParam.mLargeShmems));
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollData);
|
WriteIPDLParam(aWriter, aActor, aParam.mScrollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<mozilla::layers::DisplayListData>::Read(
|
bool IPDLParamTraits<mozilla::layers::DisplayListData>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (ReadIPDLParam(aReader, aActor, &aResult->mIdNamespace) &&
|
||||||
if (ReadIPDLParam(aMsg, aIter, aActor, &aResult->mIdNamespace) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mRect) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRect) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mCommands) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCommands) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mDLItems) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDLItems) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mDLCache) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDLCache) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mDLSpatialTree) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDLSpatialTree) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mDLDesc) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDLDesc) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mRemotePipelineIds) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRemotePipelineIds) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mResourceUpdates) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResourceUpdates) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mSmallShmems) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSmallShmems) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mLargeShmems) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLargeShmems) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mScrollData)) {
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollData)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteScrollUpdates(IPC::Message* aMsg, IProtocol* aActor,
|
void WriteScrollUpdates(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
layers::ScrollUpdatesMap& aParam) {
|
layers::ScrollUpdatesMap& aParam) {
|
||||||
// ICK: we need to manually serialize this map because
|
// ICK: we need to manually serialize this map because
|
||||||
// nsDataHashTable doesn't support it (and other maps cause other issues)
|
// nsDataHashTable doesn't support it (and other maps cause other issues)
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.Count());
|
WriteIPDLParam(aWriter, aActor, aParam.Count());
|
||||||
for (auto it = aParam.ConstIter(); !it.Done(); it.Next()) {
|
for (auto it = aParam.ConstIter(); !it.Done(); it.Next()) {
|
||||||
WriteIPDLParam(aMsg, aActor, it.Key());
|
WriteIPDLParam(aWriter, aActor, it.Key());
|
||||||
WriteIPDLParam(aMsg, aActor, it.Data());
|
WriteIPDLParam(aWriter, aActor, it.Data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReadScrollUpdates(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool ReadScrollUpdates(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, layers::ScrollUpdatesMap* aResult) {
|
layers::ScrollUpdatesMap* aResult) {
|
||||||
// Manually deserialize mScrollUpdates as a stream of K,V pairs
|
// Manually deserialize mScrollUpdates as a stream of K,V pairs
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &count)) {
|
if (!ReadIPDLParam(aReader, aActor, &count)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,8 +69,8 @@ bool ReadScrollUpdates(const IPC::Message* aMsg, PickleIterator* aIter,
|
|||||||
for (size_t i = 0; i < count; ++i) {
|
for (size_t i = 0; i < count; ++i) {
|
||||||
layers::ScrollableLayerGuid::ViewID key;
|
layers::ScrollableLayerGuid::ViewID key;
|
||||||
nsTArray<mozilla::ScrollPositionUpdate> data;
|
nsTArray<mozilla::ScrollPositionUpdate> data;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &key) ||
|
if (!ReadIPDLParam(aReader, aActor, &key) ||
|
||||||
!ReadIPDLParam(aMsg, aIter, aActor, &data)) {
|
!ReadIPDLParam(aReader, aActor, &data)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
map.InsertOrUpdate(key, std::move(data));
|
map.InsertOrUpdate(key, std::move(data));
|
||||||
@ -83,26 +82,25 @@ bool ReadScrollUpdates(const IPC::Message* aMsg, PickleIterator* aIter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<mozilla::layers::TransactionData>::Write(
|
void IPDLParamTraits<mozilla::layers::TransactionData>::Write(
|
||||||
IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam) {
|
IPC::MessageWriter* aWriter, IProtocol* aActor, paramType&& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mIdNamespace);
|
WriteIPDLParam(aWriter, aActor, aParam.mIdNamespace);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mCommands);
|
WriteIPDLParam(aWriter, aActor, aParam.mCommands);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mResourceUpdates);
|
WriteIPDLParam(aWriter, aActor, aParam.mResourceUpdates);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mSmallShmems);
|
WriteIPDLParam(aWriter, aActor, aParam.mSmallShmems);
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mLargeShmems));
|
WriteIPDLParam(aWriter, aActor, std::move(aParam.mLargeShmems));
|
||||||
WriteScrollUpdates(aMsg, aActor, aParam.mScrollUpdates);
|
WriteScrollUpdates(aWriter, aActor, aParam.mScrollUpdates);
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.mPaintSequenceNumber);
|
WriteIPDLParam(aWriter, aActor, aParam.mPaintSequenceNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<mozilla::layers::TransactionData>::Read(
|
bool IPDLParamTraits<mozilla::layers::TransactionData>::Read(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (ReadIPDLParam(aReader, aActor, &aResult->mIdNamespace) &&
|
||||||
if (ReadIPDLParam(aMsg, aIter, aActor, &aResult->mIdNamespace) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mCommands) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCommands) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mResourceUpdates) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResourceUpdates) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mSmallShmems) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSmallShmems) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mLargeShmems) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLargeShmems) &&
|
ReadScrollUpdates(aReader, aActor, &aResult->mScrollUpdates) &&
|
||||||
ReadScrollUpdates(aMsg, aIter, aActor, &aResult->mScrollUpdates) &&
|
ReadIPDLParam(aReader, aActor, &aResult->mPaintSequenceNumber)) {
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mPaintSequenceNumber)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -51,20 +51,22 @@ template <>
|
|||||||
struct IPDLParamTraits<mozilla::layers::DisplayListData> {
|
struct IPDLParamTraits<mozilla::layers::DisplayListData> {
|
||||||
typedef mozilla::layers::DisplayListData paramType;
|
typedef mozilla::layers::DisplayListData paramType;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam);
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
paramType&& aParam);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult);
|
paramType* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<mozilla::layers::TransactionData> {
|
struct IPDLParamTraits<mozilla::layers::TransactionData> {
|
||||||
typedef mozilla::layers::TransactionData paramType;
|
typedef mozilla::layers::TransactionData paramType;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam);
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
paramType&& aParam);
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult);
|
paramType* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -21,16 +21,15 @@ template <>
|
|||||||
struct ParamTraits<mozilla::wr::ByteBuffer> {
|
struct ParamTraits<mozilla::wr::ByteBuffer> {
|
||||||
typedef mozilla::wr::ByteBuffer paramType;
|
typedef mozilla::wr::ByteBuffer paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mLength);
|
WriteParam(aWriter, aParam.mLength);
|
||||||
aMsg->WriteBytes(aParam.mData, aParam.mLength);
|
aWriter->WriteBytes(aParam.mData, aParam.mLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
size_t length;
|
size_t length;
|
||||||
return ReadParam(aMsg, aIter, &length) && aResult->Allocate(length) &&
|
return ReadParam(aReader, &length) && aResult->Allocate(length) &&
|
||||||
aMsg->ReadBytesInto(aIter, aResult->mData, length);
|
aReader->ReadBytesInto(aResult->mData, length);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -38,21 +37,20 @@ template <>
|
|||||||
struct ParamTraits<mozilla::wr::ImageDescriptor> {
|
struct ParamTraits<mozilla::wr::ImageDescriptor> {
|
||||||
typedef mozilla::wr::ImageDescriptor paramType;
|
typedef mozilla::wr::ImageDescriptor paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.format);
|
WriteParam(aWriter, aParam.format);
|
||||||
WriteParam(aMsg, aParam.width);
|
WriteParam(aWriter, aParam.width);
|
||||||
WriteParam(aMsg, aParam.height);
|
WriteParam(aWriter, aParam.height);
|
||||||
WriteParam(aMsg, aParam.stride);
|
WriteParam(aWriter, aParam.stride);
|
||||||
WriteParam(aMsg, aParam.opacity);
|
WriteParam(aWriter, aParam.opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->format) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->format) &&
|
ReadParam(aReader, &aResult->width) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->width) &&
|
ReadParam(aReader, &aResult->height) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->height) &&
|
ReadParam(aReader, &aResult->stride) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->stride) &&
|
ReadParam(aReader, &aResult->opacity);
|
||||||
ReadParam(aMsg, aIter, &aResult->opacity);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -354,71 +354,71 @@ bool WebRenderScrollData::RepopulateMap() {
|
|||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
void ParamTraits<mozilla::layers::WebRenderLayerScrollData>::Write(
|
void ParamTraits<mozilla::layers::WebRenderLayerScrollData>::Write(
|
||||||
Message* aMsg, const paramType& aParam) {
|
MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mDescendantCount);
|
WriteParam(aWriter, aParam.mDescendantCount);
|
||||||
WriteParam(aMsg, aParam.mScrollIds);
|
WriteParam(aWriter, aParam.mScrollIds);
|
||||||
WriteParam(aMsg, aParam.mAncestorTransform);
|
WriteParam(aWriter, aParam.mAncestorTransform);
|
||||||
WriteParam(aMsg, aParam.mAncestorTransformId);
|
WriteParam(aWriter, aParam.mAncestorTransformId);
|
||||||
WriteParam(aMsg, aParam.mTransform);
|
WriteParam(aWriter, aParam.mTransform);
|
||||||
WriteParam(aMsg, aParam.mTransformIsPerspective);
|
WriteParam(aWriter, aParam.mTransformIsPerspective);
|
||||||
WriteParam(aMsg, aParam.mResolution);
|
WriteParam(aWriter, aParam.mResolution);
|
||||||
WriteParam(aMsg, aParam.mVisibleRegion);
|
WriteParam(aWriter, aParam.mVisibleRegion);
|
||||||
WriteParam(aMsg, aParam.mRemoteDocumentSize);
|
WriteParam(aWriter, aParam.mRemoteDocumentSize);
|
||||||
WriteParam(aMsg, aParam.mReferentId);
|
WriteParam(aWriter, aParam.mReferentId);
|
||||||
WriteParam(aMsg, aParam.mEventRegionsOverride);
|
WriteParam(aWriter, aParam.mEventRegionsOverride);
|
||||||
WriteParam(aMsg, aParam.mScrollbarData);
|
WriteParam(aWriter, aParam.mScrollbarData);
|
||||||
WriteParam(aMsg, aParam.mScrollbarAnimationId);
|
WriteParam(aWriter, aParam.mScrollbarAnimationId);
|
||||||
WriteParam(aMsg, aParam.mFixedPositionAnimationId);
|
WriteParam(aWriter, aParam.mFixedPositionAnimationId);
|
||||||
WriteParam(aMsg, aParam.mFixedPositionSides);
|
WriteParam(aWriter, aParam.mFixedPositionSides);
|
||||||
WriteParam(aMsg, aParam.mFixedPosScrollContainerId);
|
WriteParam(aWriter, aParam.mFixedPosScrollContainerId);
|
||||||
WriteParam(aMsg, aParam.mStickyPosScrollContainerId);
|
WriteParam(aWriter, aParam.mStickyPosScrollContainerId);
|
||||||
WriteParam(aMsg, aParam.mStickyScrollRangeOuter);
|
WriteParam(aWriter, aParam.mStickyScrollRangeOuter);
|
||||||
WriteParam(aMsg, aParam.mStickyScrollRangeInner);
|
WriteParam(aWriter, aParam.mStickyScrollRangeInner);
|
||||||
WriteParam(aMsg, aParam.mStickyPositionAnimationId);
|
WriteParam(aWriter, aParam.mStickyPositionAnimationId);
|
||||||
WriteParam(aMsg, aParam.mZoomAnimationId);
|
WriteParam(aWriter, aParam.mZoomAnimationId);
|
||||||
WriteParam(aMsg, aParam.mAsyncZoomContainerId);
|
WriteParam(aWriter, aParam.mAsyncZoomContainerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParamTraits<mozilla::layers::WebRenderLayerScrollData>::Read(
|
bool ParamTraits<mozilla::layers::WebRenderLayerScrollData>::Read(
|
||||||
const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
|
MessageReader* aReader, paramType* aResult) {
|
||||||
return ReadParam(aMsg, aIter, &aResult->mDescendantCount) &&
|
return ReadParam(aReader, &aResult->mDescendantCount) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mScrollIds) &&
|
ReadParam(aReader, &aResult->mScrollIds) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mAncestorTransform) &&
|
ReadParam(aReader, &aResult->mAncestorTransform) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mAncestorTransformId) &&
|
ReadParam(aReader, &aResult->mAncestorTransformId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mTransform) &&
|
ReadParam(aReader, &aResult->mTransform) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mTransformIsPerspective) &&
|
ReadParam(aReader, &aResult->mTransformIsPerspective) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mResolution) &&
|
ReadParam(aReader, &aResult->mResolution) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mVisibleRegion) &&
|
ReadParam(aReader, &aResult->mVisibleRegion) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mRemoteDocumentSize) &&
|
ReadParam(aReader, &aResult->mRemoteDocumentSize) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mReferentId) &&
|
ReadParam(aReader, &aResult->mReferentId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mEventRegionsOverride) &&
|
ReadParam(aReader, &aResult->mEventRegionsOverride) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mScrollbarData) &&
|
ReadParam(aReader, &aResult->mScrollbarData) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mScrollbarAnimationId) &&
|
ReadParam(aReader, &aResult->mScrollbarAnimationId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mFixedPositionAnimationId) &&
|
ReadParam(aReader, &aResult->mFixedPositionAnimationId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mFixedPositionSides) &&
|
ReadParam(aReader, &aResult->mFixedPositionSides) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mFixedPosScrollContainerId) &&
|
ReadParam(aReader, &aResult->mFixedPosScrollContainerId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mStickyPosScrollContainerId) &&
|
ReadParam(aReader, &aResult->mStickyPosScrollContainerId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mStickyScrollRangeOuter) &&
|
ReadParam(aReader, &aResult->mStickyScrollRangeOuter) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mStickyScrollRangeInner) &&
|
ReadParam(aReader, &aResult->mStickyScrollRangeInner) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mStickyPositionAnimationId) &&
|
ReadParam(aReader, &aResult->mStickyPositionAnimationId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mZoomAnimationId) &&
|
ReadParam(aReader, &aResult->mZoomAnimationId) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mAsyncZoomContainerId);
|
ReadParam(aReader, &aResult->mAsyncZoomContainerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParamTraits<mozilla::layers::WebRenderScrollData>::Write(
|
void ParamTraits<mozilla::layers::WebRenderScrollData>::Write(
|
||||||
Message* aMsg, const paramType& aParam) {
|
MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mScrollMetadatas);
|
WriteParam(aWriter, aParam.mScrollMetadatas);
|
||||||
WriteParam(aMsg, aParam.mLayerScrollData);
|
WriteParam(aWriter, aParam.mLayerScrollData);
|
||||||
WriteParam(aMsg, aParam.mIsFirstPaint);
|
WriteParam(aWriter, aParam.mIsFirstPaint);
|
||||||
WriteParam(aMsg, aParam.mPaintSequenceNumber);
|
WriteParam(aWriter, aParam.mPaintSequenceNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParamTraits<mozilla::layers::WebRenderScrollData>::Read(
|
bool ParamTraits<mozilla::layers::WebRenderScrollData>::Read(
|
||||||
const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
|
MessageReader* aReader, paramType* aResult) {
|
||||||
return ReadParam(aMsg, aIter, &aResult->mScrollMetadatas) &&
|
return ReadParam(aReader, &aResult->mScrollMetadatas) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mLayerScrollData) &&
|
ReadParam(aReader, &aResult->mLayerScrollData) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mIsFirstPaint) &&
|
ReadParam(aReader, &aResult->mIsFirstPaint) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mPaintSequenceNumber) &&
|
ReadParam(aReader, &aResult->mPaintSequenceNumber) &&
|
||||||
aResult->RepopulateMap();
|
aResult->RepopulateMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,20 +328,18 @@ template <>
|
|||||||
struct ParamTraits<mozilla::layers::WebRenderLayerScrollData> {
|
struct ParamTraits<mozilla::layers::WebRenderLayerScrollData> {
|
||||||
typedef mozilla::layers::WebRenderLayerScrollData paramType;
|
typedef mozilla::layers::WebRenderLayerScrollData paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam);
|
static void Write(MessageWriter* aWriter, const paramType& aParam);
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult);
|
||||||
paramType* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::layers::WebRenderScrollData> {
|
struct ParamTraits<mozilla::layers::WebRenderScrollData> {
|
||||||
typedef mozilla::layers::WebRenderScrollData paramType;
|
typedef mozilla::layers::WebRenderScrollData paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam);
|
static void Write(MessageWriter* aWriter, const paramType& aParam);
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult);
|
||||||
paramType* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -385,14 +385,13 @@ namespace IPC {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::fontlist::Pointer> {
|
struct ParamTraits<mozilla::fontlist::Pointer> {
|
||||||
typedef mozilla::fontlist::Pointer paramType;
|
typedef mozilla::fontlist::Pointer paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
uint32_t v = aParam.mBlockAndOffset;
|
uint32_t v = aParam.mBlockAndOffset;
|
||||||
WriteParam(aMsg, v);
|
WriteParam(aWriter, v);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
uint32_t v;
|
uint32_t v;
|
||||||
if (ReadParam(aMsg, aIter, &v)) {
|
if (ReadParam(aReader, &v)) {
|
||||||
aResult->mBlockAndOffset.store(v);
|
aResult->mBlockAndOffset.store(v);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -341,26 +341,24 @@ namespace IPC {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<gfxSparseBitSet> {
|
struct ParamTraits<gfxSparseBitSet> {
|
||||||
typedef gfxSparseBitSet paramType;
|
typedef gfxSparseBitSet paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mBlockIndex);
|
WriteParam(aWriter, aParam.mBlockIndex);
|
||||||
WriteParam(aMsg, aParam.mBlocks);
|
WriteParam(aWriter, aParam.mBlocks);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mBlockIndex) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mBlockIndex) &&
|
ReadParam(aReader, &aResult->mBlocks);
|
||||||
ReadParam(aMsg, aIter, &aResult->mBlocks);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<gfxSparseBitSet::Block> {
|
struct ParamTraits<gfxSparseBitSet::Block> {
|
||||||
typedef gfxSparseBitSet::Block paramType;
|
typedef gfxSparseBitSet::Block paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aMsg->WriteBytes(&aParam, sizeof(aParam));
|
aWriter->WriteBytes(&aParam, sizeof(aParam));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return aReader->ReadBytesInto(aResult, sizeof(*aResult));
|
||||||
return aMsg->ReadBytesInto(aIter, aResult, sizeof(*aResult));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -41,21 +41,20 @@ template <>
|
|||||||
struct ParamTraits<mozilla::gfx::VRSubmitFrameResultInfo> {
|
struct ParamTraits<mozilla::gfx::VRSubmitFrameResultInfo> {
|
||||||
typedef mozilla::gfx::VRSubmitFrameResultInfo paramType;
|
typedef mozilla::gfx::VRSubmitFrameResultInfo paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mBase64Image);
|
WriteParam(aWriter, aParam.mBase64Image);
|
||||||
WriteParam(aMsg, aParam.mFormat);
|
WriteParam(aWriter, aParam.mFormat);
|
||||||
WriteParam(aMsg, aParam.mWidth);
|
WriteParam(aWriter, aParam.mWidth);
|
||||||
WriteParam(aMsg, aParam.mHeight);
|
WriteParam(aWriter, aParam.mHeight);
|
||||||
WriteParam(aMsg, aParam.mFrameNum);
|
WriteParam(aWriter, aParam.mFrameNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->mBase64Image)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->mBase64Image)) ||
|
!ReadParam(aReader, &(aResult->mFormat)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mFormat)) ||
|
!ReadParam(aReader, &(aResult->mWidth)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mWidth)) ||
|
!ReadParam(aReader, &(aResult->mHeight)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mHeight)) ||
|
!ReadParam(aReader, &(aResult->mFrameNum))) {
|
||||||
!ReadParam(aMsg, aIter, &(aResult->mFrameNum))) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,14 +276,13 @@ template <class P>
|
|||||||
struct ParamTraits;
|
struct ParamTraits;
|
||||||
|
|
||||||
template <typename P>
|
template <typename P>
|
||||||
static inline void WriteParam(Message* m, P&& p) {
|
static inline void WriteParam(MessageWriter* writer, P&& p) {
|
||||||
ParamTraits<std::decay_t<P>>::Write(m, std::forward<P>(p));
|
ParamTraits<std::decay_t<P>>::Write(writer, std::forward<P>(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P>
|
template <typename P>
|
||||||
static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m,
|
static inline bool WARN_UNUSED_RESULT ReadParam(MessageReader* reader, P* p) {
|
||||||
PickleIterator* iter, P* p) {
|
return ParamTraits<P>::Read(reader, p);
|
||||||
return ParamTraits<P>::Read(m, iter, p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P>
|
template <typename P>
|
||||||
@ -299,9 +298,11 @@ struct ParamTraitsFundamental {};
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<bool> {
|
struct ParamTraitsFundamental<bool> {
|
||||||
typedef bool param_type;
|
typedef bool param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteBool(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteBool(p);
|
||||||
return m->ReadBool(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadBool(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(p ? L"true" : L"false");
|
l->append(p ? L"true" : L"false");
|
||||||
@ -311,9 +312,11 @@ struct ParamTraitsFundamental<bool> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<int> {
|
struct ParamTraitsFundamental<int> {
|
||||||
typedef int param_type;
|
typedef int param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteInt(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteInt(p);
|
||||||
return m->ReadInt(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadInt(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%d", p));
|
l->append(StringPrintf(L"%d", p));
|
||||||
@ -323,9 +326,11 @@ struct ParamTraitsFundamental<int> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<long> {
|
struct ParamTraitsFundamental<long> {
|
||||||
typedef long param_type;
|
typedef long param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteLong(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteLong(p);
|
||||||
return m->ReadLong(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadLong(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%l", p));
|
l->append(StringPrintf(L"%l", p));
|
||||||
@ -335,9 +340,11 @@ struct ParamTraitsFundamental<long> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<unsigned long> {
|
struct ParamTraitsFundamental<unsigned long> {
|
||||||
typedef unsigned long param_type;
|
typedef unsigned long param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteULong(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteULong(p);
|
||||||
return m->ReadULong(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadULong(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%ul", p));
|
l->append(StringPrintf(L"%ul", p));
|
||||||
@ -347,11 +354,11 @@ struct ParamTraitsFundamental<unsigned long> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<long long> {
|
struct ParamTraitsFundamental<long long> {
|
||||||
typedef long long param_type;
|
typedef long long param_type;
|
||||||
static void Write(Message* m, const param_type& p) {
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
m->WriteBytes(&p, sizeof(param_type));
|
writer->WriteBytes(&p, sizeof(param_type));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
return m->ReadBytesInto(iter, r, sizeof(*r));
|
return reader->ReadBytesInto(r, sizeof(*r));
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%ll", p));
|
l->append(StringPrintf(L"%ll", p));
|
||||||
@ -361,11 +368,11 @@ struct ParamTraitsFundamental<long long> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<unsigned long long> {
|
struct ParamTraitsFundamental<unsigned long long> {
|
||||||
typedef unsigned long long param_type;
|
typedef unsigned long long param_type;
|
||||||
static void Write(Message* m, const param_type& p) {
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
m->WriteBytes(&p, sizeof(param_type));
|
writer->WriteBytes(&p, sizeof(param_type));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
return m->ReadBytesInto(iter, r, sizeof(*r));
|
return reader->ReadBytesInto(r, sizeof(*r));
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%ull", p));
|
l->append(StringPrintf(L"%ull", p));
|
||||||
@ -375,9 +382,11 @@ struct ParamTraitsFundamental<unsigned long long> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFundamental<double> {
|
struct ParamTraitsFundamental<double> {
|
||||||
typedef double param_type;
|
typedef double param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteDouble(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteDouble(p);
|
||||||
return m->ReadDouble(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadDouble(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"e", p));
|
l->append(StringPrintf(L"e", p));
|
||||||
@ -392,9 +401,11 @@ struct ParamTraitsFixed : ParamTraitsFundamental<P> {};
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFixed<int16_t> {
|
struct ParamTraitsFixed<int16_t> {
|
||||||
typedef int16_t param_type;
|
typedef int16_t param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteInt16(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteInt16(p);
|
||||||
return m->ReadInt16(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadInt16(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%hd", p));
|
l->append(StringPrintf(L"%hd", p));
|
||||||
@ -404,9 +415,11 @@ struct ParamTraitsFixed<int16_t> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFixed<uint16_t> {
|
struct ParamTraitsFixed<uint16_t> {
|
||||||
typedef uint16_t param_type;
|
typedef uint16_t param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteUInt16(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteUInt16(p);
|
||||||
return m->ReadUInt16(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadUInt16(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%hu", p));
|
l->append(StringPrintf(L"%hu", p));
|
||||||
@ -416,9 +429,11 @@ struct ParamTraitsFixed<uint16_t> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFixed<uint32_t> {
|
struct ParamTraitsFixed<uint32_t> {
|
||||||
typedef uint32_t param_type;
|
typedef uint32_t param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteUInt32(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteUInt32(p);
|
||||||
return m->ReadUInt32(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadUInt32(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%u", p));
|
l->append(StringPrintf(L"%u", p));
|
||||||
@ -428,9 +443,11 @@ struct ParamTraitsFixed<uint32_t> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFixed<int64_t> {
|
struct ParamTraitsFixed<int64_t> {
|
||||||
typedef int64_t param_type;
|
typedef int64_t param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteInt64(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteInt64(p);
|
||||||
return m->ReadInt64(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadInt64(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%" PRId64L, p));
|
l->append(StringPrintf(L"%" PRId64L, p));
|
||||||
@ -440,11 +457,11 @@ struct ParamTraitsFixed<int64_t> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsFixed<uint64_t> {
|
struct ParamTraitsFixed<uint64_t> {
|
||||||
typedef uint64_t param_type;
|
typedef uint64_t param_type;
|
||||||
static void Write(Message* m, const param_type& p) {
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
m->WriteInt64(static_cast<int64_t>(p));
|
writer->WriteInt64(static_cast<int64_t>(p));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
return m->ReadInt64(iter, reinterpret_cast<int64_t*>(r));
|
return reader->ReadInt64(reinterpret_cast<int64_t*>(r));
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%" PRIu64L, p));
|
l->append(StringPrintf(L"%" PRIu64L, p));
|
||||||
@ -459,9 +476,11 @@ struct ParamTraitsStd : ParamTraitsFixed<P> {};
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsStd<std::string> {
|
struct ParamTraitsStd<std::string> {
|
||||||
typedef std::string param_type;
|
typedef std::string param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteString(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteString(p);
|
||||||
return m->ReadString(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadString(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(UTF8ToWide(p));
|
l->append(UTF8ToWide(p));
|
||||||
@ -471,9 +490,11 @@ struct ParamTraitsStd<std::string> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsStd<std::wstring> {
|
struct ParamTraitsStd<std::wstring> {
|
||||||
typedef std::wstring param_type;
|
typedef std::wstring param_type;
|
||||||
static void Write(Message* m, const param_type& p) { m->WriteWString(p); }
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
writer->WriteWString(p);
|
||||||
return m->ReadWString(iter, r);
|
}
|
||||||
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
|
return reader->ReadWString(r);
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) { l->append(p); }
|
static void Log(const param_type& p, std::wstring* l) { l->append(p); }
|
||||||
};
|
};
|
||||||
@ -481,22 +502,22 @@ struct ParamTraitsStd<std::wstring> {
|
|||||||
template <class K, class V>
|
template <class K, class V>
|
||||||
struct ParamTraitsStd<std::map<K, V>> {
|
struct ParamTraitsStd<std::map<K, V>> {
|
||||||
typedef std::map<K, V> param_type;
|
typedef std::map<K, V> param_type;
|
||||||
static void Write(Message* m, const param_type& p) {
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
WriteParam(m, static_cast<int>(p.size()));
|
WriteParam(writer, static_cast<int>(p.size()));
|
||||||
typename param_type::const_iterator iter;
|
typename param_type::const_iterator iter;
|
||||||
for (iter = p.begin(); iter != p.end(); ++iter) {
|
for (iter = p.begin(); iter != p.end(); ++iter) {
|
||||||
WriteParam(m, iter->first);
|
WriteParam(writer, iter->first);
|
||||||
WriteParam(m, iter->second);
|
WriteParam(writer, iter->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
int size;
|
int size;
|
||||||
if (!ReadParam(m, iter, &size) || size < 0) return false;
|
if (!ReadParam(reader, &size) || size < 0) return false;
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
K k;
|
K k;
|
||||||
if (!ReadParam(m, iter, &k)) return false;
|
if (!ReadParam(reader, &k)) return false;
|
||||||
V& value = (*r)[k];
|
V& value = (*r)[k];
|
||||||
if (!ReadParam(m, iter, &value)) return false;
|
if (!ReadParam(reader, &value)) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -515,11 +536,11 @@ template <>
|
|||||||
struct ParamTraitsWindows<HANDLE> {
|
struct ParamTraitsWindows<HANDLE> {
|
||||||
static_assert(sizeof(HANDLE) == sizeof(intptr_t), "Wrong size for HANDLE?");
|
static_assert(sizeof(HANDLE) == sizeof(intptr_t), "Wrong size for HANDLE?");
|
||||||
|
|
||||||
static void Write(Message* m, HANDLE p) {
|
static void Write(MessageWriter* writer, HANDLE p) {
|
||||||
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
|
writer->WriteIntPtr(reinterpret_cast<intptr_t>(p));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, HANDLE* r) {
|
static bool Read(MessageReader* reader, HANDLE* r) {
|
||||||
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
|
return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r));
|
||||||
}
|
}
|
||||||
static void Log(const HANDLE& p, std::wstring* l) {
|
static void Log(const HANDLE& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"0x%X", p));
|
l->append(StringPrintf(L"0x%X", p));
|
||||||
@ -530,11 +551,11 @@ template <>
|
|||||||
struct ParamTraitsWindows<HWND> {
|
struct ParamTraitsWindows<HWND> {
|
||||||
static_assert(sizeof(HWND) == sizeof(intptr_t), "Wrong size for HWND?");
|
static_assert(sizeof(HWND) == sizeof(intptr_t), "Wrong size for HWND?");
|
||||||
|
|
||||||
static void Write(Message* m, HWND p) {
|
static void Write(MessageWriter* writer, HWND p) {
|
||||||
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
|
writer->WriteIntPtr(reinterpret_cast<intptr_t>(p));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, HWND* r) {
|
static bool Read(MessageReader* reader, HWND* r) {
|
||||||
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
|
return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r));
|
||||||
}
|
}
|
||||||
static void Log(const HWND& p, std::wstring* l) {
|
static void Log(const HWND& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"0x%X", p));
|
l->append(StringPrintf(L"0x%X", p));
|
||||||
@ -560,18 +581,18 @@ struct ParamTraitsIPC : ParamTraitsWindows<P> {};
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsIPC<mozilla::UniqueFileHandle> {
|
struct ParamTraitsIPC<mozilla::UniqueFileHandle> {
|
||||||
typedef mozilla::UniqueFileHandle param_type;
|
typedef mozilla::UniqueFileHandle param_type;
|
||||||
static void Write(Message* m, param_type&& p) {
|
static void Write(MessageWriter* writer, param_type&& p) {
|
||||||
const bool valid = p != nullptr;
|
const bool valid = p != nullptr;
|
||||||
WriteParam(m, valid);
|
WriteParam(writer, valid);
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (!m->WriteFileHandle(std::move(p))) {
|
if (!writer->WriteFileHandle(std::move(p))) {
|
||||||
NOTREACHED() << "Too many file handles for one message!";
|
NOTREACHED() << "Too many file handles for one message!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
bool valid;
|
bool valid;
|
||||||
if (!ReadParam(m, iter, &valid)) {
|
if (!ReadParam(reader, &valid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +601,7 @@ struct ParamTraitsIPC<mozilla::UniqueFileHandle> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m->ConsumeFileHandle(iter, r);
|
return reader->ConsumeFileHandle(r);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -598,18 +619,18 @@ struct ParamTraitsIPC<mozilla::UniqueFileHandle> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsIPC<mozilla::UniqueMachSendRight> {
|
struct ParamTraitsIPC<mozilla::UniqueMachSendRight> {
|
||||||
typedef mozilla::UniqueMachSendRight param_type;
|
typedef mozilla::UniqueMachSendRight param_type;
|
||||||
static void Write(Message* m, param_type&& p) {
|
static void Write(MessageWriter* writer, param_type&& p) {
|
||||||
const bool valid = p != nullptr;
|
const bool valid = p != nullptr;
|
||||||
WriteParam(m, valid);
|
WriteParam(writer, valid);
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (!m->WriteMachSendRight(std::move(p))) {
|
if (!writer->WriteMachSendRight(std::move(p))) {
|
||||||
NOTREACHED() << "Too many mach send rights for one message!";
|
NOTREACHED() << "Too many mach send rights for one message!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
bool valid;
|
bool valid;
|
||||||
if (!ReadParam(m, iter, &valid)) {
|
if (!ReadParam(reader, &valid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -618,7 +639,7 @@ struct ParamTraitsIPC<mozilla::UniqueMachSendRight> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m->ConsumeMachSendRight(iter, r);
|
return reader->ConsumeMachSendRight(r);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@ -631,11 +652,11 @@ struct ParamTraitsMozilla : ParamTraitsIPC<P> {};
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraitsMozilla<nsresult> {
|
struct ParamTraitsMozilla<nsresult> {
|
||||||
typedef nsresult param_type;
|
typedef nsresult param_type;
|
||||||
static void Write(Message* m, const param_type& p) {
|
static void Write(MessageWriter* writer, const param_type& p) {
|
||||||
m->WriteUInt32(static_cast<uint32_t>(p));
|
writer->WriteUInt32(static_cast<uint32_t>(p));
|
||||||
}
|
}
|
||||||
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
|
static bool Read(MessageReader* reader, param_type* r) {
|
||||||
return m->ReadUInt32(iter, reinterpret_cast<uint32_t*>(r));
|
return reader->ReadUInt32(reinterpret_cast<uint32_t*>(r));
|
||||||
}
|
}
|
||||||
static void Log(const param_type& p, std::wstring* l) {
|
static void Log(const param_type& p, std::wstring* l) {
|
||||||
l->append(StringPrintf(L"%u", static_cast<uint32_t>(p)));
|
l->append(StringPrintf(L"%u", static_cast<uint32_t>(p)));
|
||||||
@ -646,24 +667,24 @@ struct ParamTraitsMozilla<nsresult> {
|
|||||||
// nsCOMPtr<T> for more details.
|
// nsCOMPtr<T> for more details.
|
||||||
template <class T>
|
template <class T>
|
||||||
struct ParamTraitsMozilla<RefPtr<T>> {
|
struct ParamTraitsMozilla<RefPtr<T>> {
|
||||||
static void Write(Message* m, const RefPtr<T>& p) {
|
static void Write(MessageWriter* writer, const RefPtr<T>& p) {
|
||||||
ParamTraits<T*>::Write(m, p.get());
|
ParamTraits<T*>::Write(writer, p.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* m, PickleIterator* iter, RefPtr<T>* r) {
|
static bool Read(MessageReader* reader, RefPtr<T>* r) {
|
||||||
return ParamTraits<T*>::Read(m, iter, r);
|
return ParamTraits<T*>::Read(reader, r);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct ParamTraitsMozilla<nsCOMPtr<T>> {
|
struct ParamTraitsMozilla<nsCOMPtr<T>> {
|
||||||
static void Write(Message* m, const nsCOMPtr<T>& p) {
|
static void Write(MessageWriter* writer, const nsCOMPtr<T>& p) {
|
||||||
ParamTraits<T*>::Write(m, p.get());
|
ParamTraits<T*>::Write(writer, p.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* m, PickleIterator* iter, nsCOMPtr<T>* r) {
|
static bool Read(MessageReader* reader, nsCOMPtr<T>* r) {
|
||||||
RefPtr<T> refptr;
|
RefPtr<T> refptr;
|
||||||
if (!ParamTraits<T*>::Read(m, iter, &refptr)) {
|
if (!ParamTraits<T*>::Read(reader, &refptr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*r = std::move(refptr);
|
*r = std::move(refptr);
|
||||||
|
@ -32,27 +32,23 @@ mozilla::Logger& operator<<(mozilla::Logger& log, const Name& name) {
|
|||||||
} // namespace mojo
|
} // namespace mojo
|
||||||
|
|
||||||
void IPC::ParamTraits<mojo::core::ports::PortName>::Write(
|
void IPC::ParamTraits<mojo::core::ports::PortName>::Write(
|
||||||
Message* aMsg, const paramType& aParam) {
|
MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.v1);
|
WriteParam(aWriter, aParam.v1);
|
||||||
WriteParam(aMsg, aParam.v2);
|
WriteParam(aWriter, aParam.v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPC::ParamTraits<mojo::core::ports::PortName>::Read(const Message* aMsg,
|
bool IPC::ParamTraits<mojo::core::ports::PortName>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
paramType* aResult) {
|
paramType* aResult) {
|
||||||
return ReadParam(aMsg, aIter, &aResult->v1) &&
|
return ReadParam(aReader, &aResult->v1) && ReadParam(aReader, &aResult->v2);
|
||||||
ReadParam(aMsg, aIter, &aResult->v2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPC::ParamTraits<mojo::core::ports::NodeName>::Write(
|
void IPC::ParamTraits<mojo::core::ports::NodeName>::Write(
|
||||||
Message* aMsg, const paramType& aParam) {
|
MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.v1);
|
WriteParam(aWriter, aParam.v1);
|
||||||
WriteParam(aMsg, aParam.v2);
|
WriteParam(aWriter, aParam.v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPC::ParamTraits<mojo::core::ports::NodeName>::Read(const Message* aMsg,
|
bool IPC::ParamTraits<mojo::core::ports::NodeName>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
paramType* aResult) {
|
paramType* aResult) {
|
||||||
return ReadParam(aMsg, aIter, &aResult->v1) &&
|
return ReadParam(aReader, &aResult->v1) && ReadParam(aReader, &aResult->v2);
|
||||||
ReadParam(aMsg, aIter, &aResult->v2);
|
|
||||||
}
|
}
|
||||||
|
@ -106,17 +106,15 @@ class MessageWriter;
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mojo::core::ports::PortName> {
|
struct ParamTraits<mojo::core::ports::PortName> {
|
||||||
using paramType = mojo::core::ports::PortName;
|
using paramType = mojo::core::ports::PortName;
|
||||||
static void Write(Message* aMsg, const paramType& aParam);
|
static void Write(MessageWriter* aWriter, const paramType& aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult);
|
||||||
paramType* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mojo::core::ports::NodeName> {
|
struct ParamTraits<mojo::core::ports::NodeName> {
|
||||||
using paramType = mojo::core::ports::NodeName;
|
using paramType = mojo::core::ports::NodeName;
|
||||||
static void Write(Message* aMsg, const paramType& aParam);
|
static void Write(MessageWriter* aWriter, const paramType& aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult);
|
||||||
paramType* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -26,17 +26,15 @@ template <class ParamType>
|
|||||||
struct OriginAttributesParamTraits {
|
struct OriginAttributesParamTraits {
|
||||||
typedef ParamType paramType;
|
typedef ParamType paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
nsAutoCString suffix;
|
nsAutoCString suffix;
|
||||||
aParam.CreateSuffix(suffix);
|
aParam.CreateSuffix(suffix);
|
||||||
WriteParam(aMsg, suffix);
|
WriteParam(aWriter, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsAutoCString suffix;
|
nsAutoCString suffix;
|
||||||
return ReadParam(aMsg, aIter, &suffix) &&
|
return ReadParam(aReader, &suffix) && aResult->PopulateFromSuffix(suffix);
|
||||||
aResult->PopulateFromSuffix(suffix);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -24,34 +24,33 @@ struct ParamTraits<mozilla::ipc::ByteBuf> {
|
|||||||
|
|
||||||
// this is where we transfer the memory from the ByteBuf to IPDL, avoiding a
|
// this is where we transfer the memory from the ByteBuf to IPDL, avoiding a
|
||||||
// copy
|
// copy
|
||||||
static void Write(Message* aMsg, paramType&& aParam) {
|
static void Write(MessageWriter* aWriter, paramType&& aParam) {
|
||||||
// We need to send the length as a 32-bit value, not a size_t, because on
|
// We need to send the length as a 32-bit value, not a size_t, because on
|
||||||
// ARM64 Windows we end up with a 32-bit GMP process sending a ByteBuf to
|
// ARM64 Windows we end up with a 32-bit GMP process sending a ByteBuf to
|
||||||
// a 64-bit parent process. WriteBytesZeroCopy takes a uint32_t as an
|
// a 64-bit parent process. WriteBytesZeroCopy takes a uint32_t as an
|
||||||
// argument, so it would end up getting truncated anyways. See bug 1757534.
|
// argument, so it would end up getting truncated anyways. See bug 1757534.
|
||||||
mozilla::CheckedInt<uint32_t> length = aParam.mLen;
|
mozilla::CheckedInt<uint32_t> length = aParam.mLen;
|
||||||
MOZ_RELEASE_ASSERT(length.isValid());
|
MOZ_RELEASE_ASSERT(length.isValid());
|
||||||
WriteParam(aMsg, length.value());
|
WriteParam(aWriter, length.value());
|
||||||
// hand over ownership of the buffer to the Message
|
// hand over ownership of the buffer to the Message
|
||||||
aMsg->WriteBytesZeroCopy(aParam.mData, length.value(), aParam.mCapacity);
|
aWriter->WriteBytesZeroCopy(aParam.mData, length.value(), aParam.mCapacity);
|
||||||
aParam.mData = nullptr;
|
aParam.mData = nullptr;
|
||||||
aParam.mCapacity = 0;
|
aParam.mCapacity = 0;
|
||||||
aParam.mLen = 0;
|
aParam.mLen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
// We make a copy from the BufferList so that we get a contigous result.
|
// We make a copy from the BufferList so that we get a contigous result.
|
||||||
// For users the can handle a non-contiguous result using ExtractBuffers
|
// For users the can handle a non-contiguous result using ExtractBuffers
|
||||||
// is an option, alternatively if the users don't need to take ownership of
|
// is an option, alternatively if the users don't need to take ownership of
|
||||||
// the data they can use the removed FlattenBytes (bug 1297981)
|
// the data they can use the removed FlattenBytes (bug 1297981)
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) return false;
|
if (!ReadParam(aReader, &length)) return false;
|
||||||
if (!aResult->Allocate(length)) {
|
if (!aResult->Allocate(length)) {
|
||||||
mozalloc_handle_oom(length);
|
mozalloc_handle_oom(length);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return aMsg->ReadBytesInto(aIter, aResult->mData, length);
|
return aReader->ReadBytesInto(aResult->mData, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
|
@ -413,12 +413,12 @@ nsCString DataPipeBase::Describe(DataPipeAutoLock& aLock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void DataPipeWrite(IPC::Message* aMsg, T* aParam) {
|
void DataPipeWrite(IPC::MessageWriter* aWriter, T* aParam) {
|
||||||
DataPipeAutoLock lock(*aParam->mMutex);
|
DataPipeAutoLock lock(*aParam->mMutex);
|
||||||
MOZ_LOG(gDataPipeLog, LogLevel::Debug,
|
MOZ_LOG(gDataPipeLog, LogLevel::Debug,
|
||||||
("IPC Write: %s", aParam->Describe(lock).get()));
|
("IPC Write: %s", aParam->Describe(lock).get()));
|
||||||
|
|
||||||
WriteParam(aMsg, aParam->mStatus);
|
WriteParam(aWriter, aParam->mStatus);
|
||||||
if (NS_FAILED(aParam->mStatus)) {
|
if (NS_FAILED(aParam->mStatus)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -427,12 +427,12 @@ void DataPipeWrite(IPC::Message* aMsg, T* aParam) {
|
|||||||
"cannot transfer while processing a segment");
|
"cannot transfer while processing a segment");
|
||||||
|
|
||||||
// Serialize relevant parameters to our peer.
|
// Serialize relevant parameters to our peer.
|
||||||
WriteParam(aMsg, std::move(aParam->mLink->mPort));
|
WriteParam(aWriter, std::move(aParam->mLink->mPort));
|
||||||
MOZ_ALWAYS_TRUE(aParam->mLink->mShmem->WriteHandle(aMsg));
|
MOZ_ALWAYS_TRUE(aParam->mLink->mShmem->WriteHandle(aWriter));
|
||||||
WriteParam(aMsg, aParam->mLink->mCapacity);
|
WriteParam(aWriter, aParam->mLink->mCapacity);
|
||||||
WriteParam(aMsg, aParam->mLink->mPeerStatus);
|
WriteParam(aWriter, aParam->mLink->mPeerStatus);
|
||||||
WriteParam(aMsg, aParam->mLink->mOffset);
|
WriteParam(aWriter, aParam->mLink->mOffset);
|
||||||
WriteParam(aMsg, aParam->mLink->mAvailable);
|
WriteParam(aWriter, aParam->mLink->mAvailable);
|
||||||
|
|
||||||
// Mark our peer as closed so we don't try to send to it when closing.
|
// Mark our peer as closed so we don't try to send to it when closing.
|
||||||
aParam->mLink->mPeerStatus = NS_ERROR_NOT_INITIALIZED;
|
aParam->mLink->mPeerStatus = NS_ERROR_NOT_INITIALIZED;
|
||||||
@ -440,10 +440,9 @@ void DataPipeWrite(IPC::Message* aMsg, T* aParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool DataPipeRead(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool DataPipeRead(IPC::MessageReader* aReader, RefPtr<T>* aResult) {
|
||||||
RefPtr<T>* aResult) {
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
if (!ReadParam(aMsg, aIter, &rv)) {
|
if (!ReadParam(aReader, &rv)) {
|
||||||
NS_WARNING("failed to read status!");
|
NS_WARNING("failed to read status!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -460,10 +459,9 @@ bool DataPipeRead(const IPC::Message* aMsg, PickleIterator* aIter,
|
|||||||
nsresult peerStatus = NS_OK;
|
nsresult peerStatus = NS_OK;
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
uint32_t available = 0;
|
uint32_t available = 0;
|
||||||
if (!ReadParam(aMsg, aIter, &port) || !shmem->ReadHandle(aMsg, aIter) ||
|
if (!ReadParam(aReader, &port) || !shmem->ReadHandle(aReader) ||
|
||||||
!ReadParam(aMsg, aIter, &capacity) ||
|
!ReadParam(aReader, &capacity) || !ReadParam(aReader, &peerStatus) ||
|
||||||
!ReadParam(aMsg, aIter, &peerStatus) ||
|
!ReadParam(aReader, &offset) || !ReadParam(aReader, &available)) {
|
||||||
!ReadParam(aMsg, aIter, &offset) || !ReadParam(aMsg, aIter, &available)) {
|
|
||||||
NS_WARNING("failed to read fields!");
|
NS_WARNING("failed to read fields!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -685,23 +683,21 @@ nsresult NewDataPipe(uint32_t aCapacity, DataPipeSender** aSender,
|
|||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
void IPC::ParamTraits<mozilla::ipc::DataPipeSender*>::Write(
|
void IPC::ParamTraits<mozilla::ipc::DataPipeSender*>::Write(
|
||||||
Message* aMsg, mozilla::ipc::DataPipeSender* aParam) {
|
MessageWriter* aWriter, mozilla::ipc::DataPipeSender* aParam) {
|
||||||
mozilla::ipc::data_pipe_detail::DataPipeWrite(aMsg, aParam);
|
mozilla::ipc::data_pipe_detail::DataPipeWrite(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPC::ParamTraits<mozilla::ipc::DataPipeSender*>::Read(
|
bool IPC::ParamTraits<mozilla::ipc::DataPipeSender*>::Read(
|
||||||
const Message* aMsg, PickleIterator* aIter,
|
MessageReader* aReader, RefPtr<mozilla::ipc::DataPipeSender>* aResult) {
|
||||||
RefPtr<mozilla::ipc::DataPipeSender>* aResult) {
|
return mozilla::ipc::data_pipe_detail::DataPipeRead(aReader, aResult);
|
||||||
return mozilla::ipc::data_pipe_detail::DataPipeRead(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPC::ParamTraits<mozilla::ipc::DataPipeReceiver*>::Write(
|
void IPC::ParamTraits<mozilla::ipc::DataPipeReceiver*>::Write(
|
||||||
Message* aMsg, mozilla::ipc::DataPipeReceiver* aParam) {
|
MessageWriter* aWriter, mozilla::ipc::DataPipeReceiver* aParam) {
|
||||||
mozilla::ipc::data_pipe_detail::DataPipeWrite(aMsg, aParam);
|
mozilla::ipc::data_pipe_detail::DataPipeWrite(aWriter, aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPC::ParamTraits<mozilla::ipc::DataPipeReceiver*>::Read(
|
bool IPC::ParamTraits<mozilla::ipc::DataPipeReceiver*>::Read(
|
||||||
const Message* aMsg, PickleIterator* aIter,
|
MessageReader* aReader, RefPtr<mozilla::ipc::DataPipeReceiver>* aResult) {
|
||||||
RefPtr<mozilla::ipc::DataPipeReceiver>* aResult) {
|
return mozilla::ipc::data_pipe_detail::DataPipeRead(aReader, aResult);
|
||||||
return mozilla::ipc::data_pipe_detail::DataPipeRead(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
|
@ -59,11 +59,10 @@ class DataPipeBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void DataPipeWrite(IPC::Message* aMsg, T* aParam);
|
void DataPipeWrite(IPC::MessageWriter* aWriter, T* aParam);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool DataPipeRead(const IPC::Message* aMsg, PickleIterator* aIter,
|
bool DataPipeRead(IPC::MessageReader* aReader, RefPtr<T>* aResult);
|
||||||
RefPtr<T>* aResult);
|
|
||||||
|
|
||||||
} // namespace data_pipe_detail
|
} // namespace data_pipe_detail
|
||||||
|
|
||||||
@ -89,10 +88,9 @@ class DataPipeSender final : public nsIAsyncOutputStream,
|
|||||||
private:
|
private:
|
||||||
friend nsresult NewDataPipe(uint32_t, DataPipeSender**, DataPipeReceiver**);
|
friend nsresult NewDataPipe(uint32_t, DataPipeSender**, DataPipeReceiver**);
|
||||||
friend void data_pipe_detail::DataPipeWrite<DataPipeSender>(
|
friend void data_pipe_detail::DataPipeWrite<DataPipeSender>(
|
||||||
IPC::Message* aMsg, DataPipeSender* aParam);
|
IPC::MessageWriter* aWriter, DataPipeSender* aParam);
|
||||||
friend bool data_pipe_detail::DataPipeRead<DataPipeSender>(
|
friend bool data_pipe_detail::DataPipeRead<DataPipeSender>(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter,
|
IPC::MessageReader* aReader, RefPtr<DataPipeSender>* aResult);
|
||||||
RefPtr<DataPipeSender>* aResult);
|
|
||||||
|
|
||||||
explicit DataPipeSender(nsresult aError)
|
explicit DataPipeSender(nsresult aError)
|
||||||
: data_pipe_detail::DataPipeBase(/* aReceiverSide */ false, aError) {}
|
: data_pipe_detail::DataPipeBase(/* aReceiverSide */ false, aError) {}
|
||||||
@ -128,10 +126,9 @@ class DataPipeReceiver final : public nsIAsyncInputStream,
|
|||||||
private:
|
private:
|
||||||
friend nsresult NewDataPipe(uint32_t, DataPipeSender**, DataPipeReceiver**);
|
friend nsresult NewDataPipe(uint32_t, DataPipeSender**, DataPipeReceiver**);
|
||||||
friend void data_pipe_detail::DataPipeWrite<DataPipeReceiver>(
|
friend void data_pipe_detail::DataPipeWrite<DataPipeReceiver>(
|
||||||
IPC::Message* aMsg, DataPipeReceiver* aParam);
|
IPC::MessageWriter* aWriter, DataPipeReceiver* aParam);
|
||||||
friend bool data_pipe_detail::DataPipeRead<DataPipeReceiver>(
|
friend bool data_pipe_detail::DataPipeRead<DataPipeReceiver>(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter,
|
IPC::MessageReader* aReader, RefPtr<DataPipeReceiver>* aResult);
|
||||||
RefPtr<DataPipeReceiver>* aResult);
|
|
||||||
|
|
||||||
explicit DataPipeReceiver(nsresult aError)
|
explicit DataPipeReceiver(nsresult aError)
|
||||||
: data_pipe_detail::DataPipeBase(/* aReceiverSide */ true, aError) {}
|
: data_pipe_detail::DataPipeBase(/* aReceiverSide */ true, aError) {}
|
||||||
@ -164,15 +161,17 @@ namespace IPC {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::ipc::DataPipeSender*> {
|
struct ParamTraits<mozilla::ipc::DataPipeSender*> {
|
||||||
static void Write(Message* aMsg, mozilla::ipc::DataPipeSender* aParam);
|
static void Write(MessageWriter* aWriter,
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
mozilla::ipc::DataPipeSender* aParam);
|
||||||
|
static bool Read(MessageReader* aReader,
|
||||||
RefPtr<mozilla::ipc::DataPipeSender>* aResult);
|
RefPtr<mozilla::ipc::DataPipeSender>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::ipc::DataPipeReceiver*> {
|
struct ParamTraits<mozilla::ipc::DataPipeReceiver*> {
|
||||||
static void Write(Message* aMsg, mozilla::ipc::DataPipeReceiver* aParam);
|
static void Write(MessageWriter* aWriter,
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
mozilla::ipc::DataPipeReceiver* aParam);
|
||||||
|
static bool Read(MessageReader* aReader,
|
||||||
RefPtr<mozilla::ipc::DataPipeReceiver>* aResult);
|
RefPtr<mozilla::ipc::DataPipeReceiver>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -96,11 +96,11 @@ bool UntypedManagedEndpoint::BindCommon(IProtocol* aActor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void IPDLParamTraits<UntypedManagedEndpoint>::Write(IPC::Message* aMsg,
|
void IPDLParamTraits<UntypedManagedEndpoint>::Write(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
paramType&& aParam) {
|
paramType&& aParam) {
|
||||||
bool isValid = aParam.mInner.isSome();
|
bool isValid = aParam.mInner.isSome();
|
||||||
WriteIPDLParam(aMsg, aActor, isValid);
|
WriteIPDLParam(aWriter, aActor, isValid);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -116,20 +116,19 @@ void IPDLParamTraits<UntypedManagedEndpoint>::Write(IPC::Message* aMsg,
|
|||||||
aActor->ToplevelProtocol(),
|
aActor->ToplevelProtocol(),
|
||||||
"Must be being sent over the same toplevel protocol");
|
"Must be being sent over the same toplevel protocol");
|
||||||
|
|
||||||
WriteIPDLParam(aMsg, aActor, inner.mId);
|
WriteIPDLParam(aWriter, aActor, inner.mId);
|
||||||
WriteIPDLParam(aMsg, aActor, inner.mType);
|
WriteIPDLParam(aWriter, aActor, inner.mType);
|
||||||
WriteIPDLParam(aMsg, aActor, inner.mManagerId);
|
WriteIPDLParam(aWriter, aActor, inner.mManagerId);
|
||||||
WriteIPDLParam(aMsg, aActor, inner.mManagerType);
|
WriteIPDLParam(aWriter, aActor, inner.mManagerType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
bool IPDLParamTraits<UntypedManagedEndpoint>::Read(const IPC::Message* aMsg,
|
bool IPDLParamTraits<UntypedManagedEndpoint>::Read(IPC::MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
paramType* aResult) {
|
paramType* aResult) {
|
||||||
*aResult = UntypedManagedEndpoint{};
|
*aResult = UntypedManagedEndpoint{};
|
||||||
bool isValid = false;
|
bool isValid = false;
|
||||||
if (!aActor || !ReadIPDLParam(aMsg, aIter, aActor, &isValid)) {
|
if (!aActor || !ReadIPDLParam(aReader, aActor, &isValid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
@ -139,10 +138,10 @@ bool IPDLParamTraits<UntypedManagedEndpoint>::Read(const IPC::Message* aMsg,
|
|||||||
aResult->mInner.emplace();
|
aResult->mInner.emplace();
|
||||||
auto& inner = *aResult->mInner;
|
auto& inner = *aResult->mInner;
|
||||||
inner.mToplevel = aActor->ToplevelProtocol()->GetWeakLifecycleProxy();
|
inner.mToplevel = aActor->ToplevelProtocol()->GetWeakLifecycleProxy();
|
||||||
return ReadIPDLParam(aMsg, aIter, aActor, &inner.mId) &&
|
return ReadIPDLParam(aReader, aActor, &inner.mId) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &inner.mType) &&
|
ReadIPDLParam(aReader, aActor, &inner.mType) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &inner.mManagerId) &&
|
ReadIPDLParam(aReader, aActor, &inner.mManagerId) &&
|
||||||
ReadIPDLParam(aMsg, aIter, aActor, &inner.mManagerType);
|
ReadIPDLParam(aReader, aActor, &inner.mManagerType);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mozilla::ipc
|
} // namespace mozilla::ipc
|
||||||
|
@ -53,19 +53,18 @@ struct EnumSerializer {
|
|||||||
typedef typename mozilla::UnsignedStdintTypeForSize<sizeof(paramType)>::Type
|
typedef typename mozilla::UnsignedStdintTypeForSize<sizeof(paramType)>::Type
|
||||||
uintParamType;
|
uintParamType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aValue) {
|
static void Write(MessageWriter* aWriter, const paramType& aValue) {
|
||||||
// XXX This assertion is somewhat meaningless at least for E that don't have
|
// XXX This assertion is somewhat meaningless at least for E that don't have
|
||||||
// a fixed underlying type: if aValue weren't a legal value, we would
|
// a fixed underlying type: if aValue weren't a legal value, we would
|
||||||
// already have UB where this function is called.
|
// already have UB where this function is called.
|
||||||
MOZ_RELEASE_ASSERT(EnumValidator::IsLegalValue(
|
MOZ_RELEASE_ASSERT(EnumValidator::IsLegalValue(
|
||||||
static_cast<std::underlying_type_t<paramType>>(aValue)));
|
static_cast<std::underlying_type_t<paramType>>(aValue)));
|
||||||
WriteParam(aMsg, uintParamType(aValue));
|
WriteParam(aWriter, uintParamType(aValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
uintParamType value;
|
uintParamType value;
|
||||||
if (!ReadParam(aMsg, aIter, &value)) {
|
if (!ReadParam(aReader, &value)) {
|
||||||
CrashReporter::AnnotateCrashReport(
|
CrashReporter::AnnotateCrashReport(
|
||||||
CrashReporter::Annotation::IPCReadErrorReason, "Bad iter"_ns);
|
CrashReporter::Annotation::IPCReadErrorReason, "Bad iter"_ns);
|
||||||
return false;
|
return false;
|
||||||
|
@ -92,18 +92,17 @@ FileDescriptor::UniquePlatformHandle FileDescriptor::Clone(
|
|||||||
return UniqueFileHandle();
|
return UniqueFileHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<FileDescriptor>::Write(IPC::Message* aMsg,
|
void IPDLParamTraits<FileDescriptor>::Write(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
const FileDescriptor& aParam) {
|
const FileDescriptor& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.ClonePlatformHandle());
|
WriteIPDLParam(aWriter, aActor, aParam.ClonePlatformHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<FileDescriptor>::Read(const IPC::Message* aMsg,
|
bool IPDLParamTraits<FileDescriptor>::Read(IPC::MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
FileDescriptor* aResult) {
|
FileDescriptor* aResult) {
|
||||||
UniqueFileHandle handle;
|
UniqueFileHandle handle;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &handle)) {
|
if (!ReadIPDLParam(aReader, aActor, &handle)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,13 +69,12 @@ struct PlainOldDataSerializer {
|
|||||||
|
|
||||||
typedef T paramType;
|
typedef T paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aMsg->WriteBytes(&aParam, sizeof(aParam));
|
aWriter->WriteBytes(&aParam, sizeof(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return aReader->ReadBytesInto(aResult, sizeof(paramType));
|
||||||
return aMsg->ReadBytesInto(aIter, aResult, sizeof(paramType));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -87,10 +86,9 @@ template <typename T>
|
|||||||
struct EmptyStructSerializer {
|
struct EmptyStructSerializer {
|
||||||
typedef T paramType;
|
typedef T paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {}
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
*aResult = {};
|
*aResult = {};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -100,13 +98,12 @@ template <>
|
|||||||
struct ParamTraits<int8_t> {
|
struct ParamTraits<int8_t> {
|
||||||
typedef int8_t paramType;
|
typedef int8_t paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aMsg->WriteBytes(&aParam, sizeof(aParam));
|
aWriter->WriteBytes(&aParam, sizeof(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return aReader->ReadBytesInto(aResult, sizeof(*aResult));
|
||||||
return aMsg->ReadBytesInto(aIter, aResult, sizeof(*aResult));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -119,13 +116,12 @@ template <>
|
|||||||
struct ParamTraits<uint8_t> {
|
struct ParamTraits<uint8_t> {
|
||||||
typedef uint8_t paramType;
|
typedef uint8_t paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aMsg->WriteBytes(&aParam, sizeof(aParam));
|
aWriter->WriteBytes(&aParam, sizeof(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return aReader->ReadBytesInto(aResult, sizeof(*aResult));
|
||||||
return aMsg->ReadBytesInto(aIter, aResult, sizeof(*aResult));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -138,11 +134,10 @@ struct ParamTraits<uint8_t> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<base::FileDescriptor> {
|
struct ParamTraits<base::FileDescriptor> {
|
||||||
typedef base::FileDescriptor paramType;
|
typedef base::FileDescriptor paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
MOZ_CRASH("FileDescriptor isn't meaningful on this platform");
|
MOZ_CRASH("FileDescriptor isn't meaningful on this platform");
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
MOZ_CRASH("FileDescriptor isn't meaningful on this platform");
|
MOZ_CRASH("FileDescriptor isn't meaningful on this platform");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -152,9 +147,8 @@ struct ParamTraits<base::FileDescriptor> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::void_t> {
|
struct ParamTraits<mozilla::void_t> {
|
||||||
typedef mozilla::void_t paramType;
|
typedef mozilla::void_t paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {}
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
*aResult = paramType();
|
*aResult = paramType();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -163,9 +157,8 @@ struct ParamTraits<mozilla::void_t> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::null_t> {
|
struct ParamTraits<mozilla::null_t> {
|
||||||
typedef mozilla::null_t paramType;
|
typedef mozilla::null_t paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {}
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
*aResult = paramType();
|
*aResult = paramType();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -178,11 +171,10 @@ struct BitfieldHelper {
|
|||||||
// We need this helper because we can't get the address of a bitfield to
|
// We need this helper because we can't get the address of a bitfield to
|
||||||
// pass directly to ReadParam. So instead we read it into a temporary bool
|
// pass directly to ReadParam. So instead we read it into a temporary bool
|
||||||
// and set the bitfield using a setter function
|
// and set the bitfield using a setter function
|
||||||
static bool ReadBoolForBitfield(const Message* aMsg, PickleIterator* aIter,
|
static bool ReadBoolForBitfield(MessageReader* aReader, ParamType* aResult,
|
||||||
ParamType* aResult,
|
|
||||||
void (ParamType::*aSetter)(bool)) {
|
void (ParamType::*aSetter)(bool)) {
|
||||||
bool value;
|
bool value;
|
||||||
if (ReadParam(aMsg, aIter, &value)) {
|
if (ReadParam(aReader, &value)) {
|
||||||
(aResult->*aSetter)(value);
|
(aResult->*aSetter)(value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -195,14 +187,13 @@ struct BitfieldHelper {
|
|||||||
// ReadParams(aMsg, aIter, aParam.foo, aParam.bar, aParam.baz)
|
// ReadParams(aMsg, aIter, aParam.foo, aParam.bar, aParam.baz)
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
static void WriteParams(Message* aMsg, const Ts&... aArgs) {
|
static void WriteParams(MessageWriter* aWriter, const Ts&... aArgs) {
|
||||||
(WriteParam(aMsg, aArgs), ...);
|
(WriteParam(aWriter, aArgs), ...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
static bool ReadParams(const Message* aMsg, PickleIterator* aIter,
|
static bool ReadParams(MessageReader* aReader, Ts&... aArgs) {
|
||||||
Ts&... aArgs) {
|
return (ReadParam(aReader, &aArgs) && ...);
|
||||||
return (ReadParam(aMsg, aIter, &aArgs) && ...);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Macros that allow syntax like:
|
// Macros that allow syntax like:
|
||||||
@ -215,15 +206,14 @@ static bool ReadParams(const Message* aMsg, PickleIterator* aIter,
|
|||||||
template <> \
|
template <> \
|
||||||
struct ParamTraits<Type> { \
|
struct ParamTraits<Type> { \
|
||||||
typedef Type paramType; \
|
typedef Type paramType; \
|
||||||
static void Write(Message* aMsg, const paramType& aParam) { \
|
static void Write(MessageWriter* aWriter, const paramType& aParam) { \
|
||||||
WriteParams(aMsg, MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), (), \
|
WriteParams(aWriter, MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), \
|
||||||
(__VA_ARGS__))); \
|
(), (__VA_ARGS__))); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter, \
|
static bool Read(MessageReader* aReader, paramType* aResult) { \
|
||||||
paramType* aResult) { \
|
|
||||||
paramType& aParam = *aResult; \
|
paramType& aParam = *aResult; \
|
||||||
return ReadParams(aMsg, aIter, \
|
return ReadParams(aReader, \
|
||||||
MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), (), \
|
MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), (), \
|
||||||
(__VA_ARGS__))); \
|
(__VA_ARGS__))); \
|
||||||
} \
|
} \
|
||||||
@ -239,17 +229,16 @@ static bool ReadParams(const Message* aMsg, PickleIterator* aIter,
|
|||||||
template <> \
|
template <> \
|
||||||
struct ParamTraits<Type> { \
|
struct ParamTraits<Type> { \
|
||||||
typedef Type paramType; \
|
typedef Type paramType; \
|
||||||
static void Write(Message* aMsg, const paramType& aParam) { \
|
static void Write(MessageWriter* aWriter, const paramType& aParam) { \
|
||||||
WriteParam(aMsg, static_cast<const Super&>(aParam)); \
|
WriteParam(aWriter, static_cast<const Super&>(aParam)); \
|
||||||
WriteParams(aMsg, MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), (), \
|
WriteParams(aWriter, MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), \
|
||||||
(__VA_ARGS__))); \
|
(), (__VA_ARGS__))); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter, \
|
static bool Read(MessageReader* aReader, paramType* aResult) { \
|
||||||
paramType* aResult) { \
|
|
||||||
paramType& aParam = *aResult; \
|
paramType& aParam = *aResult; \
|
||||||
return ReadParam(aMsg, aIter, static_cast<Super*>(aResult)) && \
|
return ReadParam(aReader, static_cast<Super*>(aResult)) && \
|
||||||
ReadParams(aMsg, aIter, \
|
ReadParams(aReader, \
|
||||||
MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), (), \
|
MOZ_FOR_EACH_SEPARATED(ACCESS_PARAM_FIELD, (, ), (), \
|
||||||
(__VA_ARGS__))); \
|
(__VA_ARGS__))); \
|
||||||
} \
|
} \
|
||||||
|
@ -21,29 +21,29 @@ static_assert(kDynamicAtomToken >= kAtomsCount,
|
|||||||
"Exceeded supported number of static atoms");
|
"Exceeded supported number of static atoms");
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void ParamTraits<nsAtom*>::Write(Message* aMsg, const nsAtom* aParam) {
|
void ParamTraits<nsAtom*>::Write(MessageWriter* aWriter, const nsAtom* aParam) {
|
||||||
MOZ_ASSERT(aParam);
|
MOZ_ASSERT(aParam);
|
||||||
|
|
||||||
if (aParam->IsStatic()) {
|
if (aParam->IsStatic()) {
|
||||||
const nsStaticAtom* atom = aParam->AsStatic();
|
const nsStaticAtom* atom = aParam->AsStatic();
|
||||||
uint16_t index = static_cast<uint16_t>(nsGkAtoms::IndexOf(atom));
|
uint16_t index = static_cast<uint16_t>(nsGkAtoms::IndexOf(atom));
|
||||||
MOZ_ASSERT(index < kAtomsCount);
|
MOZ_ASSERT(index < kAtomsCount);
|
||||||
WriteParam(aMsg, index);
|
WriteParam(aWriter, index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WriteParam(aMsg, kDynamicAtomToken);
|
WriteParam(aWriter, kDynamicAtomToken);
|
||||||
nsDependentAtomString atomStr(aParam);
|
nsDependentAtomString atomStr(aParam);
|
||||||
// nsDependentAtomString is serialized as its base, nsString, but we
|
// nsDependentAtomString is serialized as its base, nsString, but we
|
||||||
// can be explicit about it.
|
// can be explicit about it.
|
||||||
nsString& str = atomStr;
|
nsString& str = atomStr;
|
||||||
WriteParam(aMsg, str);
|
WriteParam(aWriter, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
bool ParamTraits<nsAtom*>::Read(const Message* aMsg, PickleIterator* aIter,
|
bool ParamTraits<nsAtom*>::Read(MessageReader* aReader,
|
||||||
RefPtr<nsAtom>* aResult) {
|
RefPtr<nsAtom>* aResult) {
|
||||||
uint16_t token;
|
uint16_t token;
|
||||||
if (!ReadParam(aMsg, aIter, &token)) {
|
if (!ReadParam(aReader, &token)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (token != kDynamicAtomToken) {
|
if (token != kDynamicAtomToken) {
|
||||||
@ -55,7 +55,7 @@ bool ParamTraits<nsAtom*>::Read(const Message* aMsg, PickleIterator* aIter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsAutoString str;
|
nsAutoString str;
|
||||||
if (!ReadParam(aMsg, aIter, static_cast<nsString*>(&str))) {
|
if (!ReadParam(aReader, static_cast<nsString*>(&str))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,23 +77,22 @@ template <>
|
|||||||
struct ParamTraits<nsACString> {
|
struct ParamTraits<nsACString> {
|
||||||
typedef nsACString paramType;
|
typedef nsACString paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
bool isVoid = aParam.IsVoid();
|
bool isVoid = aParam.IsVoid();
|
||||||
aMsg->WriteBool(isVoid);
|
aWriter->WriteBool(isVoid);
|
||||||
|
|
||||||
if (isVoid)
|
if (isVoid)
|
||||||
// represents a nullptr pointer
|
// represents a nullptr pointer
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32_t length = aParam.Length();
|
uint32_t length = aParam.Length();
|
||||||
WriteParam(aMsg, length);
|
WriteParam(aWriter, length);
|
||||||
aMsg->WriteBytes(aParam.BeginReading(), length);
|
aWriter->WriteBytes(aParam.BeginReading(), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
bool isVoid;
|
bool isVoid;
|
||||||
if (!aMsg->ReadBool(aIter, &isVoid)) return false;
|
if (!aReader->ReadBool(&isVoid)) return false;
|
||||||
|
|
||||||
if (isVoid) {
|
if (isVoid) {
|
||||||
aResult->SetIsVoid(true);
|
aResult->SetIsVoid(true);
|
||||||
@ -101,15 +100,15 @@ struct ParamTraits<nsACString> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) {
|
if (!ReadParam(aReader, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!aMsg->HasBytesAvailable(aIter, length)) {
|
if (!aReader->HasBytesAvailable(length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
aResult->SetLength(length);
|
aResult->SetLength(length);
|
||||||
|
|
||||||
return aMsg->ReadBytesInto(aIter, aResult->BeginWriting(), length);
|
return aReader->ReadBytesInto(aResult->BeginWriting(), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -124,23 +123,22 @@ template <>
|
|||||||
struct ParamTraits<nsAString> {
|
struct ParamTraits<nsAString> {
|
||||||
typedef nsAString paramType;
|
typedef nsAString paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
bool isVoid = aParam.IsVoid();
|
bool isVoid = aParam.IsVoid();
|
||||||
aMsg->WriteBool(isVoid);
|
aWriter->WriteBool(isVoid);
|
||||||
|
|
||||||
if (isVoid)
|
if (isVoid)
|
||||||
// represents a nullptr pointer
|
// represents a nullptr pointer
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32_t length = aParam.Length();
|
uint32_t length = aParam.Length();
|
||||||
WriteParam(aMsg, length);
|
WriteParam(aWriter, length);
|
||||||
aMsg->WriteBytes(aParam.BeginReading(), length * sizeof(char16_t));
|
aWriter->WriteBytes(aParam.BeginReading(), length * sizeof(char16_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
bool isVoid;
|
bool isVoid;
|
||||||
if (!aMsg->ReadBool(aIter, &isVoid)) return false;
|
if (!aReader->ReadBool(&isVoid)) return false;
|
||||||
|
|
||||||
if (isVoid) {
|
if (isVoid) {
|
||||||
aResult->SetIsVoid(true);
|
aResult->SetIsVoid(true);
|
||||||
@ -148,21 +146,20 @@ struct ParamTraits<nsAString> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) {
|
if (!ReadParam(aReader, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::CheckedInt<uint32_t> byteLength =
|
mozilla::CheckedInt<uint32_t> byteLength =
|
||||||
mozilla::CheckedInt<uint32_t>(length) * sizeof(char16_t);
|
mozilla::CheckedInt<uint32_t>(length) * sizeof(char16_t);
|
||||||
if (!byteLength.isValid() ||
|
if (!byteLength.isValid() ||
|
||||||
!aMsg->HasBytesAvailable(aIter, byteLength.value())) {
|
!aReader->HasBytesAvailable(byteLength.value())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
aResult->SetLength(length);
|
aResult->SetLength(length);
|
||||||
|
|
||||||
return aMsg->ReadBytesInto(aIter, aResult->BeginWriting(),
|
return aReader->ReadBytesInto(aResult->BeginWriting(), byteLength.value());
|
||||||
byteLength.value());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -236,24 +233,23 @@ template <>
|
|||||||
struct ParamTraits<nsTHashSet<uint64_t>> {
|
struct ParamTraits<nsTHashSet<uint64_t>> {
|
||||||
typedef nsTHashSet<uint64_t> paramType;
|
typedef nsTHashSet<uint64_t> paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
uint32_t count = aParam.Count();
|
uint32_t count = aParam.Count();
|
||||||
WriteParam(aMsg, count);
|
WriteParam(aWriter, count);
|
||||||
for (const auto& key : aParam) {
|
for (const auto& key : aParam) {
|
||||||
WriteParam(aMsg, key);
|
WriteParam(aWriter, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
if (!ReadParam(aMsg, aIter, &count)) {
|
if (!ReadParam(aReader, &count)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
paramType table(count);
|
paramType table(count);
|
||||||
for (uint32_t i = 0; i < count; ++i) {
|
for (uint32_t i = 0; i < count; ++i) {
|
||||||
uint64_t key;
|
uint64_t key;
|
||||||
if (!ReadParam(aMsg, aIter, &key)) {
|
if (!ReadParam(aReader, &key)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
table.Insert(key);
|
table.Insert(key);
|
||||||
@ -285,28 +281,27 @@ struct ParamTraits<nsTArray<E>> {
|
|||||||
static const bool sUseWriteBytes =
|
static const bool sUseWriteBytes =
|
||||||
(std::is_integral_v<E> || std::is_floating_point_v<E>);
|
(std::is_integral_v<E> || std::is_floating_point_v<E>);
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
uint32_t length = aParam.Length();
|
uint32_t length = aParam.Length();
|
||||||
WriteParam(aMsg, length);
|
WriteParam(aWriter, length);
|
||||||
|
|
||||||
if (sUseWriteBytes) {
|
if (sUseWriteBytes) {
|
||||||
int pickledLength = 0;
|
int pickledLength = 0;
|
||||||
MOZ_RELEASE_ASSERT(ByteLengthIsValid(length, sizeof(E), &pickledLength));
|
MOZ_RELEASE_ASSERT(ByteLengthIsValid(length, sizeof(E), &pickledLength));
|
||||||
aMsg->WriteBytes(aParam.Elements(), pickledLength);
|
aWriter->WriteBytes(aParam.Elements(), pickledLength);
|
||||||
} else {
|
} else {
|
||||||
const E* elems = aParam.Elements();
|
const E* elems = aParam.Elements();
|
||||||
for (uint32_t index = 0; index < length; index++) {
|
for (uint32_t index = 0; index < length; index++) {
|
||||||
WriteParam(aMsg, elems[index]);
|
WriteParam(aWriter, elems[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method uses infallible allocation so that an OOM failure will
|
// This method uses infallible allocation so that an OOM failure will
|
||||||
// show up as an OOM crash rather than an IPC FatalError.
|
// show up as an OOM crash rather than an IPC FatalError.
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) {
|
if (!ReadParam(aReader, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,12 +312,12 @@ struct ParamTraits<nsTArray<E>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
E* elements = aResult->AppendElements(length);
|
E* elements = aResult->AppendElements(length);
|
||||||
return aMsg->ReadBytesInto(aIter, elements, pickledLength);
|
return aReader->ReadBytesInto(elements, pickledLength);
|
||||||
} else {
|
} else {
|
||||||
// Each ReadParam<E> may read more than 1 byte each; this is an attempt
|
// Each ReadParam<E> may read more than 1 byte each; this is an attempt
|
||||||
// to minimally validate that the length isn't much larger than what's
|
// to minimally validate that the length isn't much larger than what's
|
||||||
// actually available in aMsg.
|
// actually available in aReader.
|
||||||
if (!aMsg->HasBytesAvailable(aIter, length)) {
|
if (!aReader->HasBytesAvailable(length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +325,7 @@ struct ParamTraits<nsTArray<E>> {
|
|||||||
|
|
||||||
for (uint32_t index = 0; index < length; index++) {
|
for (uint32_t index = 0; index < length; index++) {
|
||||||
E* element = aResult->AppendElement();
|
E* element = aResult->AppendElement();
|
||||||
if (!ReadParam(aMsg, aIter, element)) {
|
if (!ReadParam(aReader, element)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,15 +350,14 @@ template <typename E>
|
|||||||
struct ParamTraits<FallibleTArray<E>> {
|
struct ParamTraits<FallibleTArray<E>> {
|
||||||
typedef FallibleTArray<E> paramType;
|
typedef FallibleTArray<E> paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, static_cast<const nsTArray<E>&>(aParam));
|
WriteParam(aWriter, static_cast<const nsTArray<E>&>(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deserialize the array infallibly, but return a FallibleTArray.
|
// Deserialize the array infallibly, but return a FallibleTArray.
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
nsTArray<E> temp;
|
nsTArray<E> temp;
|
||||||
if (!ReadParam(aMsg, aIter, &temp)) return false;
|
if (!ReadParam(aReader, &temp)) return false;
|
||||||
|
|
||||||
*aResult = std::move(temp);
|
*aResult = std::move(temp);
|
||||||
return true;
|
return true;
|
||||||
@ -398,26 +392,25 @@ struct ParamTraits<mozilla::Vector<E, N, AP>> {
|
|||||||
static const bool sUseWriteBytes =
|
static const bool sUseWriteBytes =
|
||||||
(std::is_integral_v<E> || std::is_floating_point_v<E>);
|
(std::is_integral_v<E> || std::is_floating_point_v<E>);
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
uint32_t length = aParam.length();
|
uint32_t length = aParam.length();
|
||||||
WriteParam(aMsg, length);
|
WriteParam(aWriter, length);
|
||||||
|
|
||||||
if (sUseWriteBytes) {
|
if (sUseWriteBytes) {
|
||||||
int pickledLength = 0;
|
int pickledLength = 0;
|
||||||
MOZ_RELEASE_ASSERT(ByteLengthIsValid(length, sizeof(E), &pickledLength));
|
MOZ_RELEASE_ASSERT(ByteLengthIsValid(length, sizeof(E), &pickledLength));
|
||||||
aMsg->WriteBytes(aParam.begin(), pickledLength);
|
aWriter->WriteBytes(aParam.begin(), pickledLength);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const E& elem : aParam) {
|
for (const E& elem : aParam) {
|
||||||
WriteParam(aMsg, elem);
|
WriteParam(aWriter, elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) {
|
if (!ReadParam(aReader, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,13 +426,13 @@ struct ParamTraits<mozilla::Vector<E, N, AP>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
E* elements = aResult->begin();
|
E* elements = aResult->begin();
|
||||||
return aMsg->ReadBytesInto(aIter, elements, pickledLength);
|
return aReader->ReadBytesInto(elements, pickledLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each ReadParam<E> may read more than 1 byte each; this is an attempt
|
// Each ReadParam<E> may read more than 1 byte each; this is an attempt
|
||||||
// to minimally validate that the length isn't much larger than what's
|
// to minimally validate that the length isn't much larger than what's
|
||||||
// actually available in aMsg.
|
// actually available in aReader.
|
||||||
if (!aMsg->HasBytesAvailable(aIter, length)) {
|
if (!aReader->HasBytesAvailable(length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +442,7 @@ struct ParamTraits<mozilla::Vector<E, N, AP>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t index = 0; index < length; ++index) {
|
for (uint32_t index = 0; index < length; ++index) {
|
||||||
if (!ReadParam(aMsg, aIter, &((*aResult)[index]))) {
|
if (!ReadParam(aReader, &((*aResult)[index]))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -479,26 +472,25 @@ struct ParamTraits<std::vector<E>> {
|
|||||||
static const bool sUseWriteBytes =
|
static const bool sUseWriteBytes =
|
||||||
(std::is_integral_v<E> || std::is_floating_point_v<E>);
|
(std::is_integral_v<E> || std::is_floating_point_v<E>);
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
uint32_t length = aParam.size();
|
uint32_t length = aParam.size();
|
||||||
WriteParam(aMsg, length);
|
WriteParam(aWriter, length);
|
||||||
|
|
||||||
if (sUseWriteBytes) {
|
if (sUseWriteBytes) {
|
||||||
int pickledLength = 0;
|
int pickledLength = 0;
|
||||||
MOZ_RELEASE_ASSERT(ByteLengthIsValid(length, sizeof(E), &pickledLength));
|
MOZ_RELEASE_ASSERT(ByteLengthIsValid(length, sizeof(E), &pickledLength));
|
||||||
aMsg->WriteBytes(aParam.data(), pickledLength);
|
aWriter->WriteBytes(aParam.data(), pickledLength);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const E& elem : aParam) {
|
for (const E& elem : aParam) {
|
||||||
WriteParam(aMsg, elem);
|
WriteParam(aWriter, elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) {
|
if (!ReadParam(aReader, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,20 +503,20 @@ struct ParamTraits<std::vector<E>> {
|
|||||||
aResult->resize(length);
|
aResult->resize(length);
|
||||||
|
|
||||||
E* elements = aResult->data();
|
E* elements = aResult->data();
|
||||||
return aMsg->ReadBytesInto(aIter, elements, pickledLength);
|
return aReader->ReadBytesInto(elements, pickledLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each ReadParam<E> may read more than 1 byte each; this is an attempt
|
// Each ReadParam<E> may read more than 1 byte each; this is an attempt
|
||||||
// to minimally validate that the length isn't much larger than what's
|
// to minimally validate that the length isn't much larger than what's
|
||||||
// actually available in aMsg.
|
// actually available in aReader.
|
||||||
if (!aMsg->HasBytesAvailable(aIter, length)) {
|
if (!aReader->HasBytesAvailable(length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
aResult->resize(length);
|
aResult->resize(length);
|
||||||
|
|
||||||
for (uint32_t index = 0; index < length; ++index) {
|
for (uint32_t index = 0; index < length; ++index) {
|
||||||
if (!ReadParam(aMsg, aIter, &((*aResult)[index]))) {
|
if (!ReadParam(aReader, &((*aResult)[index]))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -546,25 +538,24 @@ template <typename K, typename V>
|
|||||||
struct ParamTraits<std::unordered_map<K, V>> final {
|
struct ParamTraits<std::unordered_map<K, V>> final {
|
||||||
using T = std::unordered_map<K, V>;
|
using T = std::unordered_map<K, V>;
|
||||||
|
|
||||||
static void Write(Message* const msg, const T& in) {
|
static void Write(MessageWriter* const writer, const T& in) {
|
||||||
WriteParam(msg, in.size());
|
WriteParam(writer, in.size());
|
||||||
for (const auto& pair : in) {
|
for (const auto& pair : in) {
|
||||||
WriteParam(msg, pair.first);
|
WriteParam(writer, pair.first);
|
||||||
WriteParam(msg, pair.second);
|
WriteParam(writer, pair.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* const msg, PickleIterator* const itr,
|
static bool Read(MessageReader* const reader, T* const out) {
|
||||||
T* const out) {
|
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
if (!ReadParam(msg, itr, &size)) return false;
|
if (!ReadParam(reader, &size)) return false;
|
||||||
T map;
|
T map;
|
||||||
map.reserve(size);
|
map.reserve(size);
|
||||||
for (const auto i : mozilla::IntegerRange(size)) {
|
for (const auto i : mozilla::IntegerRange(size)) {
|
||||||
std::pair<K, V> pair;
|
std::pair<K, V> pair;
|
||||||
mozilla::Unused << i;
|
mozilla::Unused << i;
|
||||||
if (!ReadParam(msg, itr, &(pair.first)) ||
|
if (!ReadParam(reader, &(pair.first)) ||
|
||||||
!ReadParam(msg, itr, &(pair.second))) {
|
!ReadParam(reader, &(pair.second))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
map.insert(std::move(pair));
|
map.insert(std::move(pair));
|
||||||
@ -578,13 +569,12 @@ template <>
|
|||||||
struct ParamTraits<float> {
|
struct ParamTraits<float> {
|
||||||
typedef float paramType;
|
typedef float paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aMsg->WriteBytes(&aParam, sizeof(paramType));
|
aWriter->WriteBytes(&aParam, sizeof(paramType));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return aReader->ReadBytesInto(aResult, sizeof(*aResult));
|
||||||
return aMsg->ReadBytesInto(aIter, aResult, sizeof(*aResult));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -601,24 +591,23 @@ template <>
|
|||||||
struct ParamTraits<nsID> {
|
struct ParamTraits<nsID> {
|
||||||
typedef nsID paramType;
|
typedef nsID paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.m0);
|
WriteParam(aWriter, aParam.m0);
|
||||||
WriteParam(aMsg, aParam.m1);
|
WriteParam(aWriter, aParam.m1);
|
||||||
WriteParam(aMsg, aParam.m2);
|
WriteParam(aWriter, aParam.m2);
|
||||||
for (unsigned int i = 0; i < mozilla::ArrayLength(aParam.m3); i++) {
|
for (unsigned int i = 0; i < mozilla::ArrayLength(aParam.m3); i++) {
|
||||||
WriteParam(aMsg, aParam.m3[i]);
|
WriteParam(aWriter, aParam.m3[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
if (!ReadParam(aReader, &(aResult->m0)) ||
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->m0)) ||
|
!ReadParam(aReader, &(aResult->m1)) ||
|
||||||
!ReadParam(aMsg, aIter, &(aResult->m1)) ||
|
!ReadParam(aReader, &(aResult->m2)))
|
||||||
!ReadParam(aMsg, aIter, &(aResult->m2)))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < mozilla::ArrayLength(aResult->m3); i++)
|
for (unsigned int i = 0; i < mozilla::ArrayLength(aResult->m3); i++)
|
||||||
if (!ReadParam(aMsg, aIter, &(aResult->m3[i]))) return false;
|
if (!ReadParam(aReader, &(aResult->m3[i]))) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -642,24 +631,22 @@ struct ParamTraits<nsContentPolicyType>
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::TimeDuration> {
|
struct ParamTraits<mozilla::TimeDuration> {
|
||||||
typedef mozilla::TimeDuration paramType;
|
typedef mozilla::TimeDuration paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mValue);
|
WriteParam(aWriter, aParam.mValue);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mValue);
|
||||||
return ReadParam(aMsg, aIter, &aResult->mValue);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::TimeStamp> {
|
struct ParamTraits<mozilla::TimeStamp> {
|
||||||
typedef mozilla::TimeStamp paramType;
|
typedef mozilla::TimeStamp paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mValue);
|
WriteParam(aWriter, aParam.mValue);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mValue);
|
||||||
return ReadParam(aMsg, aIter, &aResult->mValue);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -668,18 +655,17 @@ struct ParamTraits<mozilla::TimeStamp> {
|
|||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::TimeStampValue> {
|
struct ParamTraits<mozilla::TimeStampValue> {
|
||||||
typedef mozilla::TimeStampValue paramType;
|
typedef mozilla::TimeStampValue paramType;
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.mGTC);
|
WriteParam(aWriter, aParam.mGTC);
|
||||||
WriteParam(aMsg, aParam.mQPC);
|
WriteParam(aWriter, aParam.mQPC);
|
||||||
WriteParam(aMsg, aParam.mIsNull);
|
WriteParam(aWriter, aParam.mIsNull);
|
||||||
WriteParam(aMsg, aParam.mHasQPC);
|
WriteParam(aWriter, aParam.mHasQPC);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return (ReadParam(aReader, &aResult->mGTC) &&
|
||||||
return (ReadParam(aMsg, aIter, &aResult->mGTC) &&
|
ReadParam(aReader, &aResult->mQPC) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mQPC) &&
|
ReadParam(aReader, &aResult->mIsNull) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mIsNull) &&
|
ReadParam(aReader, &aResult->mHasQPC));
|
||||||
ReadParam(aMsg, aIter, &aResult->mHasQPC));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -689,13 +675,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::dom::ipc::StructuredCloneData> {
|
struct ParamTraits<mozilla::dom::ipc::StructuredCloneData> {
|
||||||
typedef mozilla::dom::ipc::StructuredCloneData paramType;
|
typedef mozilla::dom::ipc::StructuredCloneData paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
aParam.WriteIPCParams(aMsg);
|
aParam.WriteIPCParams(aWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return aResult->ReadIPCParams(aReader);
|
||||||
return aResult->ReadIPCParams(aMsg, aIter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -707,24 +692,23 @@ template <class T>
|
|||||||
struct ParamTraits<mozilla::Maybe<T>> {
|
struct ParamTraits<mozilla::Maybe<T>> {
|
||||||
typedef mozilla::Maybe<T> paramType;
|
typedef mozilla::Maybe<T> paramType;
|
||||||
|
|
||||||
static void Write(Message* msg, const paramType& param) {
|
static void Write(MessageWriter* writer, const paramType& param) {
|
||||||
if (param.isSome()) {
|
if (param.isSome()) {
|
||||||
WriteParam(msg, true);
|
WriteParam(writer, true);
|
||||||
WriteParam(msg, param.value());
|
WriteParam(writer, param.value());
|
||||||
} else {
|
} else {
|
||||||
WriteParam(msg, false);
|
WriteParam(writer, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* msg, PickleIterator* iter,
|
static bool Read(MessageReader* reader, paramType* result) {
|
||||||
paramType* result) {
|
|
||||||
bool isSome;
|
bool isSome;
|
||||||
if (!ReadParam(msg, iter, &isSome)) {
|
if (!ReadParam(reader, &isSome)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isSome) {
|
if (isSome) {
|
||||||
T tmp;
|
T tmp;
|
||||||
if (!ReadParam(msg, iter, &tmp)) {
|
if (!ReadParam(reader, &tmp)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*result = mozilla::Some(std::move(tmp));
|
*result = mozilla::Some(std::move(tmp));
|
||||||
@ -740,16 +724,15 @@ struct ParamTraits<mozilla::EnumSet<T, U>> {
|
|||||||
typedef mozilla::EnumSet<T, U> paramType;
|
typedef mozilla::EnumSet<T, U> paramType;
|
||||||
typedef U serializedType;
|
typedef U serializedType;
|
||||||
|
|
||||||
static void Write(Message* msg, const paramType& param) {
|
static void Write(MessageWriter* writer, const paramType& param) {
|
||||||
MOZ_RELEASE_ASSERT(IsLegalValue(param.serialize()));
|
MOZ_RELEASE_ASSERT(IsLegalValue(param.serialize()));
|
||||||
WriteParam(msg, param.serialize());
|
WriteParam(writer, param.serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* msg, PickleIterator* iter,
|
static bool Read(MessageReader* reader, paramType* result) {
|
||||||
paramType* result) {
|
|
||||||
serializedType tmp;
|
serializedType tmp;
|
||||||
|
|
||||||
if (ReadParam(msg, iter, &tmp)) {
|
if (ReadParam(reader, &tmp)) {
|
||||||
if (IsLegalValue(tmp)) {
|
if (IsLegalValue(tmp)) {
|
||||||
result->deserialize(tmp);
|
result->deserialize(tmp);
|
||||||
return true;
|
return true;
|
||||||
@ -781,9 +764,9 @@ struct ParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
typedef mozilla::Variant<Ts...> paramType;
|
typedef mozilla::Variant<Ts...> paramType;
|
||||||
using Tag = typename mozilla::detail::VariantTag<Ts...>::Type;
|
using Tag = typename mozilla::detail::VariantTag<Ts...>::Type;
|
||||||
|
|
||||||
static void Write(Message* msg, const paramType& param) {
|
static void Write(MessageWriter* writer, const paramType& param) {
|
||||||
WriteParam(msg, param.tag);
|
WriteParam(writer, param.tag);
|
||||||
param.match([msg](const auto& t) { WriteParam(msg, t); });
|
param.match([writer](const auto& t) { WriteParam(writer, t); });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Because VariantReader is a nested struct, we need the dummy template
|
// Because VariantReader is a nested struct, we need the dummy template
|
||||||
@ -793,8 +776,7 @@ struct ParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
struct VariantReader {
|
struct VariantReader {
|
||||||
using Next = VariantReader<N - 1>;
|
using Next = VariantReader<N - 1>;
|
||||||
|
|
||||||
static bool Read(const Message* msg, PickleIterator* iter, Tag tag,
|
static bool Read(MessageReader* reader, Tag tag, paramType* result) {
|
||||||
paramType* result) {
|
|
||||||
// Since the VariantReader specializations start at N , we need to
|
// Since the VariantReader specializations start at N , we need to
|
||||||
// subtract one to look at N - 1, the first valid tag. This means our
|
// subtract one to look at N - 1, the first valid tag. This means our
|
||||||
// comparisons are off by 1. If we get to N = 0 then we have failed to
|
// comparisons are off by 1. If we get to N = 0 then we have failed to
|
||||||
@ -805,9 +787,9 @@ struct ParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
// Default construct our field within the result outparameter and
|
// Default construct our field within the result outparameter and
|
||||||
// directly deserialize into the variant. Note that this means that
|
// directly deserialize into the variant. Note that this means that
|
||||||
// every type in Ts needs to be default constructible
|
// every type in Ts needs to be default constructible
|
||||||
return ReadParam(msg, iter, &result->template emplace<N - 1>());
|
return ReadParam(reader, &result->template emplace<N - 1>());
|
||||||
} else {
|
} else {
|
||||||
return Next::Read(msg, iter, tag, result);
|
return Next::Read(reader, tag, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -818,17 +800,15 @@ struct ParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
// a matching tag.
|
// a matching tag.
|
||||||
template <typename dummy>
|
template <typename dummy>
|
||||||
struct VariantReader<0, dummy> {
|
struct VariantReader<0, dummy> {
|
||||||
static bool Read(const Message* msg, PickleIterator* iter, Tag tag,
|
static bool Read(MessageReader* reader, Tag tag, paramType* result) {
|
||||||
paramType* result) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool Read(const Message* msg, PickleIterator* iter,
|
static bool Read(MessageReader* reader, paramType* result) {
|
||||||
paramType* result) {
|
|
||||||
Tag tag;
|
Tag tag;
|
||||||
if (ReadParam(msg, iter, &tag)) {
|
if (ReadParam(reader, &tag)) {
|
||||||
return VariantReader<sizeof...(Ts)>::Read(msg, iter, tag, result);
|
return VariantReader<sizeof...(Ts)>::Read(reader, tag, result);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -838,28 +818,27 @@ template <typename T>
|
|||||||
struct ParamTraits<mozilla::dom::Optional<T>> {
|
struct ParamTraits<mozilla::dom::Optional<T>> {
|
||||||
typedef mozilla::dom::Optional<T> paramType;
|
typedef mozilla::dom::Optional<T> paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
if (aParam.WasPassed()) {
|
if (aParam.WasPassed()) {
|
||||||
WriteParam(aMsg, true);
|
WriteParam(aWriter, true);
|
||||||
WriteParam(aMsg, aParam.Value());
|
WriteParam(aWriter, aParam.Value());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteParam(aMsg, false);
|
WriteParam(aWriter, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
bool wasPassed = false;
|
bool wasPassed = false;
|
||||||
|
|
||||||
if (!ReadParam(aMsg, aIter, &wasPassed)) {
|
if (!ReadParam(aReader, &wasPassed)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
aResult->Reset();
|
aResult->Reset();
|
||||||
|
|
||||||
if (wasPassed) {
|
if (wasPassed) {
|
||||||
if (!ReadParam(aMsg, aIter, &aResult->Construct())) {
|
if (!ReadParam(aReader, &aResult->Construct())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -872,9 +851,8 @@ template <>
|
|||||||
struct ParamTraits<nsAtom*> {
|
struct ParamTraits<nsAtom*> {
|
||||||
typedef nsAtom paramType;
|
typedef nsAtom paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType* aParam);
|
static void Write(MessageWriter* aWriter, const paramType* aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, RefPtr<paramType>* aResult);
|
||||||
RefPtr<paramType>* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CrossOriginOpenerPolicyValidator {
|
struct CrossOriginOpenerPolicyValidator {
|
||||||
@ -930,16 +908,15 @@ template <size_t N, typename Word>
|
|||||||
struct ParamTraits<mozilla::BitSet<N, Word>> {
|
struct ParamTraits<mozilla::BitSet<N, Word>> {
|
||||||
typedef mozilla::BitSet<N, Word> paramType;
|
typedef mozilla::BitSet<N, Word> paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
for (Word word : aParam.Storage()) {
|
for (Word word : aParam.Storage()) {
|
||||||
WriteParam(aMsg, word);
|
WriteParam(aWriter, word);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
for (Word& word : aResult->Storage()) {
|
for (Word& word : aResult->Storage()) {
|
||||||
if (!ReadParam(aMsg, aIter, &word)) {
|
if (!ReadParam(aReader, &word)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -951,19 +928,18 @@ template <typename T>
|
|||||||
struct ParamTraits<mozilla::UniquePtr<T>> {
|
struct ParamTraits<mozilla::UniquePtr<T>> {
|
||||||
typedef mozilla::UniquePtr<T> paramType;
|
typedef mozilla::UniquePtr<T> paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
bool isNull = aParam == nullptr;
|
bool isNull = aParam == nullptr;
|
||||||
WriteParam(aMsg, isNull);
|
WriteParam(aWriter, isNull);
|
||||||
|
|
||||||
if (!isNull) {
|
if (!isNull) {
|
||||||
WriteParam(aMsg, *aParam.get());
|
WriteParam(aWriter, *aParam.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
bool isNull = true;
|
bool isNull = true;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) {
|
if (!ReadParam(aReader, &isNull)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -971,7 +947,7 @@ struct ParamTraits<mozilla::UniquePtr<T>> {
|
|||||||
aResult->reset();
|
aResult->reset();
|
||||||
} else {
|
} else {
|
||||||
*aResult = mozilla::MakeUnique<T>();
|
*aResult = mozilla::MakeUnique<T>();
|
||||||
if (!ReadParam(aMsg, aIter, aResult->get())) {
|
if (!ReadParam(aReader, aResult->get())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -548,7 +548,7 @@ Maybe<IPCStream>& AutoIPCStream::TakeOptionalValue() {
|
|||||||
return *mOptionalValue;
|
return *mOptionalValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPDLParamTraits<nsIInputStream*>::Write(IPC::Message* aMsg,
|
void IPDLParamTraits<nsIInputStream*>::Write(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
nsIInputStream* aParam) {
|
nsIInputStream* aParam) {
|
||||||
auto autoStream = MakeRefPtr<HoldIPCStream>(/* aDelayedStart */ true);
|
auto autoStream = MakeRefPtr<HoldIPCStream>(/* aDelayedStart */ true);
|
||||||
@ -598,7 +598,7 @@ void IPDLParamTraits<nsIInputStream*>::Write(IPC::Message* aMsg,
|
|||||||
}
|
}
|
||||||
MOZ_RELEASE_ASSERT(ok, "Failed to serialize nsIInputStream");
|
MOZ_RELEASE_ASSERT(ok, "Failed to serialize nsIInputStream");
|
||||||
|
|
||||||
WriteIPDLParam(aMsg, aActor, autoStream->TakeOptionalValue());
|
WriteIPDLParam(aWriter, aActor, autoStream->TakeOptionalValue());
|
||||||
|
|
||||||
// Dispatch the autoStream to an async runnable, so that we guarantee it
|
// Dispatch the autoStream to an async runnable, so that we guarantee it
|
||||||
// outlives this callstack, and doesn't shut down any actors we created
|
// outlives this callstack, and doesn't shut down any actors we created
|
||||||
@ -607,12 +607,11 @@ void IPDLParamTraits<nsIInputStream*>::Write(IPC::Message* aMsg,
|
|||||||
NS_GetCurrentThread(), autoStream.forget(), true);
|
NS_GetCurrentThread(), autoStream.forget(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPDLParamTraits<nsIInputStream*>::Read(const IPC::Message* aMsg,
|
bool IPDLParamTraits<nsIInputStream*>::Read(IPC::MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor,
|
IProtocol* aActor,
|
||||||
RefPtr<nsIInputStream>* aResult) {
|
RefPtr<nsIInputStream>* aResult) {
|
||||||
mozilla::Maybe<mozilla::ipc::IPCStream> ipcStream;
|
mozilla::Maybe<mozilla::ipc::IPCStream> ipcStream;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &ipcStream)) {
|
if (!ReadIPDLParam(aReader, aActor, &ipcStream)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,10 +208,10 @@ class HoldIPCStream final : public AutoIPCStream {
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct IPDLParamTraits<nsIInputStream*> {
|
struct IPDLParamTraits<nsIInputStream*> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsIInputStream* aParam);
|
nsIInputStream* aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<nsIInputStream>* aResult);
|
RefPtr<nsIInputStream>* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
|
@ -37,14 +37,14 @@ struct IPDLParamTraits {
|
|||||||
// ParamTraits. Types which want to use the actor parameter must specialize
|
// ParamTraits. Types which want to use the actor parameter must specialize
|
||||||
// IPDLParamTraits.
|
// IPDLParamTraits.
|
||||||
template <typename R>
|
template <typename R>
|
||||||
static inline void Write(IPC::Message* aMsg, IProtocol*, R&& aParam) {
|
static inline void Write(IPC::MessageWriter* aWriter, IProtocol*,
|
||||||
IPC::ParamTraits<P>::Write(aMsg, std::forward<R>(aParam));
|
R&& aParam) {
|
||||||
|
IPC::ParamTraits<P>::Write(aWriter, std::forward<R>(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename R>
|
template <typename R>
|
||||||
static inline bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static inline bool Read(IPC::MessageReader* aReader, IProtocol*, R* aResult) {
|
||||||
IProtocol*, R* aResult) {
|
return IPC::ParamTraits<P>::Read(aReader, aResult);
|
||||||
return IPC::ParamTraits<P>::Read(aMsg, aIter, aResult);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -59,49 +59,47 @@ struct IPDLParamTraits {
|
|||||||
// more information.
|
// more information.
|
||||||
//
|
//
|
||||||
template <typename P>
|
template <typename P>
|
||||||
static MOZ_NEVER_INLINE void WriteIPDLParam(IPC::Message* aMsg,
|
static MOZ_NEVER_INLINE void WriteIPDLParam(IPC::MessageWriter* aWriter,
|
||||||
IProtocol* aActor, P&& aParam) {
|
IProtocol* aActor, P&& aParam) {
|
||||||
IPDLParamTraits<std::decay_t<P>>::Write(aMsg, aActor,
|
IPDLParamTraits<std::decay_t<P>>::Write(aWriter, aActor,
|
||||||
std::forward<P>(aParam));
|
std::forward<P>(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P>
|
template <typename P>
|
||||||
static MOZ_NEVER_INLINE bool ReadIPDLParam(const IPC::Message* aMsg,
|
static MOZ_NEVER_INLINE bool ReadIPDLParam(IPC::MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
IProtocol* aActor, P* aResult) {
|
IProtocol* aActor, P* aResult) {
|
||||||
return IPDLParamTraits<P>::Read(aMsg, aIter, aActor, aResult);
|
return IPDLParamTraits<P>::Read(aReader, aActor, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P>
|
template <typename P>
|
||||||
static MOZ_NEVER_INLINE bool ReadIPDLParamInfallible(
|
static MOZ_NEVER_INLINE bool ReadIPDLParamInfallible(
|
||||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
IPC::MessageReader* aReader, IProtocol* aActor, P* aResult,
|
||||||
P* aResult, const char* aCrashMessage) {
|
const char* aCrashMessage) {
|
||||||
bool ok = ReadIPDLParam(aMsg, aIter, aActor, aResult);
|
bool ok = ReadIPDLParam(aReader, aActor, aResult);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
MOZ_CRASH_UNSAFE(aCrashMessage);
|
MOZ_CRASH_UNSAFE(aCrashMessage);
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void WriteIPDLParamList(IPC::Message*, IProtocol*) {}
|
constexpr void WriteIPDLParamList(IPC::MessageWriter*, IProtocol*) {}
|
||||||
|
|
||||||
template <typename P, typename... Ps>
|
template <typename P, typename... Ps>
|
||||||
static void WriteIPDLParamList(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteIPDLParamList(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
P&& aParam, Ps&&... aParams) {
|
P&& aParam, Ps&&... aParams) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::forward<P>(aParam));
|
WriteIPDLParam(aWriter, aActor, std::forward<P>(aParam));
|
||||||
WriteIPDLParamList(aMsg, aActor, std::forward<Ps>(aParams)...);
|
WriteIPDLParamList(aWriter, aActor, std::forward<Ps>(aParams)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool ReadIPDLParamList(const IPC::Message*, PickleIterator*,
|
constexpr bool ReadIPDLParamList(IPC::MessageReader*, IProtocol*) {
|
||||||
IProtocol*) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P, typename... Ps>
|
template <typename P, typename... Ps>
|
||||||
static bool ReadIPDLParamList(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool ReadIPDLParamList(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, P* aResult, Ps*... aResults) {
|
P* aResult, Ps*... aResults) {
|
||||||
return ReadIPDLParam(aMsg, aIter, aActor, aResult) &&
|
return ReadIPDLParam(aReader, aActor, aResult) &&
|
||||||
ReadIPDLParamList(aMsg, aIter, aActor, aResults...);
|
ReadIPDLParamList(aReader, aActor, aResults...);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When being passed `RefPtr<T>` or `nsCOMPtr<T>`, forward to a specialization
|
// When being passed `RefPtr<T>` or `nsCOMPtr<T>`, forward to a specialization
|
||||||
@ -113,28 +111,28 @@ static bool ReadIPDLParamList(const IPC::Message* aMsg, PickleIterator* aIter,
|
|||||||
// deserializing into `nsCOMPtr<T>`.
|
// deserializing into `nsCOMPtr<T>`.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IPDLParamTraits<RefPtr<T>> {
|
struct IPDLParamTraits<RefPtr<T>> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const RefPtr<T>& aParam) {
|
const RefPtr<T>& aParam) {
|
||||||
IPDLParamTraits<T*>::Write(aMsg, aActor, aParam.get());
|
IPDLParamTraits<T*>::Write(aWriter, aActor, aParam.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, RefPtr<T>* aResult) {
|
RefPtr<T>* aResult) {
|
||||||
return IPDLParamTraits<T*>::Read(aMsg, aIter, aActor, aResult);
|
return IPDLParamTraits<T*>::Read(aReader, aActor, aResult);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IPDLParamTraits<nsCOMPtr<T>> {
|
struct IPDLParamTraits<nsCOMPtr<T>> {
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const nsCOMPtr<T>& aParam) {
|
const nsCOMPtr<T>& aParam) {
|
||||||
IPDLParamTraits<T*>::Write(aMsg, aActor, aParam.get());
|
IPDLParamTraits<T*>::Write(aWriter, aActor, aParam.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, nsCOMPtr<T>* aResult) {
|
nsCOMPtr<T>* aResult) {
|
||||||
RefPtr<T> refptr;
|
RefPtr<T> refptr;
|
||||||
if (!IPDLParamTraits<T*>::Read(aMsg, aIter, aActor, &refptr)) {
|
if (!IPDLParamTraits<T*>::Read(aReader, aActor, &refptr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*aResult = refptr.forget();
|
*aResult = refptr.forget();
|
||||||
@ -151,32 +149,33 @@ struct IPDLParamTraits<nsTArray<T>> {
|
|||||||
// forwarding reference as occasionally these types appear inside of IPDL
|
// forwarding reference as occasionally these types appear inside of IPDL
|
||||||
// arrays.
|
// arrays.
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, U&& aParam) {
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
U&& aParam) {
|
||||||
uint32_t length = aParam.Length();
|
uint32_t length = aParam.Length();
|
||||||
WriteIPDLParam(aMsg, aActor, length);
|
WriteIPDLParam(aWriter, aActor, length);
|
||||||
|
|
||||||
if (sUseWriteBytes) {
|
if (sUseWriteBytes) {
|
||||||
auto pickledLength = CheckedInt<int>(length) * sizeof(T);
|
auto pickledLength = CheckedInt<int>(length) * sizeof(T);
|
||||||
MOZ_RELEASE_ASSERT(pickledLength.isValid());
|
MOZ_RELEASE_ASSERT(pickledLength.isValid());
|
||||||
aMsg->WriteBytes(aParam.Elements(), pickledLength.value());
|
aWriter->WriteBytes(aParam.Elements(), pickledLength.value());
|
||||||
} else {
|
} else {
|
||||||
WriteValues(aMsg, aActor, std::forward<U>(aParam));
|
WriteValues(aWriter, aActor, std::forward<U>(aParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method uses infallible allocation so that an OOM failure will
|
// This method uses infallible allocation so that an OOM failure will
|
||||||
// show up as an OOM crash rather than an IPC FatalError.
|
// show up as an OOM crash rather than an IPC FatalError.
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, nsTArray<T>* aResult) {
|
nsTArray<T>* aResult) {
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &length)) {
|
if (!ReadIPDLParam(aReader, aActor, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sUseWriteBytes) {
|
if (sUseWriteBytes) {
|
||||||
auto pickledLength = CheckedInt<int>(length) * sizeof(T);
|
auto pickledLength = CheckedInt<int>(length) * sizeof(T);
|
||||||
if (!pickledLength.isValid() ||
|
if (!pickledLength.isValid() ||
|
||||||
!aMsg->HasBytesAvailable(aIter, pickledLength.value())) {
|
!aReader->HasBytesAvailable(pickledLength.value())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,15 +184,15 @@ struct IPDLParamTraits<nsTArray<T>> {
|
|||||||
// Perhaps we should consider using an API which doesn't initialize the
|
// Perhaps we should consider using an API which doesn't initialize the
|
||||||
// elements?
|
// elements?
|
||||||
T* elements = aResult->AppendElements(length);
|
T* elements = aResult->AppendElements(length);
|
||||||
return aMsg->ReadBytesInto(aIter, elements, pickledLength.value());
|
return aReader->ReadBytesInto(elements, pickledLength.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each ReadIPDLParam<E> may read more than 1 byte each; this is an attempt
|
// Each ReadIPDLParam<E> may read more than 1 byte each; this is an attempt
|
||||||
// to minimally validate that the length isn't much larger than what's
|
// to minimally validate that the length isn't much larger than what's
|
||||||
// actually available in aMsg. We cannot use |pickledLength|, like in the
|
// actually available in aReader. We cannot use |pickledLength|, like in the
|
||||||
// codepath above, because ReadIPDLParam can read variable amounts of data
|
// codepath above, because ReadIPDLParam can read variable amounts of data
|
||||||
// from aMsg.
|
// from aReader.
|
||||||
if (!aMsg->HasBytesAvailable(aIter, length)) {
|
if (!aReader->HasBytesAvailable(length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +200,7 @@ struct IPDLParamTraits<nsTArray<T>> {
|
|||||||
|
|
||||||
for (uint32_t index = 0; index < length; index++) {
|
for (uint32_t index = 0; index < length; index++) {
|
||||||
T* element = aResult->AppendElement();
|
T* element = aResult->AppendElement();
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, element)) {
|
if (!ReadIPDLParam(aReader, aActor, element)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,18 +209,18 @@ struct IPDLParamTraits<nsTArray<T>> {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// Length has already been written. Const overload.
|
// Length has already been written. Const overload.
|
||||||
static void WriteValues(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteValues(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const nsTArray<T>& aParam) {
|
const nsTArray<T>& aParam) {
|
||||||
for (auto& elt : aParam) {
|
for (auto& elt : aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, elt);
|
WriteIPDLParam(aWriter, aActor, elt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Length has already been written. Rvalue overload.
|
// Length has already been written. Rvalue overload.
|
||||||
static void WriteValues(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteValues(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
nsTArray<T>&& aParam) {
|
nsTArray<T>&& aParam) {
|
||||||
for (auto& elt : aParam) {
|
for (auto& elt : aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(elt));
|
WriteIPDLParam(aWriter, aActor, std::move(elt));
|
||||||
}
|
}
|
||||||
|
|
||||||
// As we just moved all of our values out, let's clean up after ourselves &
|
// As we just moved all of our values out, let's clean up after ourselves &
|
||||||
@ -247,35 +246,36 @@ template <typename T>
|
|||||||
struct IPDLParamTraits<Maybe<T>> {
|
struct IPDLParamTraits<Maybe<T>> {
|
||||||
typedef Maybe<T> paramType;
|
typedef Maybe<T> paramType;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const Maybe<T>& aParam) {
|
const Maybe<T>& aParam) {
|
||||||
bool isSome = aParam.isSome();
|
bool isSome = aParam.isSome();
|
||||||
WriteIPDLParam(aMsg, aActor, isSome);
|
WriteIPDLParam(aWriter, aActor, isSome);
|
||||||
|
|
||||||
if (isSome) {
|
if (isSome) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.ref());
|
WriteIPDLParam(aWriter, aActor, aParam.ref());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, Maybe<T>&& aParam) {
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
Maybe<T>&& aParam) {
|
||||||
bool isSome = aParam.isSome();
|
bool isSome = aParam.isSome();
|
||||||
WriteIPDLParam(aMsg, aActor, isSome);
|
WriteIPDLParam(aWriter, aActor, isSome);
|
||||||
|
|
||||||
if (isSome) {
|
if (isSome) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.ref()));
|
WriteIPDLParam(aWriter, aActor, std::move(aParam.ref()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, Maybe<T>* aResult) {
|
Maybe<T>* aResult) {
|
||||||
bool isSome;
|
bool isSome;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &isSome)) {
|
if (!ReadIPDLParam(aReader, aActor, &isSome)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSome) {
|
if (isSome) {
|
||||||
aResult->emplace();
|
aResult->emplace();
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, aResult->ptr())) {
|
if (!ReadIPDLParam(aReader, aActor, aResult->ptr())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -290,19 +290,20 @@ struct IPDLParamTraits<UniquePtr<T>> {
|
|||||||
typedef UniquePtr<T> paramType;
|
typedef UniquePtr<T> paramType;
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, U&& aParam) {
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
|
U&& aParam) {
|
||||||
bool isNull = aParam == nullptr;
|
bool isNull = aParam == nullptr;
|
||||||
WriteIPDLParam(aMsg, aActor, isNull);
|
WriteIPDLParam(aWriter, aActor, isNull);
|
||||||
|
|
||||||
if (!isNull) {
|
if (!isNull) {
|
||||||
WriteValue(aMsg, aActor, std::forward<U>(aParam));
|
WriteValue(aWriter, aActor, std::forward<U>(aParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, UniquePtr<T>* aResult) {
|
UniquePtr<T>* aResult) {
|
||||||
bool isNull = true;
|
bool isNull = true;
|
||||||
if (!ReadParam(aMsg, aIter, &isNull)) {
|
if (!ReadParam(aReader, &isNull)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +311,7 @@ struct IPDLParamTraits<UniquePtr<T>> {
|
|||||||
aResult->reset();
|
aResult->reset();
|
||||||
} else {
|
} else {
|
||||||
*aResult = MakeUnique<T>();
|
*aResult = MakeUnique<T>();
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, aResult->get())) {
|
if (!ReadIPDLParam(aReader, aActor, aResult->get())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,15 +320,15 @@ struct IPDLParamTraits<UniquePtr<T>> {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// If we have an rvalue, clear out our passed-in parameter.
|
// If we have an rvalue, clear out our passed-in parameter.
|
||||||
static void WriteValue(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteValue(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
UniquePtr<T>&& aParam) {
|
UniquePtr<T>&& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(*aParam.get()));
|
WriteIPDLParam(aWriter, aActor, std::move(*aParam.get()));
|
||||||
aParam = nullptr;
|
aParam = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteValue(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteValue(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const UniquePtr<T>& aParam) {
|
const UniquePtr<T>& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, *aParam.get());
|
WriteIPDLParam(aWriter, aActor, *aParam.get());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -336,36 +337,36 @@ struct IPDLParamTraits<Tuple<Ts...>> {
|
|||||||
typedef Tuple<Ts...> paramType;
|
typedef Tuple<Ts...> paramType;
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, U&& aParam) {
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
WriteInternal(aMsg, aActor, std::forward<U>(aParam),
|
U&& aParam) {
|
||||||
|
WriteInternal(aWriter, aActor, std::forward<U>(aParam),
|
||||||
std::index_sequence_for<Ts...>{});
|
std::index_sequence_for<Ts...>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, Tuple<Ts...>* aResult) {
|
Tuple<Ts...>* aResult) {
|
||||||
return ReadInternal(aMsg, aIter, aActor, *aResult,
|
return ReadInternal(aReader, aActor, *aResult,
|
||||||
std::index_sequence_for<Ts...>{});
|
std::index_sequence_for<Ts...>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <size_t... Is>
|
template <size_t... Is>
|
||||||
static void WriteInternal(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteInternal(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const Tuple<Ts...>& aParam,
|
const Tuple<Ts...>& aParam,
|
||||||
std::index_sequence<Is...>) {
|
std::index_sequence<Is...>) {
|
||||||
WriteIPDLParamList(aMsg, aActor, Get<Is>(aParam)...);
|
WriteIPDLParamList(aWriter, aActor, Get<Is>(aParam)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t... Is>
|
template <size_t... Is>
|
||||||
static void WriteInternal(IPC::Message* aMsg, IProtocol* aActor,
|
static void WriteInternal(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
Tuple<Ts...>&& aParam, std::index_sequence<Is...>) {
|
Tuple<Ts...>&& aParam, std::index_sequence<Is...>) {
|
||||||
WriteIPDLParamList(aMsg, aActor, std::move(Get<Is>(aParam))...);
|
WriteIPDLParamList(aWriter, aActor, std::move(Get<Is>(aParam))...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t... Is>
|
template <size_t... Is>
|
||||||
static bool ReadInternal(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool ReadInternal(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, Tuple<Ts...>& aResult,
|
Tuple<Ts...>& aResult, std::index_sequence<Is...>) {
|
||||||
std::index_sequence<Is...>) {
|
return ReadIPDLParamList(aReader, aActor, &Get<Is>(aResult)...);
|
||||||
return ReadIPDLParamList(aMsg, aIter, aActor, &Get<Is>(aResult)...);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -374,17 +375,19 @@ struct IPDLParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
typedef mozilla::Variant<Ts...> paramType;
|
typedef mozilla::Variant<Ts...> paramType;
|
||||||
using Tag = typename mozilla::detail::VariantTag<Ts...>::Type;
|
using Tag = typename mozilla::detail::VariantTag<Ts...>::Type;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam) {
|
const paramType& aParam) {
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.tag);
|
WriteIPDLParam(aWriter, aActor, aParam.tag);
|
||||||
aParam.match(
|
aParam.match([aWriter, aActor](const auto& t) {
|
||||||
[aMsg, aActor](const auto& t) { WriteIPDLParam(aMsg, aActor, t); });
|
WriteIPDLParam(aWriter, aActor, t);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam) {
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
WriteIPDLParam(aMsg, aActor, aParam.tag);
|
paramType&& aParam) {
|
||||||
aParam.match([aMsg, aActor](auto& t) {
|
WriteIPDLParam(aWriter, aActor, aParam.tag);
|
||||||
WriteIPDLParam(aMsg, aActor, std::move(t));
|
aParam.match([aWriter, aActor](auto& t) {
|
||||||
|
WriteIPDLParam(aWriter, aActor, std::move(t));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,8 +398,8 @@ struct IPDLParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
struct VariantReader {
|
struct VariantReader {
|
||||||
using Next = VariantReader<N - 1>;
|
using Next = VariantReader<N - 1>;
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor, Tag aTag,
|
||||||
IProtocol* aActor, Tag aTag, paramType* aResult) {
|
paramType* aResult) {
|
||||||
// Since the VariantReader specializations start at N , we need to
|
// Since the VariantReader specializations start at N , we need to
|
||||||
// subtract one to look at N - 1, the first valid tag. This means our
|
// subtract one to look at N - 1, the first valid tag. This means our
|
||||||
// comparisons are off by 1. If we get to N = 0 then we have failed to
|
// comparisons are off by 1. If we get to N = 0 then we have failed to
|
||||||
@ -407,10 +410,10 @@ struct IPDLParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
// Default construct our field within the result outparameter and
|
// Default construct our field within the result outparameter and
|
||||||
// directly deserialize into the variant. Note that this means that
|
// directly deserialize into the variant. Note that this means that
|
||||||
// every type in Ts needs to be default constructible.
|
// every type in Ts needs to be default constructible.
|
||||||
return ReadIPDLParam(aMsg, aIter, aActor,
|
return ReadIPDLParam(aReader, aActor,
|
||||||
&aResult->template emplace<N - 1>());
|
&aResult->template emplace<N - 1>());
|
||||||
}
|
}
|
||||||
return Next::Read(aMsg, aIter, aActor, aTag, aResult);
|
return Next::Read(aReader, aActor, aTag, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // VariantReader<N>
|
}; // VariantReader<N>
|
||||||
@ -420,21 +423,20 @@ struct IPDLParamTraits<mozilla::Variant<Ts...>> {
|
|||||||
// a matching tag.
|
// a matching tag.
|
||||||
template <typename dummy>
|
template <typename dummy>
|
||||||
struct VariantReader<0, dummy> {
|
struct VariantReader<0, dummy> {
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor, Tag aTag,
|
||||||
IProtocol* aActor, Tag aTag, paramType* aResult) {
|
paramType* aResult) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
Tag tag;
|
Tag tag;
|
||||||
if (!ReadIPDLParam(aMsg, aIter, aActor, &tag)) {
|
if (!ReadIPDLParam(aReader, aActor, &tag)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return VariantReader<sizeof...(Ts)>::Read(aMsg, aIter, aActor, tag,
|
return VariantReader<sizeof...(Ts)>::Read(aReader, aActor, tag, aResult);
|
||||||
aResult);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,20 +17,19 @@
|
|||||||
template <>
|
template <>
|
||||||
struct IPC::ParamTraits<mozilla::ipc::NodeChannel::Introduction> {
|
struct IPC::ParamTraits<mozilla::ipc::NodeChannel::Introduction> {
|
||||||
using paramType = mozilla::ipc::NodeChannel::Introduction;
|
using paramType = mozilla::ipc::NodeChannel::Introduction;
|
||||||
static void Write(Message* aMsg, paramType&& aParam) {
|
static void Write(MessageWriter* aWriter, paramType&& aParam) {
|
||||||
WriteParam(aMsg, aParam.mName);
|
WriteParam(aWriter, aParam.mName);
|
||||||
WriteParam(aMsg, std::move(aParam.mHandle));
|
WriteParam(aWriter, std::move(aParam.mHandle));
|
||||||
WriteParam(aMsg, aParam.mMode);
|
WriteParam(aWriter, aParam.mMode);
|
||||||
WriteParam(aMsg, aParam.mMyPid);
|
WriteParam(aWriter, aParam.mMyPid);
|
||||||
WriteParam(aMsg, aParam.mOtherPid);
|
WriteParam(aWriter, aParam.mOtherPid);
|
||||||
}
|
}
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->mName) &&
|
||||||
return ReadParam(aMsg, aIter, &aResult->mName) &&
|
ReadParam(aReader, &aResult->mHandle) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mHandle) &&
|
ReadParam(aReader, &aResult->mMode) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mMode) &&
|
ReadParam(aReader, &aResult->mMyPid) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mMyPid) &&
|
ReadParam(aReader, &aResult->mOtherPid);
|
||||||
ReadParam(aMsg, aIter, &aResult->mOtherPid);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -49,14 +49,13 @@ template <>
|
|||||||
struct ParamTraits<mozilla::ipc::ActorHandle> {
|
struct ParamTraits<mozilla::ipc::ActorHandle> {
|
||||||
typedef mozilla::ipc::ActorHandle paramType;
|
typedef mozilla::ipc::ActorHandle paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
IPC::WriteParam(aMsg, aParam.mId);
|
IPC::WriteParam(aWriter, aParam.mId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
int id;
|
int id;
|
||||||
if (IPC::ReadParam(aMsg, aIter, &id)) {
|
if (IPC::ReadParam(aReader, &id)) {
|
||||||
aResult->mId = id;
|
aResult->mId = id;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -72,17 +71,16 @@ template <class PFooSide>
|
|||||||
struct ParamTraits<mozilla::ipc::Endpoint<PFooSide>> {
|
struct ParamTraits<mozilla::ipc::Endpoint<PFooSide>> {
|
||||||
typedef mozilla::ipc::Endpoint<PFooSide> paramType;
|
typedef mozilla::ipc::Endpoint<PFooSide> paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, paramType&& aParam) {
|
static void Write(MessageWriter* aWriter, paramType&& aParam) {
|
||||||
IPC::WriteParam(aMsg, std::move(aParam.mPort));
|
IPC::WriteParam(aWriter, std::move(aParam.mPort));
|
||||||
IPC::WriteParam(aMsg, aParam.mMyPid);
|
IPC::WriteParam(aWriter, aParam.mMyPid);
|
||||||
IPC::WriteParam(aMsg, aParam.mOtherPid);
|
IPC::WriteParam(aWriter, aParam.mOtherPid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return IPC::ReadParam(aReader, &aResult->mPort) &&
|
||||||
return IPC::ReadParam(aMsg, aIter, &aResult->mPort) &&
|
IPC::ReadParam(aReader, &aResult->mMyPid) &&
|
||||||
IPC::ReadParam(aMsg, aIter, &aResult->mMyPid) &&
|
IPC::ReadParam(aReader, &aResult->mOtherPid);
|
||||||
IPC::ReadParam(aMsg, aIter, &aResult->mOtherPid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
@ -98,23 +96,25 @@ template <>
|
|||||||
struct IPDLParamTraits<UntypedManagedEndpoint> {
|
struct IPDLParamTraits<UntypedManagedEndpoint> {
|
||||||
using paramType = UntypedManagedEndpoint;
|
using paramType = UntypedManagedEndpoint;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam);
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
paramType&& aParam);
|
||||||
IProtocol* aActor, paramType* aResult);
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
|
paramType* aResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class PFooSide>
|
template <class PFooSide>
|
||||||
struct IPDLParamTraits<ManagedEndpoint<PFooSide>> {
|
struct IPDLParamTraits<ManagedEndpoint<PFooSide>> {
|
||||||
using paramType = ManagedEndpoint<PFooSide>;
|
using paramType = ManagedEndpoint<PFooSide>;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam) {
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
IPDLParamTraits<UntypedManagedEndpoint>::Write(aMsg, aActor,
|
paramType&& aParam) {
|
||||||
|
IPDLParamTraits<UntypedManagedEndpoint>::Write(aWriter, aActor,
|
||||||
std::move(aParam));
|
std::move(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult) {
|
paramType* aResult) {
|
||||||
return IPDLParamTraits<UntypedManagedEndpoint>::Read(aMsg, aIter, aActor,
|
return IPDLParamTraits<UntypedManagedEndpoint>::Read(aReader, aActor,
|
||||||
aResult);
|
aResult);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -123,10 +123,10 @@ template <>
|
|||||||
struct IPDLParamTraits<FileDescriptor> {
|
struct IPDLParamTraits<FileDescriptor> {
|
||||||
typedef FileDescriptor paramType;
|
typedef FileDescriptor paramType;
|
||||||
|
|
||||||
static void Write(IPC::Message* aMsg, IProtocol* aActor,
|
static void Write(IPC::MessageWriter* aWriter, IProtocol* aActor,
|
||||||
const paramType& aParam);
|
const paramType& aParam);
|
||||||
static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
|
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
|
||||||
IProtocol* aActor, paramType* aResult);
|
paramType* aResult);
|
||||||
};
|
};
|
||||||
} // namespace mozilla::ipc
|
} // namespace mozilla::ipc
|
||||||
|
|
||||||
|
@ -54,25 +54,24 @@ ScopedPort& ScopedPort::operator=(ScopedPort&& aOther) {
|
|||||||
|
|
||||||
} // namespace mozilla::ipc
|
} // namespace mozilla::ipc
|
||||||
|
|
||||||
void IPC::ParamTraits<mozilla::ipc::ScopedPort>::Write(Message* aMsg,
|
void IPC::ParamTraits<mozilla::ipc::ScopedPort>::Write(MessageWriter* aWriter,
|
||||||
paramType&& aParam) {
|
paramType&& aParam) {
|
||||||
aMsg->WriteBool(aParam.IsValid());
|
aWriter->WriteBool(aParam.IsValid());
|
||||||
if (!aParam.IsValid()) {
|
if (!aParam.IsValid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aMsg->WritePort(std::move(aParam));
|
aWriter->WritePort(std::move(aParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPC::ParamTraits<mozilla::ipc::ScopedPort>::Read(const Message* aMsg,
|
bool IPC::ParamTraits<mozilla::ipc::ScopedPort>::Read(MessageReader* aReader,
|
||||||
PickleIterator* aIter,
|
|
||||||
paramType* aResult) {
|
paramType* aResult) {
|
||||||
bool isValid = false;
|
bool isValid = false;
|
||||||
if (!aMsg->ReadBool(aIter, &isValid)) {
|
if (!aReader->ReadBool(&isValid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
*aResult = {};
|
*aResult = {};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return aMsg->ConsumePort(aIter, aResult);
|
return aReader->ConsumePort(aResult);
|
||||||
}
|
}
|
||||||
|
@ -70,9 +70,8 @@ template <>
|
|||||||
struct ParamTraits<mozilla::ipc::ScopedPort> {
|
struct ParamTraits<mozilla::ipc::ScopedPort> {
|
||||||
using paramType = mozilla::ipc::ScopedPort;
|
using paramType = mozilla::ipc::ScopedPort;
|
||||||
|
|
||||||
static void Write(Message* aMsg, paramType&& aParam);
|
static void Write(MessageWriter* aWriter, paramType&& aParam);
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult);
|
||||||
paramType* aResult);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace IPC
|
} // namespace IPC
|
||||||
|
@ -64,18 +64,17 @@ template <>
|
|||||||
struct ParamTraits<JSStructuredCloneData> {
|
struct ParamTraits<JSStructuredCloneData> {
|
||||||
typedef JSStructuredCloneData paramType;
|
typedef JSStructuredCloneData paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
MOZ_ASSERT(!(aParam.Size() % sizeof(uint64_t)));
|
MOZ_ASSERT(!(aParam.Size() % sizeof(uint64_t)));
|
||||||
WriteParam(aMsg, aParam.Size());
|
WriteParam(aWriter, aParam.Size());
|
||||||
aParam.ForEachDataChunk([&](const char* aData, size_t aSize) {
|
aParam.ForEachDataChunk([&](const char* aData, size_t aSize) {
|
||||||
return aMsg->WriteBytes(aData, aSize, sizeof(uint64_t));
|
return aWriter->WriteBytes(aData, aSize, sizeof(uint64_t));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
if (!ReadParam(aMsg, aIter, &length)) {
|
if (!ReadParam(aReader, &length)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(!(length % sizeof(uint64_t)));
|
MOZ_ASSERT(!(length % sizeof(uint64_t)));
|
||||||
@ -89,7 +88,7 @@ struct ParamTraits<JSStructuredCloneData> {
|
|||||||
// return a borrowed buffer because the out param outlives the
|
// return a borrowed buffer because the out param outlives the
|
||||||
// IPDL callback.
|
// IPDL callback.
|
||||||
if (length &&
|
if (length &&
|
||||||
!aMsg->ExtractBuffers(aIter, length, &buffers, sizeof(uint64_t))) {
|
!aReader->ExtractBuffers(length, &buffers, sizeof(uint64_t))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,13 +110,12 @@ template <>
|
|||||||
struct ParamTraits<mozilla::SerializedStructuredCloneBuffer> {
|
struct ParamTraits<mozilla::SerializedStructuredCloneBuffer> {
|
||||||
typedef mozilla::SerializedStructuredCloneBuffer paramType;
|
typedef mozilla::SerializedStructuredCloneBuffer paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||||
WriteParam(aMsg, aParam.data);
|
WriteParam(aWriter, aParam.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||||
paramType* aResult) {
|
return ReadParam(aReader, &aResult->data);
|
||||||
return ReadParam(aMsg, aIter, &aResult->data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log(const paramType& aParam, std::wstring* aLog) {
|
static void Log(const paramType& aParam, std::wstring* aLog) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user