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"
15 // CHANGING THE ORDER/PLACEMENT OF EXISTING ENUM VALUES MAY BREAK INDEXEDDB.
16 // PROCEED WITH EXTREME CAUTION.
18 // If you are planning to add new tags which could be used by IndexedDB,
19 // consider to use empty slots. See EMPTY_SLOT_x
20 enum StructuredCloneTags
{
21 SCTAG_BASE
= JS_SCTAG_USER_MIN
,
23 // IMPORTANT: Don't change the order of these enum values. You could break
26 // IMPORTANT: Don't change the order of these enum values. You could break
28 // This tag is obsolete and exists only for backwards compatibility with
29 // existing IndexedDB databases.
30 SCTAG_DOM_FILE_WITHOUT_LASTMODIFIEDDATE
,
31 // IMPORTANT: Don't change the order of these enum values. You could break
34 // IMPORTANT: Don't change the order of these enum values. You could break
36 SCTAG_DOM_MUTABLEFILE
,
37 // IMPORTANT: Don't change the order of these enum values. You could break
40 // IMPORTANT: Don't change the order of these enum values. You could break
42 SCTAG_DOM_WASM_MODULE
,
44 // IMPORTANT: Don't change the order of these enum values. You could break
49 SCTAG_DOM_DOMPOINTREADONLY
,
51 // IMPORTANT: Don't change the order of these enum values. You could break
53 // This tag is for WebCrypto keys
56 // IMPORTANT: Don't change the order of these enum values. You could break
58 SCTAG_DOM_NULL_PRINCIPAL
,
59 // IMPORTANT: Don't change the order of these enum values. You could break
61 SCTAG_DOM_SYSTEM_PRINCIPAL
,
62 // IMPORTANT: Don't change the order of these enum values. You could break
64 SCTAG_DOM_CONTENT_PRINCIPAL
,
66 // IMPORTANT: Don't change the order of these enum values. You could break
70 // IMPORTANT: Don't change the order of these enum values. You could break
72 SCTAG_DOM_RTCCERTIFICATE
,
74 // IMPORTANT: Don't change the order of these enum values. You could break
77 // IMPORTANT: Don't change the order of these enum values. You could break
79 SCTAG_DOM_DOMRECTREADONLY
,
81 // IMPORTANT: Don't change the order of these enum values. You could break
83 SCTAG_DOM_EXPANDED_PRINCIPAL
,
85 // IMPORTANT: Don't change the order of these enum values. You could break
89 // IMPORTANT: Don't change the order of these enum values. You could break
91 SCTAG_DOM_URLSEARCHPARAMS
,
93 // IMPORTANT: Don't change the order of these enum values. You could break
95 SCTAG_DOM_DOMMATRIXREADONLY
,
97 // IMPORTANT: Don't change the order of these enum values. You could break
101 // IMPORTANT: Don't change the order of these enum values. You could break
105 // IMPORTANT: Don't change the order of these enum values. You could break
107 SCTAG_DOM_STRUCTUREDCLONETESTER
,
109 // If you are planning to add new tags which could be used by IndexedDB,
110 // consider to use empty slots. See EMPTY_SLOT_x
112 // Please update the static assertions in StructuredCloneHolder.cpp and in
113 // IDBObjectStore.cpp, method CommonStructuredCloneReadCallback.
115 // --------------------------------------------------------------------------
117 // All the following tags are not written to disk and they are not used by
118 // IndexedDB directly or via
119 // StructuredCloneHolder::{Read,Write}FullySerializableObjects. In theory they
120 // can be 'less' stable.
122 // Principal written out by worker threads when serializing objects. When
123 // reading on the main thread this principal will be converted to a normal
124 // principal object using nsJSPrincipals::AutoSetActiveWorkerPrincipal.
125 SCTAG_DOM_WORKER_PRINCIPAL
,
127 SCTAG_DOM_IMAGEBITMAP
,
128 SCTAG_DOM_MAP_MESSAGEPORT
,
131 // This tag is for OffscreenCanvas.
136 SCTAG_DOM_INPUTSTREAM
,
138 SCTAG_DOM_STRUCTURED_CLONE_HOLDER
,
140 SCTAG_DOM_BROWSING_CONTEXT
,
142 SCTAG_DOM_CLONED_ERROR_OBJECT
,
144 // IMPORTANT: If you plan to add an new IDB tag, it _must_ be add before the
145 // "less stable" tags!
149 } // namespace mozilla
151 #endif // StructuredCloneTags_h__