Bug 1262671 - void** -> PickleIterator (r=froydnj)

This commit is contained in:
Bill McCloskey 2016-04-20 21:09:15 -07:00
parent 5b7911b430
commit 291c555f34
76 changed files with 366 additions and 367 deletions

View File

@ -78,7 +78,7 @@ struct ParamTraits<SerializedURI>
WriteParam(aMsg, aParam.charset);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsCString spec, charset;
if (ReadParam(aMsg, aIter, &spec) &&
@ -105,7 +105,7 @@ struct ParamTraits<ChromePackage>
WriteParam(aMsg, aParam.flags);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsCString package;
SerializedURI contentBaseURI, localeBaseURI, skinBaseURI;
@ -147,7 +147,7 @@ struct ParamTraits<SubstitutionMapping>
WriteParam(aMsg, aParam.resolvedURI);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsCString scheme, path;
SerializedURI resolvedURI;
@ -183,7 +183,7 @@ struct ParamTraits<OverrideMapping>
WriteParam(aMsg, aParam.overrideURI);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
SerializedURI originalURI;
SerializedURI overrideURI;

View File

@ -76,7 +76,7 @@ struct ParamTraits<SerializedLoadContext>
WriteParam(aMsg, suffix);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsAutoCString suffix;
if (!ReadParam(aMsg, aIter, &aResult->mIsNotNull) ||

View File

@ -1848,7 +1848,7 @@ ParamTraits<Metadata>::Write(Message* aMsg, const paramType& aParam)
}
bool
ParamTraits<Metadata>::Read(const Message* aMsg, void** aIter,
ParamTraits<Metadata>::Read(const Message* aMsg, PickleIterator* aIter,
paramType* aResult)
{
for (unsigned i = 0; i < Metadata::kNumEntries; i++) {
@ -1887,7 +1887,7 @@ ParamTraits<WriteParams>::Write(Message* aMsg, const paramType& aParam)
}
bool
ParamTraits<WriteParams>::Read(const Message* aMsg, void** aIter,
ParamTraits<WriteParams>::Read(const Message* aMsg, PickleIterator* aIter,
paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mSize) &&

View File

@ -169,7 +169,7 @@ struct ParamTraits<mozilla::dom::asmjscache::Metadata>
{
typedef mozilla::dom::asmjscache::Metadata paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
static void Log(const paramType& aParam, std::wstring* aLog);
};
@ -178,7 +178,7 @@ struct ParamTraits<mozilla::dom::asmjscache::WriteParams>
{
typedef mozilla::dom::asmjscache::WriteParams paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
static void Log(const paramType& aParam, std::wstring* aLog);
};

View File

@ -173,7 +173,7 @@ ErrorResult::SerializeMessage(IPC::Message* aMsg) const
}
bool
ErrorResult::DeserializeMessage(const IPC::Message* aMsg, void** aIter)
ErrorResult::DeserializeMessage(const IPC::Message* aMsg, PickleIterator* aIter)
{
using namespace IPC;
nsAutoPtr<Message> readMessage(new Message());
@ -295,7 +295,7 @@ ErrorResult::SerializeDOMExceptionInfo(IPC::Message* aMsg) const
}
bool
ErrorResult::DeserializeDOMExceptionInfo(const IPC::Message* aMsg, void** aIter)
ErrorResult::DeserializeDOMExceptionInfo(const IPC::Message* aMsg, PickleIterator* aIter)
{
using namespace IPC;
nsCString message;

View File

@ -50,7 +50,7 @@ struct ParamTraits<mozilla::ErrorResult>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
paramType readValue;
if (!ReadParam(aMsg, aIter, &readValue.mResult)) {

View File

@ -36,6 +36,7 @@ namespace IPC {
class Message;
template <typename> struct ParamTraits;
} // namespace IPC
class PickleIterator;
namespace mozilla {
@ -307,10 +308,10 @@ private:
friend struct IPC::ParamTraits<ErrorResult>;
void SerializeMessage(IPC::Message* aMsg) const;
bool DeserializeMessage(const IPC::Message* aMsg, void** aIter);
bool DeserializeMessage(const IPC::Message* aMsg, PickleIterator* aIter);
void SerializeDOMExceptionInfo(IPC::Message* aMsg) const;
bool DeserializeDOMExceptionInfo(const IPC::Message* aMsg, void** aIter);
bool DeserializeDOMExceptionInfo(const IPC::Message* aMsg, PickleIterator* aIter);
// Helper method that creates a new Message for this ErrorResult,
// and returns the arguments array from that Message.

View File

@ -24,7 +24,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothAddress>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
for (size_t i = 0; i < MOZ_ARRAY_LENGTH(aResult->mAddr); ++i) {
if (!ReadParam(aMsg, aIter, aResult->mAddr + i)) {
@ -61,7 +61,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothPinCode>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->mLength)) {
return false;
@ -97,7 +97,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothRemoteName>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->mLength)) {
return false;
@ -158,7 +158,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothUuid>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
for (uint8_t i = 0; i < 16; i++) {
if (!ReadParam(aMsg, aIter, &(aResult->mUuid[i]))) {
@ -181,7 +181,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothGattId>
WriteParam(aMsg, aParam.mInstanceId);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mUuid)) ||
!ReadParam(aMsg, aIter, &(aResult->mInstanceId))) {
@ -203,7 +203,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothGattServiceId>
WriteParam(aMsg, aParam.mIsPrimary);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mId)) ||
!ReadParam(aMsg, aIter, &(aResult->mIsPrimary))) {
@ -226,7 +226,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothGattCharAttribute>
WriteParam(aMsg, aParam.mWriteType);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mId)) ||
!ReadParam(aMsg, aIter, &(aResult->mProperties)) ||
@ -248,7 +248,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothAttributeHandle>
WriteParam(aMsg, aParam.mHandle);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mHandle))) {
return false;
@ -279,7 +279,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothGattResponse>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mHandle)) ||
!ReadParam(aMsg, aIter, &(aResult->mOffset)) ||
@ -312,7 +312,7 @@ struct ParamTraits<mozilla::dom::bluetooth::ControlPlayStatus>
WriteParam(aMsg, static_cast<uint8_t>(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint8_t value;
if (!ReadParam(aMsg, aIter, &value)) {
@ -352,7 +352,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothGattAdvertisingData>
WriteParam(aMsg, aParam.mServiceUuids);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mAppearance)) ||
!ReadParam(aMsg, aIter, &(aResult->mIncludeDevName)) ||

View File

@ -1169,7 +1169,7 @@ Event::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
}
NS_IMETHODIMP_(bool)
Event::Deserialize(const IPC::Message* aMsg, void** aIter)
Event::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
{
nsString type;
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &type), false);

View File

@ -140,7 +140,7 @@ NotifyPaintEvent::Serialize(IPC::Message* aMsg,
}
NS_IMETHODIMP_(bool)
NotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
NotifyPaintEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
{
NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);

View File

@ -43,7 +43,7 @@ public:
return Event::DuplicatePrivateData();
}
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) override;
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
{

View File

@ -60,7 +60,7 @@ ScrollAreaEvent::Serialize(IPC::Message* aMsg,
}
NS_IMETHODIMP_(bool)
ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
{
NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);

View File

@ -33,7 +33,7 @@ public:
return Event::DuplicatePrivateData();
}
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) override;
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
{

View File

@ -398,7 +398,7 @@ UIEvent::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
}
NS_IMETHODIMP_(bool)
UIEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
UIEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
{
NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &mDetail), false);

View File

@ -38,7 +38,7 @@ public:
NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
NS_IMETHOD DuplicatePrivateData() override;
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) override;
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
static already_AddRefed<UIEvent> Constructor(const GlobalObject& aGlobal,
@ -139,7 +139,7 @@ protected:
UIEvent::Serialize(aMsg, aSerializeInterfaceType); \
} \
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, \
void** aIter) override \
PickleIterator* aIter) override \
{ \
return UIEvent::Deserialize(aMsg, aIter); \
}

View File

@ -53,7 +53,7 @@ struct ParamTraits<nsIDOMGeoPositionCoords*>
}
// Function to de-serialize a geoposition
static bool Read(const Message* aMsg, void **aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if it is the null pointer we have transfered
bool isNull;
@ -119,7 +119,7 @@ struct ParamTraits<nsIDOMGeoPosition*>
}
// Function to de-serialize a geoposition
static bool Read(const Message* aMsg, void **aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if it is the null pointer we have transfered
bool isNull;

View File

@ -26,7 +26,7 @@ struct ParamTraits<mozilla::dom::indexedDB::Key>
WriteParam(aMsg, aParam.mBuffer);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mBuffer);
}
@ -55,7 +55,7 @@ struct ParamTraits<mozilla::dom::indexedDB::KeyPath>
WriteParam(aMsg, aParam.mStrings);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mType) &&
ReadParam(aMsg, aIter, &aResult->mStrings);

View File

