diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /ipc/glue/IPCMessageUtils.h | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.gz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.lz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.xz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'ipc/glue/IPCMessageUtils.h')
-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 15834a854..c6f8eda6d 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; } |