Interface nsIStructuredCloneContainerType

This interface acts as a container for an object serialized using the structured clone algorithm.

You can copy an object into an nsIStructuredCloneContainer using initFromJSVal or initFromBase64. It's an error to initialize an nsIStructuredCloneContainer more than once.

Once you've initialized the container, you can get a copy of the object it stores by calling deserializeToVariant. You can also get a base-64-encoded string containing a copy of the container's serialized data, using getDataAsBase64.

Hierarchy

Properties

formatVersion: number

Get the version of the structured clone algorithm which was used to generate this container's serialized buffer.

serializedNBytes: number

Get the size in bytes of this container's serialized data.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Deserializes this structured clone container returning it as a jsval. Can be called on main and worker threads.

    Returns any

  • Get this structured clone container's data as a base-64-encoded string.

    Returns string

  • Initialize this structured clone container from a base-64-encoded byte stream, stored in aData. aFormatVersion should be the version of the structured clone algorithm which was used to generate aData.

    Parameters

    • aData: string
    • aFormatVersion: number

    Returns void

  • Initialize this structured clone container so it contains a clone of the given jsval.

    Parameters

    • aData: any

    Returns void

Generated using TypeDoc