@ -11,6 +11,7 @@ interface nsIDOMEventTarget;
[ptr] native DOMEventPtr(mozilla::dom::Event);
[ptr] native IPCMessagePtr(IPC::Message);
[ptr] native ConstIPCMessagePtr(const IPC::Message);
[ptr] native PickleIterator(PickleIterator);
[ptr] native EventTargetPtr(mozilla::dom::EventTarget);
%{C++
#ifdef ERROR
@ -23,6 +24,7 @@ class nsInvalidateRequestList;
namespace IPC {
class Message;
}
class PickleIterator;
namespace mozilla {
namespace dom {
class Event;
@ -211,7 +213,7 @@ interface nsIDOMEvent : nsISupports
[noscript,notxpcom] void SetTrusted(in boolean aTrusted);
[notxpcom] void Serialize(in IPCMessagePtr aMsg,
in boolean aSerializeInterfaceType);
[notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, out voidPtr aIter);
[notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, in PickleIterator aIter);
[noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner);
[notxpcom] DOMEventPtr InternalDOMEvent();
[noscript] void stopCrossProcessForwarding();

View File

@ -62,7 +62,7 @@ struct ParamTraits<mozilla::dom::IdType<T>>
WriteParam(aMsg, aParam.mId);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mId);
}

View File

@ -37,7 +37,7 @@ ParamTraits<Principal>::Write(Message* aMsg, const paramType& aParam) {
}
bool
ParamTraits<Principal>::Read(const Message* aMsg, void** aIter, paramType* aResult)
ParamTraits<Principal>::Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool isNull;
if (!ReadParam(aMsg, aIter, &isNull)) {

View File

@ -39,7 +39,7 @@ struct ParamTraits<Principal>
{
typedef Principal paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};
} // namespace IPC

View File

@ -105,7 +105,7 @@ StructuredCloneData::WriteIPCParams(IPC::Message* aMsg) const
bool
StructuredCloneData::ReadIPCParams(const IPC::Message* aMsg,
void** aIter)
PickleIterator* aIter)
{
MOZ_ASSERT(!Data());

View File

@ -15,6 +15,7 @@
namespace IPC {
class Message;
}
class PickleIterator;
namespace mozilla {
namespace dom {
@ -137,7 +138,7 @@ public:
// For IPC serialization
void WriteIPCParams(IPC::Message* aMessage) const;
bool ReadIPCParams(const IPC::Message* aMessage, void** aIter);
bool ReadIPCParams(const IPC::Message* aMessage, PickleIterator* aIter);
private:
uint64_t* MOZ_NON_OWNING_REF mExternalData;

View File

@ -13,7 +13,7 @@ namespace mozilla {
namespace dom {
bool
ReadRemoteEvent(const IPC::Message* aMsg, void** aIter,
ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
RemoteDOMEvent* aResult)
{
aResult->mEvent = nullptr;

View File

@ -24,7 +24,7 @@ struct RemoteDOMEvent
nsCOMPtr<nsIDOMEvent> mEvent;
};
bool ReadRemoteEvent(const IPC::Message* aMsg, void** aIter,
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
mozilla::dom::RemoteDOMEvent* aResult);
#ifdef MOZ_CRASHREPORTER
@ -49,7 +49,7 @@ struct ParamTraits<mozilla::dom::RemoteDOMEvent>
aParam.mEvent->Serialize(aMsg, true);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return mozilla::dom::ReadRemoteEvent(aMsg, aIter, aResult);
}
@ -75,7 +75,7 @@ struct ParamTraits<mozilla::dom::AudioChannel>
WriteParam(aMsg, (uint32_t)aValue);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint32_t value;
if(!ReadParam(aMsg, aIter, &value) ||

View File

@ -132,7 +132,7 @@ struct ParamTraits<GMPSimulcastStream>
WriteParam(aMsg, aParam.mQPMax);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (ReadParam(aMsg, aIter, &(aResult->mWidth)) &&
ReadParam(aMsg, aIter, &(aResult->mHeight)) &&
@ -181,7 +181,7 @@ struct ParamTraits<GMPVideoCodec>
WriteParam(aMsg, aParam.mMode);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
// NOTE: make sure this matches any versions supported
if (!ReadParam(aMsg, aIter, &(aResult->mGMPApiVersion)) ||

View File

@ -31,7 +31,7 @@ struct ParamTraits<mozilla::dom::Optional<T>>
WriteParam(aMsg, false);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool was_passed = false;
@ -61,7 +61,7 @@ struct ParamTraits<mozilla::dom::Sequence<T>>
WriteParam(aMsg, static_cast<const FallibleTArray<T>&>(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, dynamic_cast<FallibleTArray<T>*>(aResult));
}
@ -114,7 +114,7 @@ struct ParamTraits<mozilla::dom::RTCStatsReportInternal>
WriteParam(aMsg, aParam.mTransportStats);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mClosed)) ||
!ReadParam(aMsg, aIter, &(aResult->mCodecStats)) ||
@ -147,7 +147,7 @@ static void WriteRTCStats(Message* aMsg, const RTCStats& aParam)
WriteParam(aMsg, aParam.mType);
}
static bool ReadRTCStats(const Message* aMsg, void** aIter, RTCStats* aResult)
static bool ReadRTCStats(const Message* aMsg, PickleIterator* aIter, RTCStats* aResult)
{
// RTCStats base class
if (!ReadParam(aMsg, aIter, &(aResult->mId)) ||
@ -174,7 +174,7 @@ struct ParamTraits<mozilla::dom::RTCCodecStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mChannels)) ||
!ReadParam(aMsg, aIter, &(aResult->mClockRate)) ||
@ -207,7 +207,7 @@ struct ParamTraits<mozilla::dom::RTCIceCandidatePairStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mComponentId)) ||
!ReadParam(aMsg, aIter, &(aResult->mLocalCandidateId)) ||
@ -242,7 +242,7 @@ struct ParamTraits<mozilla::dom::RTCIceCandidateStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mCandidateId)) ||
!ReadParam(aMsg, aIter, &(aResult->mCandidateType)) ||
@ -274,7 +274,7 @@ struct ParamTraits<mozilla::dom::RTCIceComponentStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mActiveConnection)) ||
!ReadParam(aMsg, aIter, &(aResult->mBytesReceived)) ||
@ -307,7 +307,7 @@ static void WriteRTCRTPStreamStats(
}
static bool ReadRTCRTPStreamStats(
const Message* aMsg, void** aIter,
const Message* aMsg, PickleIterator* aIter,
mozilla::dom::RTCRTPStreamStats* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mBitrateMean)) ||
@ -346,7 +346,7 @@ struct ParamTraits<mozilla::dom::RTCInboundRTPStreamStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mBytesReceived)) ||
!ReadParam(aMsg, aIter, &(aResult->mDiscardedPackets)) ||
@ -380,7 +380,7 @@ struct ParamTraits<mozilla::dom::RTCOutboundRTPStreamStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mBytesSent)) ||
!ReadParam(aMsg, aIter, &(aResult->mDroppedFrames)) ||
@ -407,7 +407,7 @@ struct ParamTraits<mozilla::dom::RTCMediaStreamStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mStreamIdentifier)) ||
!ReadParam(aMsg, aIter, &(aResult->mTrackIds)) ||
@ -431,7 +431,7 @@ struct ParamTraits<mozilla::dom::RTCTransportStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mBytesReceived)) ||
!ReadParam(aMsg, aIter, &(aResult->mBytesSent)) ||
@ -467,7 +467,7 @@ struct ParamTraits<mozilla::dom::RTCMediaStreamTrackStats>
WriteRTCStats(aMsg, aParam);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mAudioLevel)) ||
!ReadParam(aMsg, aIter, &(aResult->mEchoReturnLoss)) ||

View File

