StructuredCloneTags.h (5164B)
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/. */ 6 7 #ifndef StructuredCloneTags_h__ 8 #define StructuredCloneTags_h__ 9 10 #include "js/StructuredClone.h" 11 12 namespace mozilla::dom { 13 14 // CHANGING THE ORDER/PLACEMENT OF EXISTING ENUM VALUES MAY BREAK INDEXEDDB. 15 // PROCEED WITH EXTREME CAUTION. 16 // 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, 21 22 // IMPORTANT: Don't change the order of these enum values. You could break 23 // IDB. 24 SCTAG_DOM_BLOB, 25 // IMPORTANT: Don't change the order of these enum values. You could break 26 // IDB. 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 31 // IDB. 32 SCTAG_DOM_FILELIST, 33 // IMPORTANT: Don't change the order of these enum values. You could break 34 // IDB. 35 SCTAG_DOM_MUTABLEFILE, 36 // IMPORTANT: Don't change the order of these enum values. You could break 37 // IDB. 38 SCTAG_DOM_FILE, 39 // IMPORTANT: Don't change the order of these enum values. You could break 40 // IDB. 41 SCTAG_DOM_WASM_MODULE, 42 43 // IMPORTANT: Don't change the order of these enum values. You could break 44 // IDB. 45 SCTAG_DOM_IMAGEDATA, 46 47 SCTAG_DOM_DOMPOINT, 48 SCTAG_DOM_DOMPOINTREADONLY, 49 50 // IMPORTANT: Don't change the order of these enum values. You could break 51 // IDB. 52 // This tag is for WebCrypto keys 53 SCTAG_DOM_CRYPTOKEY, 54 55 // IMPORTANT: Don't change the order of these enum values. You could break 56 // IDB. 57 SCTAG_DOM_NULL_PRINCIPAL, 58 // IMPORTANT: Don't change the order of these enum values. You could break 59 // IDB. 60 SCTAG_DOM_SYSTEM_PRINCIPAL, 61 // IMPORTANT: Don't change the order of these enum values. You could break 62 // IDB. 63 SCTAG_DOM_CONTENT_PRINCIPAL, 64 65 // IMPORTANT: Don't change the order of these enum values. You could break 66 // IDB. 67 SCTAG_DOM_DOMQUAD, 68 69 // IMPORTANT: Don't change the order of these enum values. You could break 70 // IDB. 71 SCTAG_DOM_RTCCERTIFICATE, 72 73 // IMPORTANT: Don't change the order of these enum values. You could break 74 // IDB. 75 SCTAG_DOM_DOMRECT, 76 // IMPORTANT: Don't change the order of these enum values. You could break 77 // IDB. 78 SCTAG_DOM_DOMRECTREADONLY, 79 80 // IMPORTANT: Don't change the order of these enum values. You could break 81 // IDB. 82 SCTAG_DOM_EXPANDED_PRINCIPAL, 83 84 // IMPORTANT: Don't change the order of these enum values. You could break 85 // IDB. 86 SCTAG_DOM_DOMMATRIX, 87 88 // IMPORTANT: Don't change the order of these enum values. You could break 89 // IDB. 90 SCTAG_DOM_URLSEARCHPARAMS, 91 92 // IMPORTANT: Don't change the order of these enum values. You could break 93 // IDB. 94 SCTAG_DOM_DOMMATRIXREADONLY, 95 96 // IMPORTANT: Don't change the order of these enum values. You could break 97 // IDB. 98 SCTAG_DOM_DOMEXCEPTION, 99 100 // IMPORTANT: Don't change the order of these enum values. You could break 101 // IDB. 102 EMPTY_SLOT_9, 103 104 // IMPORTANT: Don't change the order of these enum values. You could break 105 // IDB. 106 SCTAG_DOM_STRUCTUREDCLONETESTER, 107 108 // IMPORTANT: Don't change the order of these enum values. You could break 109 // IDB. 110 SCTAG_DOM_FILESYSTEMHANDLE, 111 112 // IMPORTANT: Don't change the order of these enum values. You could break 113 // IDB. 114 SCTAG_DOM_FILESYSTEMFILEHANDLE, 115 116 // IMPORTANT: Don't change the order of these enum values. You could break 117 // IDB. 118 SCTAG_DOM_FILESYSTEMDIRECTORYHANDLE, 119 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 122 123 // Please update the static assertions in StructuredCloneHolder.cpp and in 124 // IDBObjectStore.cpp, method CommonStructuredCloneReadCallback. 125 126 // -------------------------------------------------------------------------- 127 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. 132 133 SCTAG_DOM_IMAGEBITMAP, 134 SCTAG_DOM_MAP_MESSAGEPORT, 135 SCTAG_DOM_FORMDATA, 136 137 // This tag is for OffscreenCanvas. 138 SCTAG_DOM_CANVAS, 139 140 SCTAG_DOM_DIRECTORY, 141 142 SCTAG_DOM_INPUTSTREAM, 143 144 SCTAG_DOM_STRUCTURED_CLONE_HOLDER, 145 146 SCTAG_DOM_BROWSING_CONTEXT, 147 148 SCTAG_DOM_CLONED_ERROR_OBJECT, 149 150 SCTAG_DOM_READABLESTREAM, 151 152 SCTAG_DOM_WRITABLESTREAM, 153 154 SCTAG_DOM_TRANSFORMSTREAM, 155 156 SCTAG_DOM_VIDEOFRAME, 157 158 SCTAG_DOM_ENCODEDVIDEOCHUNK, 159 160 SCTAG_DOM_AUDIODATA, 161 162 SCTAG_DOM_ENCODEDAUDIOCHUNK, 163 164 SCTAG_DOM_RTCDATACHANNEL, 165 166 SCTAG_DOM_RTCENCODEDVIDEOFRAME, 167 168 SCTAG_DOM_RTCENCODEDAUDIOFRAME, 169 170 // IMPORTANT: If you plan to add an new IDB tag, it _must_ be add before the 171 // "less stable" tags! 172 }; 173 174 } // namespace mozilla::dom 175 176 #endif // StructuredCloneTags_h__