diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/glue/IPCMessageUtils.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index 15834a8548..c6f8eda6df 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -63,15 +63,18 @@ struct null_t { struct SerializedStructuredCloneBuffer final { + SerializedStructuredCloneBuffer() + : data(JS::StructuredCloneScope::Unassigned) + { + } + + SerializedStructuredCloneBuffer& operator=(const SerializedStructuredCloneBuffer& aOther) { data.Clear(); - auto iter = aOther.data.Iter(); - while (!iter.Done()) { - data.WriteBytes(iter.Data(), iter.RemainingInSegment()); - iter.Advance(aOther.data, iter.RemainingInSegment()); - } + data.initScope(aOther.data.scope()); + data.Append(aOther.data); return *this; } @@ -712,11 +715,9 @@ struct ParamTraits<JSStructuredCloneData> { MOZ_ASSERT(!(aParam.Size() % sizeof(uint64_t))); WriteParam(aMsg, aParam.Size()); - auto iter = aParam.Iter(); - while (!iter.Done()) { - aMsg->WriteBytes(iter.Data(), iter.RemainingInSegment(), sizeof(uint64_t)); - iter.Advance(aParam, iter.RemainingInSegment()); - } + aParam.ForEachDataChunk([&](const char* aData, size_t aSize) { + return aMsg->WriteBytes(aData, aSize, sizeof(uint64_t)); + }); } static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) @@ -746,7 +747,7 @@ struct ParamTraits<JSStructuredCloneData> return false; } - *aResult = JSStructuredCloneData(Move(out)); + *aResult = JSStructuredCloneData(Move(out), JS::StructuredCloneScope::DifferentProcess); return true; } |