@ -97,7 +97,7 @@ struct ParamTraits<nsIMobileCallForwardingOptions*>
}
// Function to de-serialize a MobileCallForwardingOptions.
static bool Read(const Message *aMsg, void **aIter, paramType* aResult)
static bool Read(const Message *aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if is the null pointer we have transfered.
bool isNull;
@ -176,7 +176,7 @@ struct ParamTraits<nsIMobileNetworkInfo*>
}
// Function to de-serialize a MobileNetworkInfo.
static bool Read(const Message *aMsg, void **aIter, paramType* aResult)
static bool Read(const Message *aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if is the null pointer we have transfered.
bool isNull;
@ -263,7 +263,7 @@ struct ParamTraits<nsIMobileCellInfo*>
}
// Function to de-serialize a MobileCellInfo.
static bool Read(const Message *aMsg, void **aIter, paramType* aResult)
static bool Read(const Message *aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if is the null pointer we have transfered.
bool isNull;
@ -378,7 +378,7 @@ struct ParamTraits<nsIMobileConnectionInfo*>
}
// Function to de-serialize a MobileConectionInfo.
static bool Read(const Message* aMsg, void **aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if is the null pointer we have transfered.
bool isNull;
@ -541,7 +541,7 @@ struct ParamTraits<MozCallForwardingOptions>
}
// Function to de-serialize a MozCallForwardingOptions.
static bool Read(const Message *aMsg, void **aIter, paramType* aResult)
static bool Read(const Message *aMsg, PickleIterator* aIter, paramType* aResult)
{
bool wasPassed = false;
bool isNull = false;

View File

@ -37,7 +37,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent>
aMsg->WriteBytes(&aParam, sizeof(paramType));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* bytes = 0;

View File

@ -82,7 +82,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent>
aMsg->WriteDouble(aParam.contentsScaleFactor);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int type = 0;
if (!aMsg->ReadInt(aIter, &type)) {

View File

@ -55,7 +55,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent> // synonym for XEvent
aMsg->WriteBytes(&aParam, sizeof(paramType));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* bytes = 0;

View File

@ -130,7 +130,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteEvent>
aMsg->WriteBytes(&paramCopy, sizeof(paramType));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* bytes = 0;

View File

@ -280,7 +280,7 @@ struct ParamTraits<NPRect>
WriteParam(aMsg, aParam.right);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint16_t top, left, bottom, right;
if (ReadParam(aMsg, aIter, &top) &&
@ -313,7 +313,7 @@ struct ParamTraits<NPWindowType>
aMsg->WriteInt16(int16_t(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int16_t result;
if (aMsg->ReadInt16(aIter, &result)) {
@ -352,7 +352,7 @@ struct ParamTraits<mozilla::plugins::NPRemoteWindow>
#endif
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint64_t window;
int32_t x, y;
@ -443,7 +443,7 @@ struct ParamTraits<NPNSString*>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool haveString = false;
if (!aMsg->ReadBool(aIter, &haveString)) {
@ -507,7 +507,7 @@ struct ParamTraits<NSCursorInfo>
free(buffer);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
NSCursorInfo::Type type;
if (!aMsg->ReadInt(aIter, (int*)&type)) {
@ -566,7 +566,7 @@ struct ParamTraits<NSCursorInfo>
static void Write(Message* aMsg, const paramType& aParam) {
NS_RUNTIMEABORT("NSCursorInfo isn't meaningful on this platform");
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
NS_RUNTIMEABORT("NSCursorInfo isn't meaningful on this platform");
return false;
}
@ -584,7 +584,7 @@ struct ParamTraits<mozilla::plugins::IPCByteRange>
WriteParam(aMsg, aParam.length);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
paramType p;
if (ReadParam(aMsg, aIter, &p.offset) &&
@ -606,7 +606,7 @@ struct ParamTraits<NPNVariable>
WriteParam(aMsg, int(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int intval;
if (ReadParam(aMsg, aIter, &intval)) {
@ -627,7 +627,7 @@ struct ParamTraits<NPNURLVariable>
WriteParam(aMsg, int(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int intval;
if (ReadParam(aMsg, aIter, &intval)) {
@ -653,7 +653,7 @@ struct ParamTraits<NPCoordinateSpace>
WriteParam(aMsg, int32_t(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int32_t intval;
if (ReadParam(aMsg, aIter, &intval)) {

View File

@ -83,7 +83,7 @@ struct ParamTraits<nsITelephonyCallInfo*>
WriteParam(aMsg, isMergeable);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
// Check if is the null pointer we have transfered.
bool isNull;

View File

@ -53,7 +53,7 @@ ParamTraits<DxgiAdapterDesc>::Write(Message* aMsg, const paramType& aParam)
}
bool
ParamTraits<DxgiAdapterDesc>::Read(const Message* aMsg, void** aIter, paramType* aResult)
ParamTraits<DxgiAdapterDesc>::Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
#if defined(XP_WIN)
const char* description = nullptr;

View File

@ -40,7 +40,7 @@ struct ParamTraits<DxgiAdapterDesc>
{
typedef DxgiAdapterDesc paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};
} // namespace IPC

View File

@ -54,7 +54,7 @@ struct ParamTraits<mozilla::gfx::Matrix>
WriteParam(aMsg, aParam._32);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (ReadParam(aMsg, aIter, &aResult->_11) &&
ReadParam(aMsg, aIter, &aResult->_12) &&
@ -89,7 +89,7 @@ struct ParamTraits<mozilla::gfx::Matrix4x4>
#undef Wr
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
#define Rd(_f) ReadParam(msg, iter, &result-> _f)
return (Rd(_11) && Rd(_12) && Rd(_13) && Rd(_14) &&
@ -116,7 +116,7 @@ struct ParamTraits<mozilla::gfx::Matrix5x4>
#undef Wr
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
#define Rd(_f) ReadParam(msg, iter, &result-> _f)
return (Rd(_11) && Rd(_12) && Rd(_13) && Rd(_14) &&
@ -139,7 +139,7 @@ struct ParamTraits<gfxPoint>
WriteParam(aMsg, aParam.y);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->x) &&
ReadParam(aMsg, aIter, &aResult->y));
@ -157,7 +157,7 @@ struct ParamTraits<gfxSize>
WriteParam(aMsg, aParam.height);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (ReadParam(aMsg, aIter, &aResult->width) &&
ReadParam(aMsg, aIter, &aResult->height))
@ -180,7 +180,7 @@ struct ParamTraits<gfxRect>
WriteParam(aMsg, aParam.height);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->x) &&
ReadParam(aMsg, aIter, &aResult->y) &&
@ -297,7 +297,7 @@ struct ParamTraits<mozilla::gfx::Color>
WriteParam(msg, param.a);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->r) &&
ReadParam(msg, iter, &result->g) &&
@ -317,7 +317,7 @@ struct ParamTraits<nsPoint>
WriteParam(msg, param.y);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y));
@ -335,7 +335,7 @@ struct ParamTraits<nsIntPoint>
WriteParam(msg, param.y);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y));
@ -353,7 +353,7 @@ struct ParamTraits<mozilla::gfx::IntSizeTyped<T> >
WriteParam(msg, param.height);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->width) &&
ReadParam(msg, iter, &result->height));
@ -378,7 +378,7 @@ struct RegionParamTraits
WriteParam(msg, Rect());
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
RegionBuilder<Region> builder;
Rect rect;
@ -412,7 +412,7 @@ struct ParamTraits<mozilla::gfx::IntSize>
WriteParam(msg, param.height);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->width) &&
ReadParam(msg, iter, &result->height));
@ -429,7 +429,7 @@ struct ParamTraits< mozilla::gfx::CoordTyped<T> >
WriteParam(msg, param.value);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->value));
}
@ -445,7 +445,7 @@ struct ParamTraits< mozilla::gfx::IntCoordTyped<T> >
WriteParam(msg, param.value);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->value));
}
@ -461,7 +461,7 @@ struct ParamTraits< mozilla::gfx::ScaleFactor<T, U> >
WriteParam(msg, param.scale);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->scale));
}
@ -478,7 +478,7 @@ struct ParamTraits< mozilla::gfx::ScaleFactors2D<T, U> >
WriteParam(msg, param.yScale);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->xScale) &&
ReadParam(msg, iter, &result->yScale));
@ -496,7 +496,7 @@ struct ParamTraits< mozilla::gfx::PointTyped<T> >
WriteParam(msg, param.y);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y));
@ -515,7 +515,7 @@ struct ParamTraits< mozilla::gfx::Point3DTyped<F, T> >
WriteParam(msg, param.z);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y) &&
@ -534,7 +534,7 @@ struct ParamTraits< mozilla::gfx::IntPointTyped<T> >
WriteParam(msg, param.y);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y));
@ -552,7 +552,7 @@ struct ParamTraits< mozilla::gfx::SizeTyped<T> >
WriteParam(msg, param.height);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->width) &&
ReadParam(msg, iter, &result->height));
@ -572,7 +572,7 @@ struct ParamTraits< mozilla::gfx::RectTyped<T> >
WriteParam(msg, param.height);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y) &&
@ -594,7 +594,7 @@ struct ParamTraits< mozilla::gfx::IntRectTyped<T> >
WriteParam(msg, param.height);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y) &&
@ -616,7 +616,7 @@ struct ParamTraits<mozilla::gfx::Margin>
WriteParam(msg, param.left);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->top) &&
ReadParam(msg, iter, &result->right) &&
@ -638,7 +638,7 @@ struct ParamTraits< mozilla::gfx::MarginTyped<T> >
WriteParam(msg, param.left);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->top) &&
ReadParam(msg, iter, &result->right) &&
@ -660,7 +660,7 @@ struct ParamTraits<nsRect>
WriteParam(msg, param.height);
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y) &&
@ -690,7 +690,7 @@ struct BitfieldHelper
// 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
// and set the bitfield using a setter function
static bool ReadBoolForBitfield(const Message* aMsg, void** aIter,
static bool ReadBoolForBitfield(const Message* aMsg, PickleIterator* aIter,
ParamType* aResult, void (ParamType::*aSetter)(bool))
{
bool value;
@ -735,7 +735,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
WriteParam(aMsg, aParam.mIsScrollInfoLayer);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mScrollId) &&
ReadParam(aMsg, aIter, &aResult->mPresShellResolution) &&
@ -778,7 +778,7 @@ struct ParamTraits<mozilla::layers::ScrollSnapInfo>
WriteParam(aMsg, aParam.mScrollSnapCoordinates);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mScrollSnapTypeX) &&
ReadParam(aMsg, aIter, &aResult->mScrollSnapTypeY) &&
@ -800,7 +800,7 @@ struct ParamTraits<mozilla::layers::LayerClip>
WriteParam(aMsg, aParam.mMaskLayerIndex);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mClipRect) &&
ReadParam(aMsg, aIter, &aResult->mMaskLayerIndex));
@ -830,7 +830,7 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
WriteParam(aMsg, aParam.mForceDisableApz);
}
static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult)
static bool ReadContentDescription(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsCString str;
if (!ReadParam(aMsg, aIter, &str)) {
@ -840,7 +840,7 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
return true;
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mMetrics) &&
ReadParam(aMsg, aIter, &aResult->mSnapInfo) &&
@ -872,7 +872,7 @@ struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
WriteParam(aMsg, aParam.mSyncHandle);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool result = ReadParam(aMsg, aIter, &aResult->mParentBackend) &&
ReadParam(aMsg, aIter, &aResult->mMaxTextureSize) &&
@ -894,7 +894,7 @@ struct ParamTraits<mozilla::layers::TextureInfo>
WriteParam(aMsg, aParam.mTextureFlags);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mCompositableType) &&
ReadParam(aMsg, aIter, &aResult->mTextureFlags);
@ -937,7 +937,7 @@ struct ParamTraits<mozilla::layers::ScrollableLayerGuid>
WriteParam(aMsg, aParam.mScrollId);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mLayersId) &&
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
@ -959,7 +959,7 @@ struct ParamTraits<mozilla::layers::ZoomConstraints>
WriteParam(aMsg, aParam.mMaxZoom);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mAllowZoom) &&
ReadParam(aMsg, aIter, &aResult->mAllowDoubleTapZoom) &&
@ -982,7 +982,7 @@ struct ParamTraits<mozilla::layers::EventRegions>
WriteParam(aMsg, aParam.mVerticalPanRegion);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mHitRegion) &&
ReadParam(aMsg, aIter, &aResult->mDispatchToContentHitRegion) &&
@ -1037,7 +1037,7 @@ struct ParamTraits<mozilla::gfx::AttributeMap>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint32_t count;
if (!ReadParam(aMsg, aIter, &count)) {
@ -1116,7 +1116,7 @@ struct ParamTraits<mozilla::gfx::FilterPrimitiveDescription>
WriteParam(aMsg, aParam.Attributes());
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
mozilla::gfx::PrimitiveType type;
mozilla::gfx::IntRect primitiveSubregion;
@ -1164,7 +1164,7 @@ struct ParamTraits<mozilla::gfx::FilterDescription>
WriteParam(aMsg, aParam.mPrimitives);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mPrimitives));
}
@ -1210,7 +1210,7 @@ struct ParamTraits<mozilla::layers::AsyncDragMetrics>
WriteParam(aMsg, aParam.mDirection);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mViewId) &&
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&

View File

@ -143,7 +143,7 @@ struct ParamTraits<mozilla::layers::APZTestData>
WriteParam(aMsg, aParam.mRepaintRequests);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mPaints) &&
ReadParam(aMsg, aIter, &aResult->mRepaintRequests));

View File

@ -62,7 +62,7 @@ struct ParamTraits<mozilla::layers::FrameUniformityData>
WriteParam(aMsg, aParam.mUniformities);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ParamTraitsStd<std::map<uintptr_t,float>>::Read(aMsg, aIter, &aResult->mUniformities);
}

View File

