1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * A holder for structured-clonable data which can itself be cloned with
9 * little overhead, and deserialized into an arbitrary global.
11 [ChromeOnly, Exposed=*]
12 interface StructuredCloneHolder {
14 * Serializes the given value to an opaque structured clone blob, and
17 * The serialization happens in the compartment of the given global or, if no
18 * global is provided, the compartment of the data value.
20 * The name argument is added to the path of the object in
21 * memory reports, to make it easier to determine the source of leaks. In
22 * anonymized memory reports, the anonymized name is used instead. If
23 * anonymizedName is null, name is used in anonymized reports as well.
24 * Anonymized names should not contain any potentially private information,
25 * such as web URLs or user-provided data.
28 constructor(UTF8String name, UTF8String? anonymizedName,
29 any data, optional object? global = null);
32 * Deserializes the structured clone data in the scope of the given global,
33 * and returns the result.
35 * If `keepData` is true, the structured clone data is preserved, and can be
36 * deserialized repeatedly. Otherwise, it is immediately discarded.
39 any deserialize(object global, optional boolean keepData = false);