diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/chromium/src/base/hash_tables.h | 8 | ||||
-rw-r--r-- | ipc/glue/IPCMessageUtils.h | 23 |
2 files changed, 14 insertions, 17 deletions
diff --git a/ipc/chromium/src/base/hash_tables.h b/ipc/chromium/src/base/hash_tables.h index 956cadb3d..9e8d6b110 100644 --- a/ipc/chromium/src/base/hash_tables.h +++ b/ipc/chromium/src/base/hash_tables.h @@ -31,18 +31,14 @@ #ifdef __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wshadow" -# if MOZ_GCC_VERSION_AT_LEAST(4, 9, 0) -# pragma GCC diagnostic ignored "-Wshadow-local" -# endif +# pragma GCC diagnostic ignored "-Wshadow-local" #endif #include <hash_map> #include <hash_set> #ifdef __GNUC__ -# if MOZ_GCC_VERSION_AT_LEAST(4, 9, 0) -# pragma GCC diagnostic pop // -Wshadow-local -# endif +# pragma GCC diagnostic pop // -Wshadow-local # pragma GCC diagnostic pop // -Wshadow #endif 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; } |