@ -33,7 +33,7 @@ ParamTraits<FenceHandle>::Write(Message* aMsg,
bool
ParamTraits<FenceHandle>::Read(const Message* aMsg,
void** aIter, paramType* aResult)
PickleIterator* aIter, paramType* aResult)
{
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
base::FileDescriptor fd;

View File

@ -76,7 +76,7 @@ struct ParamTraits<mozilla::layers::FenceHandle> {
typedef mozilla::layers::FenceHandle paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};
} // namespace IPC

View File

@ -32,7 +32,7 @@ ParamTraits<GonkNativeHandle>::Write(Message* aMsg,
bool
ParamTraits<GonkNativeHandle>::Read(const Message* aMsg,
void** aIter, paramType* aResult)
PickleIterator* aIter, paramType* aResult)
{
size_t nbytes;
const char* data;

View File

@ -20,14 +20,14 @@ struct ParamTraits<mozilla::layers::GonkNativeHandle> {
typedef mozilla::layers::GonkNativeHandle paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};
#else
template <>
struct ParamTraits<mozilla::layers::GonkNativeHandle> {
typedef mozilla::layers::GonkNativeHandle paramType;
static void Write(Message*, const paramType&) {}
static bool Read(const Message*, void**, paramType*) { return false; }
static bool Read(const Message*, PickleIterator*, paramType*) { return false; }
};
#endif

View File

@ -50,7 +50,7 @@ template <>
struct ParamTraits<mozilla::layers::SurfaceDescriptorX11> {
typedef mozilla::layers::SurfaceDescriptorX11 paramType;
static void Write(Message*, const paramType&) {}
static bool Read(const Message*, void**, paramType*) { return false; }
static bool Read(const Message*, PickleIterator*, paramType*) { return false; }
};
#endif // !defined(MOZ_HAVE_XSURFACEDESCRIPTORX11)
@ -59,14 +59,14 @@ template <>
struct ParamTraits<mozilla::layers::MagicGrallocBufferHandle> {
typedef mozilla::layers::MagicGrallocBufferHandle paramType;
static void Write(Message*, const paramType&) {}
static bool Read(const Message*, void**, paramType*) { return false; }
static bool Read(const Message*, PickleIterator*, paramType*) { return false; }
};
template <>
struct ParamTraits<mozilla::layers::GrallocBufferRef> {
typedef mozilla::layers::GrallocBufferRef paramType;
static void Write(Message*, const paramType&) {}
static bool Read(const Message*, void**, paramType*) { return false; }
static bool Read(const Message*, PickleIterator*, paramType*) { return false; }
};
#endif // !defined(MOZ_HAVE_XSURFACEDESCRIPTORGRALLOC)

View File

@ -49,7 +49,7 @@ ParamTraits<GrallocBufferRef>::Write(Message* aMsg,
}
bool
ParamTraits<GrallocBufferRef>::Read(const Message* aMsg, void** aIter,
ParamTraits<GrallocBufferRef>::Read(const Message* aMsg, PickleIterator* aIter,
paramType* aParam)
{
int owner;
@ -109,7 +109,7 @@ ParamTraits<MagicGrallocBufferHandle>::Write(Message* aMsg,
bool
ParamTraits<MagicGrallocBufferHandle>::Read(const Message* aMsg,
void** aIter, paramType* aResult)
PickleIterator* aIter, paramType* aResult)
{
MOZ_ASSERT(!aResult->mGraphicBuffer.get());
MOZ_ASSERT(aResult->mRef.mOwner == 0);

View File

@ -79,14 +79,14 @@ struct ParamTraits<mozilla::layers::MagicGrallocBufferHandle> {
typedef mozilla::layers::MagicGrallocBufferHandle paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};
template<>
struct ParamTraits<mozilla::layers::GrallocBufferRef> {
typedef mozilla::layers::GrallocBufferRef paramType;
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};

View File

@ -71,7 +71,7 @@ struct ParamTraits<mozilla::layers::SurfaceDescriptorX11> {
WriteParam(aMsg, aParam.mGLXPixmap);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
return (ReadParam(aMsg, aIter, &aResult->mId) &&
ReadParam(aMsg, aIter, &aResult->mSize) &&
ReadParam(aMsg, aIter, &aResult->mFormat) &&

View File

@ -37,7 +37,7 @@ struct ParamTraits<mozilla::gfx::VRDeviceUpdate>
WriteParam(aMsg, aParam.mSensorState);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mDeviceInfo)) ||
!ReadParam(aMsg, aIter, &(aResult->mSensorState))) {
@ -58,7 +58,7 @@ struct ParamTraits<mozilla::gfx::VRSensorUpdate>
WriteParam(aMsg, aParam.mSensorState);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mDeviceID)) ||
!ReadParam(aMsg, aIter, &(aResult->mSensorState))) {
@ -92,7 +92,7 @@ struct ParamTraits<mozilla::gfx::VRDeviceInfo>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->mType)) ||
!ReadParam(aMsg, aIter, &(aResult->mDeviceID)) ||
@ -150,7 +150,7 @@ struct ParamTraits<mozilla::gfx::VRHMDSensorState>
WriteParam(aMsg, aParam.linearAcceleration[2]);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->timestamp)) ||
!ReadParam(aMsg, aIter, &(aResult->inputFrameID)) ||
@ -193,7 +193,7 @@ struct ParamTraits<mozilla::gfx::VRFieldOfView>
WriteParam(aMsg, aParam.leftDegrees);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &(aResult->upDegrees)) ||
!ReadParam(aMsg, aIter, &(aResult->rightDegrees)) ||

View File

