Skip to content

Commit

Permalink
Bug 1262671 - void** -> PickleIterator (r=froydnj)
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-mccloskey committed May 27, 2016
1 parent 4ce77c2 commit 9cdce4d
Show file tree
Hide file tree
Showing 76 changed files with 366 additions and 367 deletions.
8 changes: 4 additions & 4 deletions chrome/RegistryMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docshell/base/SerializedLoadContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
4 changes: 2 additions & 2 deletions dom/asmjscache/AsmJSCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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) &&
Expand Down
4 changes: 2 additions & 2 deletions dom/asmjscache/AsmJSCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand All @@ -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);
};

Expand Down
4 changes: 2 additions & 2 deletions dom/bindings/BindingUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dom/bindings/ErrorIPCUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
5 changes: 3 additions & 2 deletions dom/bindings/ErrorResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace IPC {
class Message;
template <typename> struct ParamTraits;
} // namespace IPC
class PickleIterator;

namespace mozilla {

Expand Down Expand Up @@ -307,10 +308,10 @@ class ErrorResult {

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.
Expand Down
22 changes: 11 additions & 11 deletions dom/bluetooth/ipc/BluetoothMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]))) {
Expand All @@ -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))) {
Expand All @@ -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))) {
Expand All @@ -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)) ||
Expand All @@ -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;
Expand Down Expand Up @@ -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)) ||
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) ||
Expand Down
2 changes: 1 addition & 1 deletion dom/events/Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion dom/events/NotifyPaintEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion dom/events/NotifyPaintEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NotifyPaintEvent : public Event,
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
{
Expand Down
2 changes: 1 addition & 1 deletion dom/events/ScrollAreaEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion dom/events/ScrollAreaEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ScrollAreaEvent : public UIEvent
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
{
Expand Down
2 changes: 1 addition & 1 deletion dom/events/UIEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions dom/events/UIEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class UIEvent : public Event,
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,
Expand Down Expand Up @@ -139,7 +139,7 @@ class UIEvent : public Event,
UIEvent::Serialize(aMsg, aSerializeInterfaceType); \
} \
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, \
void** aIter) override \
PickleIterator* aIter) override \
{ \
return UIEvent::Deserialize(aMsg, aIter); \
}
Expand Down
4 changes: 2 additions & 2 deletions dom/geolocation/nsGeoPositionIPCSerialiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions dom/indexedDB/SerializationHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion dom/interfaces/events/nsIDOMEvent.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +24,7 @@ class nsInvalidateRequestList;
namespace IPC {
class Message;
}
class PickleIterator;
namespace mozilla {
namespace dom {
class Event;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/IdType.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/PermissionMessageUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/PermissionMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/StructuredCloneData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ StructuredCloneData::WriteIPCParams(IPC::Message* aMsg) const

bool
StructuredCloneData::ReadIPCParams(const IPC::Message* aMsg,
void** aIter)
PickleIterator* aIter)
{
MOZ_ASSERT(!Data());

Expand Down
Loading

0 comments on commit 9cdce4d

Please sign in to comment.