1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef StructuredCloneTags_h__
8 #define StructuredCloneTags_h__
10 #include "js/StructuredClone.h"
12 namespace mozilla::dom
{
14 // CHANGING THE ORDER/PLACEMENT OF EXISTING ENUM VALUES MAY BREAK INDEXEDDB.
15 // PROCEED WITH EXTREME CAUTION.
17 // If you are planning to add new tags which could be used by IndexedDB,
18 // consider to use empty slots. See EMPTY_SLOT_x
19 enum StructuredCloneTags
: uint32_t {
20 SCTAG_BASE
= JS_SCTAG_USER_MIN
,
22 // IMPORTANT: Don't change the order of these enum values. You could break
25 // IMPORTANT: Don't change the order of these enum values. You could break
27 // This tag is obsolete and exists only for backwards compatibility with
28 // existing IndexedDB databases.
29 SCTAG_DOM_FILE_WITHOUT_LASTMODIFIEDDATE
,
30 // IMPORTANT: Don't change the order of these enum values. You could break
33 // IMPORTANT: Don't change the order of these enum values. You could break
35 SCTAG_DOM_MUTABLEFILE
,
36 // IMPORTANT: Don't change the order of these enum values. You could break
39 // IMPORTANT: Don't change the order of these enum values. You could break
41 SCTAG_DOM_WASM_MODULE
,
43 // IMPORTANT: Don't change the order of these enum values. You could break
48 SCTAG_DOM_DOMPOINTREADONLY
,
50 // IMPORTANT: Don't change the order of these enum values. You could break
52 // This tag is for WebCrypto keys
55 // IMPORTANT: Don't change the order of these enum values. You could break
57 SCTAG_DOM_NULL_PRINCIPAL
,
58 // IMPORTANT: Don't change the order of these enum values. You could break
60 SCTAG_DOM_SYSTEM_PRINCIPAL
,
61 // IMPORTANT: Don't change the order of these enum values. You could break
63 SCTAG_DOM_CONTENT_PRINCIPAL
,
65 // IMPORTANT: Don't change the order of these enum values. You could break
69 // IMPORTANT: Don't change the order of these enum values. You could break
71 SCTAG_DOM_RTCCERTIFICATE
,
73 // IMPORTANT: Don't change the order of these enum values. You could break
76 // IMPORTANT: Don't change the order of these enum values. You could break
78 SCTAG_DOM_DOMRECTREADONLY
,
80 // IMPORTANT: Don't change the order of these enum values. You could break
82 SCTAG_DOM_EXPANDED_PRINCIPAL
,
84 // IMPORTANT: Don't change the order of these enum values. You could break
88 // IMPORTANT: Don't change the order of these enum values. You could break
90 SCTAG_DOM_URLSEARCHPARAMS
,
92 // IMPORTANT: Don't change the order of these enum values. You could break
94 SCTAG_DOM_DOMMATRIXREADONLY
,
96 // IMPORTANT: Don't change the order of these enum values. You could break
98 SCTAG_DOM_DOMEXCEPTION
,
100 // IMPORTANT: Don't change the order of these enum values. You could break
104 // IMPORTANT: Don't change the order of these enum values. You could break
106 SCTAG_DOM_STRUCTUREDCLONETESTER
,
108 // IMPORTANT: Don't change the order of these enum values. You could break
110 SCTAG_DOM_FILESYSTEMHANDLE
,
112 // IMPORTANT: Don't change the order of these enum values. You could break
114 SCTAG_DOM_FILESYSTEMFILEHANDLE
,
116 // IMPORTANT: Don't change the order of these enum values. You could break
118 SCTAG_DOM_FILESYSTEMDIRECTORYHANDLE
,
120 // If you are planning to add new tags which could be used by IndexedDB,
121 // consider to use an empty slot. See EMPTY_SLOT_x
123 // Please update the static assertions in StructuredCloneHolder.cpp and in
124 // IDBObjectStore.cpp, method CommonStructuredCloneReadCallback.
126 // --------------------------------------------------------------------------
128 // All the following tags are not written to disk and they are not used by
129 // IndexedDB directly or via
130 // StructuredCloneHolder::{Read,Write}FullySerializableObjects. In theory they
131 // can be 'less' stable.
133 SCTAG_DOM_IMAGEBITMAP
,
134 SCTAG_DOM_MAP_MESSAGEPORT
,
137 // This tag is for OffscreenCanvas.
142 SCTAG_DOM_INPUTSTREAM
,
144 SCTAG_DOM_STRUCTURED_CLONE_HOLDER
,
146 SCTAG_DOM_BROWSING_CONTEXT
,
148 SCTAG_DOM_CLONED_ERROR_OBJECT
,
150 SCTAG_DOM_READABLESTREAM
,
152 SCTAG_DOM_WRITABLESTREAM
,
154 SCTAG_DOM_TRANSFORMSTREAM
,
156 SCTAG_DOM_VIDEOFRAME
,
158 SCTAG_DOM_ENCODEDVIDEOCHUNK
,
162 SCTAG_DOM_ENCODEDAUDIOCHUNK
,
164 // IMPORTANT: If you plan to add an new IDB tag, it _must_ be add before the
165 // "less stable" tags!
168 } // namespace mozilla::dom
170 #endif // StructuredCloneTags_h__