2017-10-27 01:08:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2015-07-19 10:54:41 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
#ifndef mozilla_dom_StructuredCloneHolder_h
|
|
|
|
#define mozilla_dom_StructuredCloneHolder_h
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2016-10-28 15:44:04 +03:00
|
|
|
#include "jsapi.h"
|
2015-07-19 10:54:41 +03:00
|
|
|
#include "js/StructuredClone.h"
|
2017-07-26 00:53:41 +03:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2015-09-16 06:27:56 +03:00
|
|
|
#include "mozilla/Move.h"
|
2016-04-22 13:04:20 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2016-10-26 23:00:17 +03:00
|
|
|
#include "mozilla/dom/BindingDeclarations.h"
|
2015-07-22 21:37:18 +03:00
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsTArray.h"
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2015-09-09 10:10:32 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
#include "nsIThread.h"
|
|
|
|
#endif
|
|
|
|
|
2017-04-05 20:02:57 +03:00
|
|
|
class nsIInputStream;
|
|
|
|
|
2015-07-19 10:54:41 +03:00
|
|
|
namespace mozilla {
|
2015-08-19 00:55:21 +03:00
|
|
|
class ErrorResult;
|
2015-07-30 21:50:00 +03:00
|
|
|
namespace layers {
|
|
|
|
class Image;
|
|
|
|
}
|
|
|
|
|
2015-12-18 09:52:16 +03:00
|
|
|
namespace gfx {
|
|
|
|
class DataSourceSurface;
|
|
|
|
}
|
|
|
|
|
2015-07-19 10:54:41 +03:00
|
|
|
namespace dom {
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
class StructuredCloneHolderBase
|
2015-07-19 10:54:41 +03:00
|
|
|
{
|
|
|
|
public:
|
2016-07-21 16:29:42 +03:00
|
|
|
typedef JS::StructuredCloneScope StructuredCloneScope;
|
|
|
|
|
|
|
|
StructuredCloneHolderBase(StructuredCloneScope aScope = StructuredCloneScope::SameProcessSameThread);
|
2015-09-30 15:22:08 +03:00
|
|
|
virtual ~StructuredCloneHolderBase();
|
2015-07-24 14:12:51 +03:00
|
|
|
|
2018-05-30 22:15:35 +03:00
|
|
|
// Note, it is unsafe to std::move() a StructuredCloneHolderBase since a raw
|
2018-05-15 21:19:47 +03:00
|
|
|
// this pointer is passed to mBuffer as a callback closure. That must
|
|
|
|
// be fixed if you want to implement a move constructor here.
|
|
|
|
StructuredCloneHolderBase(StructuredCloneHolderBase&& aOther) = delete;
|
2016-08-10 09:18:29 +03:00
|
|
|
|
2015-07-19 10:54:41 +03:00
|
|
|
// These methods should be implemented in order to clone data.
|
|
|
|
// Read more documentation in js/public/StructuredClone.h.
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
virtual JSObject* CustomReadHandler(JSContext* aCx,
|
|
|
|
JSStructuredCloneReader* aReader,
|
|
|
|
uint32_t aTag,
|
|
|
|
uint32_t aIndex) = 0;
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
virtual bool CustomWriteHandler(JSContext* aCx,
|
|
|
|
JSStructuredCloneWriter* aWriter,
|
|
|
|
JS::Handle<JSObject*> aObj) = 0;
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2015-07-24 14:12:51 +03:00
|
|
|
// This method has to be called when this object is not needed anymore.
|
|
|
|
// It will free memory and the buffer. This has to be called because
|
|
|
|
// otherwise the buffer will be freed in the DTOR of this class and at that
|
|
|
|
// point we cannot use the overridden methods.
|
2015-09-30 15:22:08 +03:00
|
|
|
void Clear();
|
2015-07-24 14:12:51 +03:00
|
|
|
|
2015-07-19 10:54:41 +03:00
|
|
|
// If these 3 methods are not implement, transfering objects will not be
|
2015-09-30 15:22:08 +03:00
|
|
|
// allowed. Otherwise only arrayBuffers will be transferred.
|
2015-07-19 10:54:41 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-09-30 15:22:08 +03:00
|
|
|
CustomReadTransferHandler(JSContext* aCx,
|
|
|
|
JSStructuredCloneReader* aReader,
|
|
|
|
uint32_t aTag,
|
|
|
|
void* aContent,
|
|
|
|
uint64_t aExtraData,
|
|
|
|
JS::MutableHandleObject aReturnObject);
|
2015-07-19 10:54:41 +03:00
|
|
|
|
|
|
|
virtual bool
|
2015-09-30 15:22:08 +03:00
|
|
|
CustomWriteTransferHandler(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aObj,
|
|
|
|
// Output:
|
|
|
|
uint32_t* aTag,
|
|
|
|
JS::TransferableOwnership* aOwnership,
|
|
|
|
void** aContent,
|
|
|
|
uint64_t* aExtraData);
|
2015-07-19 10:54:41 +03:00
|
|
|
|
|
|
|
virtual void
|
2015-09-30 15:22:08 +03:00
|
|
|
CustomFreeTransferHandler(uint32_t aTag,
|
|
|
|
JS::TransferableOwnership aOwnership,
|
|
|
|
void* aContent,
|
|
|
|
uint64_t aExtraData);
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2018-03-28 10:23:17 +03:00
|
|
|
virtual bool
|
|
|
|
CustomCanTransferHandler(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aObj);
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// These methods are what you should use to read/write data.
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// Execute the serialization of aValue using the Structured Clone Algorithm.
|
|
|
|
// The data can read back using Read().
|
2015-07-19 10:54:41 +03:00
|
|
|
bool Write(JSContext* aCx,
|
|
|
|
JS::Handle<JS::Value> aValue);
|
|
|
|
|
2016-10-24 16:14:45 +03:00
|
|
|
// Like Write() but it supports the transferring of objects and handling
|
|
|
|
// of cloning policy.
|
2015-07-19 10:54:41 +03:00
|
|
|
bool Write(JSContext* aCx,
|
|
|
|
JS::Handle<JS::Value> aValue,
|
2016-10-24 16:14:45 +03:00
|
|
|
JS::Handle<JS::Value> aTransfer,
|
|
|
|
JS::CloneDataPolicy cloneDataPolicy);
|
2015-07-19 10:54:41 +03:00
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// If Write() has been called, this method retrieves data and stores it into
|
|
|
|
// aValue.
|
2015-07-19 10:54:41 +03:00
|
|
|
bool Read(JSContext* aCx,
|
|
|
|
JS::MutableHandle<JS::Value> aValue);
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
bool HasData() const
|
2015-08-27 19:19:13 +03:00
|
|
|
{
|
|
|
|
return !!mBuffer;
|
|
|
|
}
|
|
|
|
|
2016-04-22 13:04:20 +03:00
|
|
|
JSStructuredCloneData& BufferData() const
|
2015-07-28 10:38:16 +03:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(mBuffer, "Write() has never been called.");
|
|
|
|
return mBuffer->data();
|
|
|
|
}
|
|
|
|
|
2017-07-26 00:53:41 +03:00
|
|
|
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
|
|
|
{
|
|
|
|
size_t size = 0;
|
|
|
|
if (HasData()) {
|
|
|
|
size += mBuffer->sizeOfIncludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
2015-07-19 10:54:41 +03:00
|
|
|
protected:
|
2016-04-22 13:04:20 +03:00
|
|
|
UniquePtr<JSAutoStructuredCloneBuffer> mBuffer;
|
2015-07-24 14:12:51 +03:00
|
|
|
|
2016-07-21 16:29:42 +03:00
|
|
|
StructuredCloneScope mStructuredCloneScope;
|
|
|
|
|
2015-07-24 14:12:51 +03:00
|
|
|
#ifdef DEBUG
|
2015-09-30 15:22:08 +03:00
|
|
|
bool mClearCalled;
|
2015-07-24 14:12:51 +03:00
|
|
|
#endif
|
2015-07-22 21:37:18 +03:00
|
|
|
};
|
|
|
|
|
2015-07-28 10:38:16 +03:00
|
|
|
class BlobImpl;
|
2015-09-16 06:27:56 +03:00
|
|
|
class MessagePort;
|
2015-07-22 21:37:18 +03:00
|
|
|
class MessagePortIdentifier;
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
class StructuredCloneHolder : public StructuredCloneHolderBase
|
2015-07-22 21:37:18 +03:00
|
|
|
{
|
|
|
|
public:
|
2015-07-28 10:38:16 +03:00
|
|
|
enum CloningSupport
|
|
|
|
{
|
|
|
|
CloningSupported,
|
|
|
|
CloningNotSupported
|
|
|
|
};
|
2015-07-22 21:37:18 +03:00
|
|
|
|
2015-07-28 10:38:16 +03:00
|
|
|
enum TransferringSupport
|
|
|
|
{
|
|
|
|
TransferringSupported,
|
|
|
|
TransferringNotSupported
|
2015-07-22 21:37:18 +03:00
|
|
|
};
|
|
|
|
|
2015-07-28 10:38:16 +03:00
|
|
|
// If cloning is supported, this object will clone objects such as Blobs,
|
|
|
|
// FileList, ImageData, etc.
|
|
|
|
// If transferring is supported, we will transfer MessagePorts and in the
|
|
|
|
// future other transferrable objects.
|
2016-07-21 16:29:42 +03:00
|
|
|
// The StructuredCloneScope is useful to know where the cloned/transferred
|
|
|
|
// data can be read and written. Additional checks about the nature of the
|
|
|
|
// objects will be done based on this scope value because not all the
|
|
|
|
// objects can be sent between threads or processes.
|
2015-09-30 15:22:08 +03:00
|
|
|
explicit StructuredCloneHolder(CloningSupport aSupportsCloning,
|
2015-09-02 19:20:30 +03:00
|
|
|
TransferringSupport aSupportsTransferring,
|
2016-07-21 16:29:42 +03:00
|
|
|
StructuredCloneScope aStructuredCloneScope);
|
2015-09-30 15:22:08 +03:00
|
|
|
virtual ~StructuredCloneHolder();
|
2015-07-22 21:37:18 +03:00
|
|
|
|
2018-05-15 21:19:47 +03:00
|
|
|
StructuredCloneHolder(StructuredCloneHolder&& aOther) = delete;
|
2016-08-10 09:18:29 +03:00
|
|
|
|
2015-07-28 13:47:36 +03:00
|
|
|
// Normally you should just use Write() and Read().
|
|
|
|
|
2015-07-31 03:38:00 +03:00
|
|
|
void Write(JSContext* aCx,
|
|
|
|
JS::Handle<JS::Value> aValue,
|
|
|
|
ErrorResult &aRv);
|
2015-07-28 10:38:16 +03:00
|
|
|
|
2015-07-31 03:38:00 +03:00
|
|
|
void Write(JSContext* aCx,
|
2015-07-22 21:37:18 +03:00
|
|
|
JS::Handle<JS::Value> aValue,
|
2015-07-31 03:38:00 +03:00
|
|
|
JS::Handle<JS::Value> aTransfer,
|
2016-10-24 16:14:45 +03:00
|
|
|
JS::CloneDataPolicy cloneDataPolicy,
|
2015-07-31 03:38:00 +03:00
|
|
|
ErrorResult &aRv);
|
2015-07-22 21:37:18 +03:00
|
|
|
|
2015-07-31 03:38:00 +03:00
|
|
|
void Read(nsISupports* aParent,
|
2015-07-22 21:37:18 +03:00
|
|
|
JSContext* aCx,
|
2015-07-31 03:38:00 +03:00
|
|
|
JS::MutableHandle<JS::Value> aValue,
|
|
|
|
ErrorResult &aRv);
|
2015-07-22 21:37:18 +03:00
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// Call this method to know if this object is keeping some DOM object alive.
|
2015-08-26 15:17:23 +03:00
|
|
|
bool HasClonedDOMObjects() const
|
|
|
|
{
|
|
|
|
return !mBlobImplArray.IsEmpty() ||
|
2016-10-28 15:44:04 +03:00
|
|
|
!mWasmModuleArray.IsEmpty() ||
|
2017-04-05 20:02:57 +03:00
|
|
|
!mClonedSurfaces.IsEmpty() ||
|
|
|
|
!mInputStreamArray.IsEmpty();
|
2015-08-26 15:17:23 +03:00
|
|
|
}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<BlobImpl>>& BlobImpls()
|
2015-07-28 10:38:16 +03:00
|
|
|
{
|
2015-07-28 13:47:36 +03:00
|
|
|
MOZ_ASSERT(mSupportsCloning, "Blobs cannot be taken/set if cloning is not supported.");
|
2015-07-28 10:38:16 +03:00
|
|
|
return mBlobImplArray;
|
|
|
|
}
|
|
|
|
|
2016-10-28 15:44:04 +03:00
|
|
|
nsTArray<RefPtr<JS::WasmModule>>& WasmModules()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mSupportsCloning, "WasmModules cannot be taken/set if cloning is not supported.");
|
|
|
|
return mWasmModuleArray;
|
|
|
|
}
|
|
|
|
|
2017-04-05 20:02:57 +03:00
|
|
|
nsTArray<nsCOMPtr<nsIInputStream>>& InputStreams()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mSupportsCloning, "InputStreams cannot be taken/set if cloning is not supported.");
|
|
|
|
return mInputStreamArray;
|
|
|
|
}
|
|
|
|
|
2016-07-21 16:29:42 +03:00
|
|
|
StructuredCloneScope CloneScope() const
|
2016-07-14 10:01:31 +03:00
|
|
|
{
|
2016-07-21 16:29:42 +03:00
|
|
|
return mStructuredCloneScope;
|
2016-07-14 10:01:31 +03:00
|
|
|
}
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// The parent object is set internally just during the Read(). This method
|
|
|
|
// can be used by read functions to retrieve it.
|
2015-08-27 19:19:13 +03:00
|
|
|
nsISupports* ParentDuringRead() const
|
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This must be called if the transferring has ports generated by Read().
|
|
|
|
// MessagePorts are not thread-safe and they must be retrieved in the thread
|
|
|
|
// where they are created.
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<MessagePort>>&& TakeTransferredPorts()
|
2015-07-22 21:37:18 +03:00
|
|
|
{
|
2015-07-28 10:38:16 +03:00
|
|
|
MOZ_ASSERT(mSupportsTransferring);
|
2018-05-30 22:15:35 +03:00
|
|
|
return std::move(mTransferredPorts);
|
2015-07-22 21:37:18 +03:00
|
|
|
}
|
|
|
|
|
2016-10-26 23:00:17 +03:00
|
|
|
// This method uses TakeTransferredPorts() to populate a sequence of
|
|
|
|
// MessagePorts for WebIDL binding classes.
|
|
|
|
bool
|
|
|
|
TakeTransferredPortsAsSequence(Sequence<OwningNonNull<mozilla::dom::MessagePort>>& aPorts);
|
|
|
|
|
2016-02-15 21:43:00 +03:00
|
|
|
nsTArray<MessagePortIdentifier>& PortIdentifiers() const
|
2015-07-28 13:47:36 +03:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(mSupportsTransferring);
|
|
|
|
return mPortIdentifiers;
|
|
|
|
}
|
|
|
|
|
2015-12-18 09:52:16 +03:00
|
|
|
nsTArray<RefPtr<gfx::DataSourceSurface>>& GetSurfaces()
|
2015-07-30 21:50:00 +03:00
|
|
|
{
|
2015-12-18 09:52:16 +03:00
|
|
|
return mClonedSurfaces;
|
2015-07-30 21:50:00 +03:00
|
|
|
}
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// Implementations of the virtual methods to allow cloning of objects which
|
|
|
|
// JS engine itself doesn't clone.
|
|
|
|
|
|
|
|
virtual JSObject* CustomReadHandler(JSContext* aCx,
|
|
|
|
JSStructuredCloneReader* aReader,
|
|
|
|
uint32_t aTag,
|
|
|
|
uint32_t aIndex) override;
|
|
|
|
|
|
|
|
virtual bool CustomWriteHandler(JSContext* aCx,
|
|
|
|
JSStructuredCloneWriter* aWriter,
|
|
|
|
JS::Handle<JSObject*> aObj) override;
|
|
|
|
|
|
|
|
virtual bool CustomReadTransferHandler(JSContext* aCx,
|
|
|
|
JSStructuredCloneReader* aReader,
|
|
|
|
uint32_t aTag,
|
|
|
|
void* aContent,
|
|
|
|
uint64_t aExtraData,
|
|
|
|
JS::MutableHandleObject aReturnObject) override;
|
|
|
|
|
|
|
|
virtual bool CustomWriteTransferHandler(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aObj,
|
|
|
|
uint32_t* aTag,
|
|
|
|
JS::TransferableOwnership* aOwnership,
|
|
|
|
void** aContent,
|
|
|
|
uint64_t* aExtraData) override;
|
|
|
|
|
|
|
|
virtual void CustomFreeTransferHandler(uint32_t aTag,
|
|
|
|
JS::TransferableOwnership aOwnership,
|
|
|
|
void* aContent,
|
|
|
|
uint64_t aExtraData) override;
|
|
|
|
|
2018-03-28 10:23:17 +03:00
|
|
|
virtual bool CustomCanTransferHandler(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aObj) override;
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// These 2 static methods are useful to read/write fully serializable objects.
|
|
|
|
// They can be used by custom StructuredCloneHolderBase classes to
|
|
|
|
// serialize objects such as ImageData, CryptoKey, RTCCertificate, etc.
|
2015-09-14 20:05:44 +03:00
|
|
|
|
|
|
|
static JSObject* ReadFullySerializableObjects(JSContext* aCx,
|
|
|
|
JSStructuredCloneReader* aReader,
|
2015-10-07 22:32:14 +03:00
|
|
|
uint32_t aTag);
|
2015-09-14 20:05:44 +03:00
|
|
|
|
|
|
|
static bool WriteFullySerializableObjects(JSContext* aCx,
|
|
|
|
JSStructuredCloneWriter* aWriter,
|
|
|
|
JS::Handle<JSObject*> aObj);
|
|
|
|
|
2016-04-22 13:04:20 +03:00
|
|
|
static const JSStructuredCloneCallbacks sCallbacks;
|
|
|
|
|
2015-09-02 19:20:30 +03:00
|
|
|
protected:
|
2015-09-09 10:11:38 +03:00
|
|
|
// If you receive a buffer from IPC, you can use this method to retrieve a
|
|
|
|
// JS::Value. It can happen that you want to pre-populate the array of Blobs
|
|
|
|
// and/or the PortIdentifiers.
|
|
|
|
void ReadFromBuffer(nsISupports* aParent,
|
|
|
|
JSContext* aCx,
|
2016-04-22 13:04:20 +03:00
|
|
|
JSStructuredCloneData& aBuffer,
|
2015-09-09 10:11:38 +03:00
|
|
|
JS::MutableHandle<JS::Value> aValue,
|
|
|
|
ErrorResult &aRv);
|
|
|
|
|
|
|
|
void ReadFromBuffer(nsISupports* aParent,
|
|
|
|
JSContext* aCx,
|
2016-04-22 13:04:20 +03:00
|
|
|
JSStructuredCloneData& aBuffer,
|
2015-09-09 10:11:38 +03:00
|
|
|
uint32_t aAlgorithmVersion,
|
|
|
|
JS::MutableHandle<JS::Value> aValue,
|
|
|
|
ErrorResult &aRv);
|
|
|
|
|
2015-07-28 10:38:16 +03:00
|
|
|
bool mSupportsCloning;
|
|
|
|
bool mSupportsTransferring;
|
2015-07-22 21:37:18 +03:00
|
|
|
|
2017-07-26 00:53:41 +03:00
|
|
|
// SizeOfExcludingThis is inherited from StructuredCloneHolderBase. It doesn't
|
|
|
|
// account for objects in the following arrays because a) they're not expected
|
|
|
|
// to be stored in long-lived StructuredCloneHolder objects, and b) in the
|
|
|
|
// case of BlobImpl objects, MemoryBlobImpls have their own memory reporters,
|
|
|
|
// and the other types do not hold significant amounts of memory alive.
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// Used for cloning blobs in the structured cloning algorithm.
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<BlobImpl>> mBlobImplArray;
|
2015-07-22 21:37:18 +03:00
|
|
|
|
2016-10-28 15:44:04 +03:00
|
|
|
// Used for cloning JS::WasmModules in the structured cloning algorithm.
|
|
|
|
nsTArray<RefPtr<JS::WasmModule>> mWasmModuleArray;
|
|
|
|
|
2017-04-05 20:02:57 +03:00
|
|
|
// Used for cloning InputStream in the structured cloning algorithm.
|
|
|
|
nsTArray<nsCOMPtr<nsIInputStream>> mInputStreamArray;
|
|
|
|
|
2015-07-30 21:50:00 +03:00
|
|
|
// This is used for sharing the backend of ImageBitmaps.
|
2015-12-18 09:52:16 +03:00
|
|
|
// The DataSourceSurface object must be thread-safely reference-counted.
|
|
|
|
// The DataSourceSurface object will not be written ever via any ImageBitmap
|
2015-07-30 21:50:00 +03:00
|
|
|
// instance, so no race condition will occur.
|
2015-12-18 09:52:16 +03:00
|
|
|
nsTArray<RefPtr<gfx::DataSourceSurface>> mClonedSurfaces;
|
2015-07-30 21:50:00 +03:00
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
// This raw pointer is only set within ::Read() and is unset by the end.
|
2015-07-22 21:37:18 +03:00
|
|
|
nsISupports* MOZ_NON_OWNING_REF mParent;
|
|
|
|
|
|
|
|
// This array contains the ports once we've finished the reading. It's
|
|
|
|
// generated from the mPortIdentifiers array.
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<MessagePort>> mTransferredPorts;
|
2015-07-22 21:37:18 +03:00
|
|
|
|
|
|
|
// This array contains the identifiers of the MessagePorts. Based on these we
|
|
|
|
// are able to reconnect the new transferred ports with the other
|
|
|
|
// MessageChannel ports.
|
2016-02-15 21:43:00 +03:00
|
|
|
mutable nsTArray<MessagePortIdentifier> mPortIdentifiers;
|
2015-09-02 19:20:30 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2017-06-01 23:42:05 +03:00
|
|
|
nsCOMPtr<nsIEventTarget> mCreationEventTarget;
|
2015-09-02 19:20:30 +03:00
|
|
|
#endif
|
2015-07-22 21:37:18 +03:00
|
|
|
};
|
|
|
|
|
2015-07-19 10:54:41 +03:00
|
|
|
} // dom namespace
|
|
|
|
} // mozilla namespace
|
|
|
|
|
2015-09-30 15:22:08 +03:00
|
|
|
#endif // mozilla_dom_StructuredCloneHolder_h
|