@ -275,7 +275,7 @@ bool Histogram::DeserializeHistogramInfo(const std::string& histogram_info) {
int pickle_flags;
SampleSet sample;
void* iter = NULL;
PickleIterator iter(pickle);
if (!pickle.ReadString(&iter, &histogram_name) ||
!pickle.ReadInt(&iter, &declared_min) ||
!pickle.ReadInt(&iter, &declared_max) ||
@ -786,7 +786,7 @@ bool Histogram::SampleSet::Serialize(Pickle* pickle) const {
return true;
}
bool Histogram::SampleSet::Deserialize(void** iter, const Pickle& pickle) {
bool Histogram::SampleSet::Deserialize(PickleIterator* iter, const Pickle& pickle) {
OffTheBooksMutexAutoLock locker(mutex_);
DCHECK_EQ(counts_.size(), 0u);
DCHECK_EQ(sum_, 0);

View File

@ -55,6 +55,7 @@
#include "base/lock.h"
class Pickle;
class PickleIterator;
namespace base {
@ -361,7 +362,7 @@ class Histogram {
void Add(const SampleSet& other);
bool Serialize(Pickle* pickle) const;
bool Deserialize(void** iter, const Pickle& pickle);
bool Deserialize(PickleIterator* iter, const Pickle& pickle);
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf);

View File

@ -93,13 +93,18 @@ struct Copier<T, size, true>
}
};
} // anonymous namespace
template<typename T>
void CopyFromIter(T* dest, void** iter) {
void
PickleIterator::CopyFrom(T* dest) {
static_assert(mozilla::IsPod<T>::value, "Copied type must be a POD type");
Copier<T, sizeof(T), (MOZ_ALIGNOF(T) <= sizeof(Pickle::memberAlignmentType))>::Copy(dest, iter);
Copier<T, sizeof(T), (MOZ_ALIGNOF(T) <= sizeof(Pickle::memberAlignmentType))>::Copy(dest, &iter_);
}
} // anonymous namespace
PickleIterator::PickleIterator(const Pickle& pickle)
: iter_(const_cast<char*>(pickle.payload())) {
}
// Payload is sizeof(Pickle::memberAlignmentType) aligned.
@ -168,7 +173,7 @@ Pickle& Pickle::operator=(Pickle&& other) {
return *this;
}
bool Pickle::ReadBool(void** iter, bool* result) const {
bool Pickle::ReadBool(PickleIterator* iter, bool* result) const {
DCHECK(iter);
int tmp;
@ -179,43 +184,37 @@ bool Pickle::ReadBool(void** iter, bool* result) const {
return true;
}
bool Pickle::ReadInt16(void** iter, int16_t* result) const {
bool Pickle::ReadInt16(PickleIterator* iter, int16_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadUInt16(void** iter, uint16_t* result) const {
bool Pickle::ReadUInt16(PickleIterator* iter, uint16_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadInt(void** iter, int* result) const {
bool Pickle::ReadInt(PickleIterator* iter, int* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
@ -223,16 +222,14 @@ bool Pickle::ReadInt(void** iter, int* result) const {
// Always written as a 64-bit value since the size for this type can
// differ between architectures.
bool Pickle::ReadLong(void** iter, long* result) const {
bool Pickle::ReadLong(PickleIterator* iter, long* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
int64_t bigResult = 0;
if (!IteratorHasRoomFor(*iter, sizeof(bigResult)))
return false;
CopyFromIter(&bigResult, iter);
iter->CopyFrom(&bigResult);
DCHECK(bigResult <= LONG_MAX && bigResult >= LONG_MIN);
*result = static_cast<long>(bigResult);
@ -242,16 +239,14 @@ bool Pickle::ReadLong(void** iter, long* result) const {
// Always written as a 64-bit value since the size for this type can
// differ between architectures.
bool Pickle::ReadULong(void** iter, unsigned long* result) const {
bool Pickle::ReadULong(PickleIterator* iter, unsigned long* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
uint64_t bigResult = 0;
if (!IteratorHasRoomFor(*iter, sizeof(bigResult)))
return false;
CopyFromIter(&bigResult, iter);
iter->CopyFrom(&bigResult);
DCHECK(bigResult <= ULONG_MAX);
*result = static_cast<unsigned long>(bigResult);
@ -259,7 +254,7 @@ bool Pickle::ReadULong(void** iter, unsigned long* result) const {
return true;
}
bool Pickle::ReadLength(void** iter, int* result) const {
bool Pickle::ReadLength(PickleIterator* iter, int* result) const {
if (!ReadInt(iter, result))
return false;
return ((*result) >= 0);
@ -267,16 +262,14 @@ bool Pickle::ReadLength(void** iter, int* result) const {
// Always written as a 64-bit value since the size for this type can
// differ between architectures.
bool Pickle::ReadSize(void** iter, size_t* result) const {
bool Pickle::ReadSize(PickleIterator* iter, size_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
uint64_t bigResult = 0;
if (!IteratorHasRoomFor(*iter, sizeof(bigResult)))
return false;
CopyFromIter(&bigResult, iter);
iter->CopyFrom(&bigResult);
DCHECK(bigResult <= std::numeric_limits<size_t>::max());
*result = static_cast<size_t>(bigResult);
@ -284,71 +277,61 @@ bool Pickle::ReadSize(void** iter, size_t* result) const {
return true;
}
bool Pickle::ReadInt32(void** iter, int32_t* result) const {
bool Pickle::ReadInt32(PickleIterator* iter, int32_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadUInt32(void** iter, uint32_t* result) const {
bool Pickle::ReadUInt32(PickleIterator* iter, uint32_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadInt64(void** iter, int64_t* result) const {
bool Pickle::ReadInt64(PickleIterator* iter, int64_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadUInt64(void** iter, uint64_t* result) const {
bool Pickle::ReadUInt64(PickleIterator* iter, uint64_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadDouble(void** iter, double* result) const {
bool Pickle::ReadDouble(PickleIterator* iter, double* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
@ -356,16 +339,14 @@ bool Pickle::ReadDouble(void** iter, double* result) const {
// Always written as a 64-bit value since the size for this type can
// differ between architectures.
bool Pickle::ReadIntPtr(void** iter, intptr_t* result) const {
bool Pickle::ReadIntPtr(PickleIterator* iter, intptr_t* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
int64_t bigResult = 0;
if (!IteratorHasRoomFor(*iter, sizeof(bigResult)))
return false;
CopyFromIter(&bigResult, iter);
iter->CopyFrom(&bigResult);
DCHECK(bigResult <= std::numeric_limits<intptr_t>::max() && bigResult >= std::numeric_limits<intptr_t>::min());
*result = static_cast<intptr_t>(bigResult);
@ -373,24 +354,20 @@ bool Pickle::ReadIntPtr(void** iter, intptr_t* result) const {
return true;
}
bool Pickle::ReadUnsignedChar(void** iter, unsigned char* result) const {
bool Pickle::ReadUnsignedChar(PickleIterator* iter, unsigned char* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!IteratorHasRoomFor(*iter, sizeof(*result)))
return false;
CopyFromIter(result, iter);
iter->CopyFrom(result);
UpdateIter(iter, sizeof(*result));
return true;
}
bool Pickle::ReadString(void** iter, std::string* result) const {
bool Pickle::ReadString(PickleIterator* iter, std::string* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
int len;
if (!ReadLength(iter, &len))
@ -398,17 +375,15 @@ bool Pickle::ReadString(void** iter, std::string* result) const {
if (!IteratorHasRoomFor(*iter, len))
return false;
char* chars = reinterpret_cast<char*>(*iter);
char* chars = reinterpret_cast<char*>(iter->iter_);
result->assign(chars, len);
UpdateIter(iter, len);
return true;
}
bool Pickle::ReadWString(void** iter, std::wstring* result) const {
bool Pickle::ReadWString(PickleIterator* iter, std::wstring* result) const {
DCHECK(iter);
if (!*iter)
*iter = const_cast<char*>(payload());
int len;
if (!ReadLength(iter, &len))
@ -419,28 +394,25 @@ bool Pickle::ReadWString(void** iter, std::wstring* result) const {
if (!IteratorHasRoomFor(*iter, len * sizeof(wchar_t)))
return false;
wchar_t* chars = reinterpret_cast<wchar_t*>(*iter);
wchar_t* chars = reinterpret_cast<wchar_t*>(iter->iter_);
result->assign(chars, len);
UpdateIter(iter, len * sizeof(wchar_t));
return true;
}
bool Pickle::ReadBytes(void** iter, const char** data, int length,
bool Pickle::ReadBytes(PickleIterator* iter, const char** data, int length,
uint32_t alignment) const {
DCHECK(iter);
DCHECK(data);
DCHECK(alignment == 4 || alignment == 8);
DCHECK(intptr_t(header_) % alignment == 0);
if (!*iter)
*iter = const_cast<char*>(payload());
uint32_t paddingLen = intptr_t(*iter) % alignment;
uint32_t paddingLen = intptr_t(iter->iter_) % alignment;
if (paddingLen) {
#ifdef DEBUG
{
const char* padding = static_cast<const char*>(*iter);
const char* padding = static_cast<const char*>(iter->iter_);
for (uint32_t i = 0; i < paddingLen; i++) {
DCHECK(*(padding + i) == kBytePaddingMarker);
}
@ -452,19 +424,17 @@ bool Pickle::ReadBytes(void** iter, const char** data, int length,
if (!IteratorHasRoomFor(*iter, length))
return false;
*data = static_cast<const char*>(*iter) + paddingLen;
*data = static_cast<const char*>(iter->iter_) + paddingLen;
DCHECK(intptr_t(*data) % alignment == 0);
UpdateIter(iter, length);
return true;
}
bool Pickle::ReadData(void** iter, const char** data, int* length) const {
bool Pickle::ReadData(PickleIterator* iter, const char** data, int* length) const {
DCHECK(iter);
DCHECK(data);
DCHECK(length);
if (!*iter)
*iter = const_cast<char*>(payload());
if (!ReadLength(iter, length))
return false;

View File

@ -15,6 +15,21 @@
#include "mozilla/Attributes.h"
class Pickle;
class PickleIterator {
public:
explicit PickleIterator(const Pickle& pickle);
private:
friend class Pickle;
template<typename T>
void CopyFrom(T* dest);
void* iter_;
};
// This class provides facilities for basic binary value packing and unpacking.
//
// The Pickle class supports appending primitive values (ints, strings, etc.)
@ -82,30 +97,34 @@ class Pickle {
// the Pickle, initialize *iter to NULL. If successful, these methods return
// true. Otherwise, false is returned to indicate that the result could not
// be extracted.
MOZ_MUST_USE bool ReadBool(void** iter, bool* result) const;
MOZ_MUST_USE bool ReadInt16(void** iter, int16_t* result) const;
MOZ_MUST_USE bool ReadUInt16(void** iter, uint16_t* result) const;
MOZ_MUST_USE bool ReadShort(void** iter, short* result) const;
MOZ_MUST_USE bool ReadInt(void** iter, int* result) const;
MOZ_MUST_USE bool ReadLong(void** iter, long* result) const;
MOZ_MUST_USE bool ReadULong(void** iter, unsigned long* result) const;
MOZ_MUST_USE bool ReadSize(void** iter, size_t* result) const;
MOZ_MUST_USE bool ReadInt32(void** iter, int32_t* result) const;
MOZ_MUST_USE bool ReadUInt32(void** iter, uint32_t* result) const;
MOZ_MUST_USE bool ReadInt64(void** iter, int64_t* result) const;
MOZ_MUST_USE bool ReadUInt64(void** iter, uint64_t* result) const;
MOZ_MUST_USE bool ReadDouble(void** iter, double* result) const;
MOZ_MUST_USE bool ReadIntPtr(void** iter, intptr_t* result) const;
MOZ_MUST_USE bool ReadUnsignedChar(void** iter, unsigned char* result) const;
MOZ_MUST_USE bool ReadString(void** iter, std::string* result) const;
MOZ_MUST_USE bool ReadWString(void** iter, std::wstring* result) const;
MOZ_MUST_USE bool ReadData(void** iter, const char** data, int* length) const;
MOZ_MUST_USE bool ReadBytes(void** iter, const char** data, int length,
MOZ_MUST_USE bool ReadBool(PickleIterator* iter, bool* result) const;
MOZ_MUST_USE bool ReadInt16(PickleIterator* iter, int16_t* result) const;
MOZ_MUST_USE bool ReadUInt16(PickleIterator* iter, uint16_t* result) const;
MOZ_MUST_USE bool ReadShort(PickleIterator* iter, short* result) const;
MOZ_MUST_USE bool ReadInt(PickleIterator* iter, int* result) const;
MOZ_MUST_USE bool ReadLong(PickleIterator* iter, long* result) const;
MOZ_MUST_USE bool ReadULong(PickleIterator* iter, unsigned long* result) const;
MOZ_MUST_USE bool ReadSize(PickleIterator* iter, size_t* result) const;
MOZ_MUST_USE bool ReadInt32(PickleIterator* iter, int32_t* result) const;
MOZ_MUST_USE bool ReadUInt32(PickleIterator* iter, uint32_t* result) const;
MOZ_MUST_USE bool ReadInt64(PickleIterator* iter, int64_t* result) const;
MOZ_MUST_USE bool ReadUInt64(PickleIterator* iter, uint64_t* result) const;
MOZ_MUST_USE bool ReadDouble(PickleIterator* iter, double* result) const;
MOZ_MUST_USE bool ReadIntPtr(PickleIterator* iter, intptr_t* result) const;
MOZ_MUST_USE bool ReadUnsignedChar(PickleIterator* iter, unsigned char* result) const;
MOZ_MUST_USE bool ReadString(PickleIterator* iter, std::string* result) const;
MOZ_MUST_USE bool ReadWString(PickleIterator* iter, std::wstring* result) const;
MOZ_MUST_USE bool ReadData(PickleIterator* iter, const char** data, int* length) const;
MOZ_MUST_USE bool ReadBytes(PickleIterator* iter, const char** data, int length,
uint32_t alignment = sizeof(memberAlignmentType)) const;
// Safer version of ReadInt() checks for the result not being negative.
// Use it for reading the object sizes.
MOZ_MUST_USE bool ReadLength(void** iter, int* result) const;
MOZ_MUST_USE bool ReadLength(PickleIterator* iter, int* result) const;
void EndRead(PickleIterator& iter) const {
DCHECK(iter.iter_ == end_of_payload());
}
// Methods for adding to the payload of the Pickle. These values are
// appended to the end of the Pickle's payload. When reading values from a
@ -176,9 +195,6 @@ class Pickle {
// The returned pointer will only be valid until the next write operation
// on this Pickle.
char* BeginWriteData(int length);
void EndRead(void* iter) const {
DCHECK(iter == end_of_payload());
}
// Payload follows after allocation of Header (header size is customizable).
struct Header {
@ -202,12 +218,12 @@ class Pickle {
// Returns true if the given iterator could point to data with the given
// length. If there is no room for the given data before the end of the
// payload, returns false.
bool IteratorHasRoomFor(const void* iter, int len) const {
if ((len < 0) || (iter < header_) || iter > end_of_payload())
bool IteratorHasRoomFor(const PickleIterator& iter, int len) const {
if ((len < 0) || (iter.iter_ < header_) || iter.iter_ > end_of_payload())
return false;
const char* end_of_region = reinterpret_cast<const char*>(iter) + len;
const char* end_of_region = reinterpret_cast<const char*>(iter.iter_) + len;
// Watch out for overflow in pointer calculation, which wraps.
return (iter <= end_of_region) && (end_of_region <= end_of_payload());
return (iter.iter_ <= end_of_region) && (end_of_region <= end_of_payload());
}
typedef uint32_t memberAlignmentType;
@ -267,8 +283,8 @@ class Pickle {
// Moves the iterator by the given number of bytes, making sure it is aligned.
// Pointer (iterator) is NOT aligned, but the change in the pointer
// is guaranteed to be a multiple of sizeof(memberAlignmentType).
static void UpdateIter(void** iter, int bytes) {
*iter = static_cast<char*>(*iter) + AlignInt(bytes);
static void UpdateIter(PickleIterator* iter, int bytes) {
iter->iter_ = static_cast<char*>(iter->iter_) + AlignInt(bytes);
}
// Find the end of the pickled data that starts at range_start. Returns NULL
@ -287,6 +303,8 @@ class Pickle {
static const int kPayloadUnit;
private:
friend class PickleIterator;
Header* header_;
uint32_t header_size_;
uint32_t capacity_;

View File

@ -126,7 +126,7 @@ bool Message::WriteFileDescriptor(const base::FileDescriptor& descriptor) {
}
}
bool Message::ReadFileDescriptor(void** iter,
bool Message::ReadFileDescriptor(PickleIterator* iter,
base::FileDescriptor* descriptor) const {
int descriptor_index;
if (!ReadInt(iter, &descriptor_index))

View File

@ -260,7 +260,7 @@ class Message : public Pickle {
bool WriteFileDescriptor(const base::FileDescriptor& descriptor);
// Get a file descriptor from the message. Returns false on error.
// iter: a Pickle iterator to the current location in the message.
bool ReadFileDescriptor(void** iter, base::FileDescriptor* descriptor) const;
bool ReadFileDescriptor(PickleIterator* iter, base::FileDescriptor* descriptor) const;
#if defined(OS_MACOSX)
void set_fd_cookie(uint32_t cookie) {

View File

@ -29,7 +29,7 @@ namespace IPC {
class MessageIterator {
public:
explicit MessageIterator(const Message& m) : msg_(m), iter_(NULL) {
explicit MessageIterator(const Message& m) : msg_(m), iter_(m) {
}
int NextInt() const {
int val;
@ -62,7 +62,7 @@ class MessageIterator {
}
private:
const Message& msg_;
mutable void* iter_;
mutable PickleIterator iter_;
};
//-----------------------------------------------------------------------------
@ -117,7 +117,7 @@ static inline void WriteParam(Message* m, const P& p) {
}
template <class P>
static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter,
static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, PickleIterator* iter,
P* p) {
return ParamTraits<P>::Read(m, iter, p);
}
@ -138,7 +138,7 @@ struct ParamTraitsFundamental<bool> {
static void Write(Message* m, const param_type& p) {
m->WriteBool(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadBool(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -152,7 +152,7 @@ struct ParamTraitsFundamental<int> {
static void Write(Message* m, const param_type& p) {
m->WriteInt(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadInt(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -166,7 +166,7 @@ struct ParamTraitsFundamental<long> {
static void Write(Message* m, const param_type& p) {
m->WriteLong(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadLong(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -180,7 +180,7 @@ struct ParamTraitsFundamental<unsigned long> {
static void Write(Message* m, const param_type& p) {
m->WriteULong(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadULong(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -194,7 +194,7 @@ struct ParamTraitsFundamental<long long> {
static void Write(Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@ -217,7 +217,7 @@ struct ParamTraitsFundamental<unsigned long long> {
static void Write(Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@ -240,7 +240,7 @@ struct ParamTraitsFundamental<double> {
static void Write(Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@ -269,7 +269,7 @@ struct ParamTraitsFixed<int16_t> {
static void Write(Message* m, const param_type& p) {
m->WriteInt16(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadInt16(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -283,7 +283,7 @@ struct ParamTraitsFixed<uint16_t> {
static void Write(Message* m, const param_type& p) {
m->WriteUInt16(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadUInt16(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -297,7 +297,7 @@ struct ParamTraitsFixed<uint32_t> {
static void Write(Message* m, const param_type& p) {
m->WriteUInt32(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadUInt32(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -311,7 +311,7 @@ struct ParamTraitsFixed<int64_t> {
static void Write(Message* m, const param_type& p) {
m->WriteInt64(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadInt64(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -325,7 +325,7 @@ struct ParamTraitsFixed<uint64_t> {
static void Write(Message* m, const param_type& p) {
m->WriteInt64(static_cast<int64_t>(p));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadInt64(iter, reinterpret_cast<int64_t*>(r));
}
static void Log(const param_type& p, std::wstring* l) {
@ -344,7 +344,7 @@ struct ParamTraitsLibC<size_t> {
static void Write(Message* m, const param_type& p) {
m->WriteSize(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadSize(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -363,7 +363,7 @@ struct ParamTraitsStd<std::string> {
static void Write(Message* m, const param_type& p) {
m->WriteString(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadString(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -377,7 +377,7 @@ struct ParamTraitsStd<std::wstring> {
static void Write(Message* m, const param_type& p) {
m->WriteWString(p);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadWString(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@ -396,7 +396,7 @@ struct ParamTraitsStd<std::map<K, V> > {
WriteParam(m, iter->second);
}
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
int size;
if (!ReadParam(m, iter, &size) || size < 0)
return false;
@ -427,7 +427,7 @@ struct ParamTraitsWindows<HANDLE> {
static void Write(Message* m, const param_type& p) {
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
DCHECK_EQ(sizeof(param_type), sizeof(intptr_t));
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
}
@ -442,7 +442,7 @@ struct ParamTraitsWindows<HWND> {
static void Write(Message* m, const param_type& p) {
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
DCHECK_EQ(sizeof(param_type), sizeof(intptr_t));
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
}
@ -486,7 +486,7 @@ struct ParamTraitsIPC<base::FileDescriptor> {
}
}
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
bool valid;
if (!ReadParam(m, iter, &valid))
return false;
@ -517,7 +517,7 @@ struct ParamTraitsIPC<TransportDIB::Id> {
WriteParam(m, p.handle);
WriteParam(m, p.sequence_num);
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return (ReadParam(m, iter, &r->handle) &&
ReadParam(m, iter, &r->sequence_num));
}
@ -542,7 +542,7 @@ struct ParamTraitsMozilla<nsresult> {
static void Write(Message* m, const param_type& p) {
m->WriteUInt32(static_cast<uint32_t>(p));
}
static bool Read(const Message* m, void** iter, param_type* r) {
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
return m->ReadUInt32(iter, reinterpret_cast<uint32_t*>(r));
}
static void Log(const param_type& p, std::wstring* l) {

View File

@ -29,7 +29,7 @@ struct OriginAttributesParamTraits
WriteParam(aMsg, suffix);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsAutoCString suffix;
return ReadParam(aMsg, aIter, &suffix) &&

View File

@ -114,7 +114,7 @@ struct EnumSerializer {
WriteParam(aMsg, uintParamType(aValue));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
uintParamType value;
if (!ReadParam(aMsg, aIter, &value)) {
#ifdef MOZ_CRASHREPORTER
@ -230,7 +230,7 @@ struct ParamTraits<int8_t>
aMsg->WriteBytes(&aParam, sizeof(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* outp;
if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult)))
@ -251,7 +251,7 @@ struct ParamTraits<uint8_t>
aMsg->WriteBytes(&aParam, sizeof(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* outp;
if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult)))
@ -271,7 +271,7 @@ struct ParamTraits<base::FileDescriptor>
static void Write(Message* aMsg, const paramType& aParam) {
NS_RUNTIMEABORT("FileDescriptor isn't meaningful on this platform");
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
NS_RUNTIMEABORT("FileDescriptor isn't meaningful on this platform");
return false;
}
@ -297,7 +297,7 @@ struct ParamTraits<nsACString>
aMsg->WriteBytes(aParam.BeginReading(), length);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool isVoid;
if (!aMsg->ReadBool(aIter, &isVoid))
@ -347,7 +347,7 @@ struct ParamTraits<nsAString>
aMsg->WriteBytes(aParam.BeginReading(), length * sizeof(char16_t));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool isVoid;
if (!aMsg->ReadBool(aIter, &isVoid))
@ -461,7 +461,7 @@ struct ParamTraits<nsTArray<E>>
// This method uses infallible allocation so that an OOM failure will
// show up as an OOM crash rather than an IPC FatalError.
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint32_t length;
if (!ReadParam(aMsg, aIter, &length)) {
@ -518,7 +518,7 @@ struct ParamTraits<FallibleTArray<E>>
}
// Deserialize the array infallibly, but return a FallibleTArray.
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsTArray<E> temp;
if (!ReadParam(aMsg, aIter, &temp))
@ -550,7 +550,7 @@ struct ParamTraits<float>
aMsg->WriteBytes(&aParam, sizeof(paramType));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* outFloat;
if (!aMsg->ReadBytes(aIter, &outFloat, sizeof(float)))
@ -578,7 +578,7 @@ struct ParamTraits<mozilla::void_t>
typedef mozilla::void_t paramType;
static void Write(Message* aMsg, const paramType& aParam) { }
static bool
Read(const Message* aMsg, void** aIter, paramType* aResult)
Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
*aResult = paramType();
return true;
@ -591,7 +591,7 @@ struct ParamTraits<mozilla::null_t>
typedef mozilla::null_t paramType;
static void Write(Message* aMsg, const paramType& aParam) { }
static bool
Read(const Message* aMsg, void** aIter, paramType* aResult)
Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
*aResult = paramType();
return true;
@ -613,7 +613,7 @@ struct ParamTraits<nsID>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if(!ReadParam(aMsg, aIter, &(aResult->m0)) ||
!ReadParam(aMsg, aIter, &(aResult->m1)) ||
@ -648,7 +648,7 @@ struct ParamTraits<mozilla::TimeDuration>
{
WriteParam(aMsg, aParam.mValue);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mValue);
};
@ -662,7 +662,7 @@ struct ParamTraits<mozilla::TimeStamp>
{
WriteParam(aMsg, aParam.mValue);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mValue);
};
@ -681,7 +681,7 @@ struct ParamTraits<mozilla::TimeStampValue>
WriteParam(aMsg, aParam.mHasQPC);
WriteParam(aMsg, aParam.mIsNull);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return (ReadParam(aMsg, aIter, &aResult->mGTC) &&
ReadParam(aMsg, aIter, &aResult->mQPC) &&
@ -702,7 +702,7 @@ struct ParamTraits<mozilla::dom::ipc::StructuredCloneData>
aParam.WriteIPCParams(aMsg);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return aResult->ReadIPCParams(aMsg, aIter);
}
@ -723,7 +723,7 @@ struct ParamTraits<mozilla::net::WebSocketFrameData>
aParam.WriteIPCParams(aMsg);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return aResult->ReadIPCParams(aMsg, aIter);
}
@ -743,7 +743,7 @@ struct ParamTraits<mozilla::SerializedStructuredCloneBuffer>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->dataLength)) {
return false;
@ -792,7 +792,7 @@ struct ParamTraits<mozilla::Maybe<T>>
}
}
static bool Read(const Message* msg, void** iter, paramType* result)
static bool Read(const Message* msg, PickleIterator* iter, paramType* result)
{
bool isSome;
if (!ReadParam(msg, iter, &isSome)) {

View File

@ -190,7 +190,7 @@ public:
ProcessId* aOtherProcess,
ProtocolId* aProtocol)
{
void* iter = nullptr;
PickleIterator iter(aMsg);
if (!IPC::ReadParam(&aMsg, &iter, aDescriptor) ||
!IPC::ReadParam(&aMsg, &iter, aOtherProcess) ||
!IPC::ReadParam(&aMsg, &iter, reinterpret_cast<uint32_t*>(aProtocol))) {

View File

@ -186,7 +186,7 @@ public:
virtual void CloneManagees(ListenerT* aSource,
ProtocolCloneContext* aCtx) = 0;
Maybe<ListenerT*> ReadActor(const IPC::Message* aMessage, void** aIter, bool aNullable,
Maybe<ListenerT*> ReadActor(const IPC::Message* aMessage, PickleIterator* aIter, bool aNullable,
const char* aActorDescription, int32_t aProtocolTypeId);
};
@ -364,7 +364,7 @@ UnpackChannelOpened(const PrivateIPDLInterface&,
template<typename ListenerT>
Maybe<ListenerT*>
IProtocolManager<ListenerT>::ReadActor(const IPC::Message* aMessage, void** aIter, bool aNullable,
IProtocolManager<ListenerT>::ReadActor(const IPC::Message* aMessage, PickleIterator* aIter, bool aNullable,
const char* aActorDescription, int32_t aProtocolTypeId)
{
int32_t id;
@ -614,7 +614,7 @@ struct ParamTraits<mozilla::ipc::ActorHandle>
IPC::WriteParam(aMsg, aParam.mId);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int id;
if (IPC::ReadParam(aMsg, aIter, &id)) {
@ -653,7 +653,7 @@ struct ParamTraits<mozilla::ipc::Endpoint<PFooSide>>
IPC::WriteParam(aMsg, static_cast<uint32_t>(aParam.mProtocolId));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
MOZ_RELEASE_ASSERT(!aResult->mValid);
aResult->mValid = true;

View File

@ -62,7 +62,7 @@ public:
virtual SharedMemoryType Type() const = 0;
virtual bool ShareHandle(base::ProcessId aProcessId, IPC::Message* aMessage) = 0;
virtual bool ReadHandle(const IPC::Message* aMessage, void** aIter) = 0;
virtual bool ReadHandle(const IPC::Message* aMessage, PickleIterator* aIter) = 0;
void
Protect(char* aAddr, size_t aSize, int aRights)
@ -137,7 +137,7 @@ public:
return true;
}
virtual bool ReadHandle(const IPC::Message* aMessage, void** aIter) override
virtual bool ReadHandle(const IPC::Message* aMessage, PickleIterator* aIter) override
{
Handle handle;
return IPC::ReadParam(aMessage, aIter, &handle) &&

View File

@ -34,7 +34,7 @@ public:
}
static bool
ReadInfo(const Message* msg, void** iter,
ReadInfo(const Message* msg, PickleIterator* iter,
id_t* aIPDLId,
size_t* aSize,
SharedMemory::SharedMemoryType* aType)
@ -100,7 +100,7 @@ ReadSegment(const IPC::Message& aDescriptor, Shmem::id_t* aId, size_t* aNBytes,
return nullptr;
}
SharedMemory::SharedMemoryType type;
void* iter = nullptr;
PickleIterator iter(aDescriptor);
if (!ShmemCreated::ReadInfo(&aDescriptor, &iter, aId, aNBytes, &type)) {
return nullptr;
}

View File

@ -284,7 +284,7 @@ struct ParamTraits<mozilla::ipc::Shmem>
WriteParam(aMsg, aParam.mId);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
paramType::id_t id;
if (!ReadParam(aMsg, aIter, &id))

View File

@ -33,7 +33,7 @@ struct ParamTraits<mozilla::ipc::TransportDescriptor>
{
WriteParam(aMsg, aParam.mFd);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mFd);
}

View File

@ -59,7 +59,7 @@ struct ParamTraits<mozilla::ipc::TransportDescriptor>
WriteParam(aMsg, duplicateFromProcessId);
WriteParam(aMsg, aParam.mDestinationProcessId);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
DWORD duplicateFromProcessId;
bool r = (ReadParam(aMsg, aIter, &aResult->mPipeName) &&

View File

@ -133,6 +133,9 @@ def _actorState(actor):
def _backstagePass():
return ExprCall(ExprVar('mozilla::ipc::PrivateIPDLInterface'))
def _iterType(ptr):
return Type('PickleIterator', ptr=ptr)
def _nullState(proto=None):
pfx = ''
if proto is not None: pfx = proto.name() +'::'
@ -4122,7 +4125,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
itervar = ExprVar('iter')
case.addstmts([
StmtDecl(Decl(_shmemIdType(), idvar.name)),
StmtDecl(Decl(Type.VOIDPTR, itervar.name), init=ExprLiteral.NULL)
StmtDecl(Decl(_iterType(ptr=0), itervar.name), init=ExprCall(ExprVar('PickleIterator'),
args=[ self.msgvar ]))
])
failif = StmtIf(ExprNot(
@ -4669,7 +4673,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
params=[ Decl(outtype, var.name),
Decl(Type('Message', ptr=1, const=1),
self.msgvar.name),
Decl(Type('void', ptrptr=1), self.itervar.name)],
Decl(_iterType(ptr=1), self.itervar.name)],
warn_unused=not template,
T=template,
ret=Type.BOOL)
@ -5150,8 +5154,9 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
start = 1
stmts.extend((
[ StmtDecl(Decl(Type.VOIDPTR, self.itervar.name),
init=ExprLiteral.NULL) ]
[ StmtDecl(Decl(_iterType(ptr=0), self.itervar.name),
init=ExprCall(ExprVar('PickleIterator'),
args=[ msgvar ])) ]
+ decls + [ StmtDecl(Decl(p.bareType(side), p.var().name))
for p in md.params ]
+ [ Whitespace.NL ]
@ -5174,8 +5179,9 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
itervar = self.itervar
stmts.extend(
[ Whitespace.NL,
StmtDecl(Decl(Type.VOIDPTR, itervar.name),
init=ExprLiteral.NULL) ]
StmtDecl(Decl(_iterType(ptr=0), itervar.name),
init=ExprCall(ExprVar('PickleIterator'),
args=[ self.replyvar ])) ]
+ [ self.checkedRead(r.ipdltype, r.var(),
ExprAddrOf(self.replyvar),
ExprAddrOf(self.itervar),

View File

@ -19,7 +19,7 @@ struct ParamTraits<mozilla::_ipdltest::Bad>
// Defined in TestActorPunning.cpp.
static void Write(Message* aMsg, const paramType& aParam);
static bool Read(const Message* aMsg, void** aIter, paramType* aResult);
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult);
};
} // namespace IPC

View File

@ -120,7 +120,7 @@ ParamTraits<Bad>::Write(Message* aMsg, const paramType& aParam)
}
/*static*/ bool
ParamTraits<Bad>::Read(const Message* aMsg, void** aIter, paramType* aResult)
ParamTraits<Bad>::Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* ptr;
int len;

View File

@ -9292,7 +9292,7 @@ nsLayoutUtils::UpdateDisplayPortMarginsFromPendingMessages() {
mozilla::dom::ContentChild::GetSingleton()->GetIPCChannel()->PeekMessages(
[](const IPC::Message& aMsg) -> bool {
if (aMsg.type() == mozilla::layers::PAPZ::Msg_UpdateFrame__ID) {
void* iter = nullptr;
PickleIterator iter(aMsg);
FrameMetrics frame;
if (!IPC::ReadParam(&aMsg, &iter, &frame)) {
MOZ_ASSERT(false);

View File

@ -29,7 +29,7 @@ struct ParamTraits<mozilla::VisibilityCounter>
WriteParam(aMsg, uint8_t(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint8_t valueAsByte;
if (ReadParam(aMsg, aIter, &valueAsByte)) {

View File

@ -54,7 +54,7 @@ struct ParamTraits<Permission>
WriteParam(aMsg, aParam.expireTime);
}
static bool Read(const Message* aMsg, void** aIter, Permission* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, Permission* aResult)
{
return ReadParam(aMsg, aIter, &aResult->origin) &&
ReadParam(aMsg, aIter, &aResult->type) &&
@ -112,7 +112,7 @@ struct ParamTraits<mozilla::net::NetAddr>
}
}
static bool Read(const Message* aMsg, void** aIter, mozilla::net::NetAddr* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, mozilla::net::NetAddr* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->raw.family))
return false;
@ -174,7 +174,7 @@ struct ParamTraits<mozilla::net::ResourceTimingStruct>
WriteParam(aMsg, aParam.cacheReadEnd);
}
static bool Read(const Message* aMsg, void** aIter, mozilla::net::ResourceTimingStruct* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, mozilla::net::ResourceTimingStruct* aResult)
{
return ReadParam(aMsg, aIter, &aResult->domainLookupStart) &&
ReadParam(aMsg, aIter, &aResult->domainLookupEnd) &&

View File

@ -54,7 +54,7 @@ struct ParamTraits<mozilla::net::RequestHeaderTuple>
WriteParam(aMsg, aParam.mEmpty);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->mHeader) ||
!ReadParam(aMsg, aIter, &aResult->mValue) ||
@ -79,7 +79,7 @@ struct ParamTraits<mozilla::net::nsHttpAtom>
WriteParam(aMsg, value);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
nsAutoCString value;
if (!ReadParam(aMsg, aIter, &value))
@ -121,7 +121,7 @@ struct ParamTraits<mozilla::net::nsHttpHeaderArray::nsEntry>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint8_t variety;
if (!ReadParam(aMsg, aIter, &aResult->header) ||
@ -169,7 +169,7 @@ struct ParamTraits<mozilla::net::nsHttpHeaderArray>
WriteParam(aMsg, p.mHeaders);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->mHeaders))
return false;
@ -198,7 +198,7 @@ struct ParamTraits<mozilla::net::nsHttpResponseHead>
WriteParam(aMsg, aParam.mPragmaNoCache);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->mHeaders) ||
!ReadParam(aMsg, aIter, &aResult->mVersion) ||

View File

@ -137,7 +137,7 @@ WebSocketFrameData::WriteIPCParams(IPC::Message* aMessage) const
bool
WebSocketFrameData::ReadIPCParams(const IPC::Message* aMessage,
void** aIter)
PickleIterator* aIter)
{
if (!ReadParam(aMessage, aIter, &mTimeStamp)) {
return false;

View File

@ -34,7 +34,7 @@ public:
// For IPC serialization
void WriteIPCParams(IPC::Message* aMessage) const;
bool ReadIPCParams(const IPC::Message* aMessage, void** aIter);
bool ReadIPCParams(const IPC::Message* aMessage, PickleIterator* aIter);
DOMHighResTimeStamp mTimeStamp;

View File

@ -68,7 +68,7 @@ struct ParamTraits<AlertNotificationType>
WriteParam(aMsg, inPrivateBrowsing);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool isNull;
NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &isNull), false);

View File

@ -21,7 +21,7 @@ struct ParamTraits<LookAndFeelInt>
WriteParam(aMsg, aParam.value);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
int32_t id, value;
if (ReadParam(aMsg, aIter, &id) &&
@ -36,4 +36,4 @@ struct ParamTraits<LookAndFeelInt>
} // namespace IPC
#endif // WidgetMessageUtils_h
#endif // WidgetMessageUtils_h

View File

@ -28,7 +28,7 @@ struct ParamTraits<mozilla::EventMessage>
WriteParam(aMsg, static_cast<const mozilla::EventMessageType&>(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
mozilla::EventMessageType eventMessage = 0;
bool ret = ReadParam(aMsg, aIter, &eventMessage);
@ -47,7 +47,7 @@ struct ParamTraits<mozilla::BaseEventFlags>
aMsg->WriteBytes(&aParam, sizeof(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
const char* outp;
if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult))) {
@ -74,7 +74,7 @@ struct ParamTraits<mozilla::WidgetEvent>
WriteParam(aMsg, aParam.mFlags);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
mozilla::EventClassIDType eventClassID = 0;
bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
@ -98,7 +98,7 @@ struct ParamTraits<mozilla::NativeEventData>
WriteParam(aMsg, aParam.mBuffer);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mBuffer);
}
@ -115,7 +115,7 @@ struct ParamTraits<mozilla::WidgetGUIEvent>
WriteParam(aMsg, aParam.mPluginEvent);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, static_cast<mozilla::WidgetEvent*>(aResult)) &&
ReadParam(aMsg, aIter, &aResult->mPluginEvent);
@ -133,7 +133,7 @@ struct ParamTraits<mozilla::WidgetInputEvent>
WriteParam(aMsg, aParam.mModifiers);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter,
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
@ -156,7 +156,7 @@ struct ParamTraits<mozilla::WidgetMouseEventBase>
WriteParam(aMsg, aParam.inputSource);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter,
static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
@ -194,7 +194,7 @@ struct ParamTraits<mozilla::WidgetWheelEvent>
WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
uint8_t scrollType = 0;
bool rv =
@ -238,7 +238,7 @@ struct ParamTraits<mozilla::WidgetMouseEvent>
WriteParam(aMsg, aParam.mClickCount);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool rv;
paramType::ReasonType reason = 0;
@ -272,7 +272,7 @@ struct ParamTraits<mozilla::WidgetDragEvent>
WriteParam(aMsg, aParam.mDefaultPreventedOnContent);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool rv =
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
@ -298,7 +298,7 @@ struct ParamTraits<mozilla::WidgetPointerEvent>
WriteParam(aMsg, aParam.isPrimary);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool rv =
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
@ -334,7 +334,7 @@ struct ParamTraits<mozilla::WidgetTouchEvent>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
paramType::TouchArray::size_type numTouches;
if (!ReadParam(aMsg, aIter,
@ -374,7 +374,7 @@ struct ParamTraits<mozilla::AlternativeCharCode>
WriteParam(aMsg, aParam.mShiftedCharCode);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mUnshiftedCharCode) &&
ReadParam(aMsg, aIter, &aResult->mShiftedCharCode);
@ -421,7 +421,7 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
// that cannot be copied across process boundaries.
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
mozilla::KeyNameIndexType keyNameIndex = 0;
mozilla::CodeNameIndexType codeNameIndex = 0;
@ -477,7 +477,7 @@ struct ParamTraits<mozilla::InternalBeforeAfterKeyboardEvent>
WriteParam(aMsg, aParam.mEmbeddedCancelled.Value());
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool isNull;
bool value;
@ -511,7 +511,7 @@ struct ParamTraits<mozilla::TextRangeStyle>
WriteParam(aMsg, aParam.mUnderlineColor);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mDefinedStyles) &&
ReadParam(aMsg, aIter, &aResult->mLineStyle) &&
@ -535,7 +535,7 @@ struct ParamTraits<mozilla::TextRange>
WriteParam(aMsg, aParam.mRangeStyle);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
ReadParam(aMsg, aIter, &aResult->mEndOffset) &&
@ -557,7 +557,7 @@ struct ParamTraits<mozilla::TextRangeArray>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
paramType::size_type length;
if (!ReadParam(aMsg, aIter, &length)) {
@ -592,7 +592,7 @@ struct ParamTraits<mozilla::WidgetCompositionEvent>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool hasRanges;
if (!ReadParam(aMsg, aIter,
@ -627,7 +627,7 @@ struct ParamTraits<mozilla::FontRange>
WriteParam(aMsg, aParam.mFontSize);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
ReadParam(aMsg, aIter, &aResult->mFontName) &&
@ -658,7 +658,7 @@ struct ParamTraits<mozilla::WidgetQueryContentEvent>
WriteParam(aMsg, aParam.mReply.mFontRanges);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter,
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
@ -694,7 +694,7 @@ struct ParamTraits<mozilla::WidgetSelectionEvent>
WriteParam(aMsg, aParam.mUseNativeLineBreak);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter,
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
@ -717,7 +717,7 @@ struct ParamTraits<nsIMEUpdatePreference>
WriteParam(aMsg, aParam.mWantUpdates);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mWantUpdates);
}
@ -734,7 +734,7 @@ struct ParamTraits<mozilla::widget::NativeIMEContext>
WriteParam(aMsg, aParam.mOriginProcessID);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mRawNativeIMEContext) &&
ReadParam(aMsg, aIter, &aResult->mOriginProcessID);
@ -752,7 +752,7 @@ struct ParamTraits<mozilla::widget::IMENotification::Point>
WriteParam(aMsg, aParam.mY);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mX) &&
ReadParam(aMsg, aIter, &aResult->mY);
@ -772,7 +772,7 @@ struct ParamTraits<mozilla::widget::IMENotification::Rect>
WriteParam(aMsg, aParam.mHeight);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mX) &&
ReadParam(aMsg, aIter, &aResult->mY) &&
@ -798,7 +798,7 @@ struct ParamTraits<mozilla::widget::IMENotification::SelectionChangeDataBase>
WriteParam(aMsg, aParam.mOccurredDuringComposition);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
aResult->mString = new nsString();
return ReadParam(aMsg, aIter, &aResult->mOffset) &&
@ -826,7 +826,7 @@ struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase>
WriteParam(aMsg, aParam.mIncludingChangesWithoutComposition);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
ReadParam(aMsg, aIter, &aResult->mRemovedEndOffset) &&
@ -855,7 +855,7 @@ struct ParamTraits<mozilla::widget::IMENotification::MouseButtonEventData>
WriteParam(aMsg, aParam.mModifiers);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mEventMessage) &&
ReadParam(aMsg, aIter, &aResult->mOffset) &&
@ -891,7 +891,7 @@ struct ParamTraits<mozilla::widget::IMENotification>
}
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
mozilla::widget::IMEMessageType IMEMessage = 0;
if (!ReadParam(aMsg, aIter, &IMEMessage)) {
@ -922,7 +922,7 @@ struct ParamTraits<mozilla::WidgetPluginEvent>
WriteParam(aMsg, aParam.mRetargetToFocusedDocument);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter,
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
@ -940,7 +940,7 @@ struct ParamTraits<mozilla::WritingMode>
WriteParam(aMsg, aParam.mWritingMode);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mWritingMode);
}
@ -968,7 +968,7 @@ struct ParamTraits<mozilla::ContentCache>
WriteParam(aMsg, aParam.mEditorRect);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mText) &&
ReadParam(aMsg, aIter, &aResult->mSelection.mAnchor) &&
@ -998,7 +998,7 @@ struct ParamTraits<mozilla::widget::CandidateWindowPosition>
WriteParam(aMsg, aParam.mExcludeRect);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, &aResult->mPoint) &&
ReadParam(aMsg, aIter, &aResult->mRect) &&