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 {
13 namespace dom {
14 
15 // CHANGING THE ORDER/PLACEMENT OF EXISTING ENUM VALUES MAY BREAK INDEXEDDB.
16 // PROCEED WITH EXTREME CAUTION.
17 enum StructuredCloneTags {
18   SCTAG_BASE = JS_SCTAG_USER_MIN,
19 
20   SCTAG_DOM_BLOB,
21 
22   // This tag is obsolete and exists only for backwards compatibility with
23   // existing IndexedDB databases.
24   SCTAG_DOM_FILE_WITHOUT_LASTMODIFIEDDATE,
25 
26   SCTAG_DOM_FILELIST,
27   SCTAG_DOM_MUTABLEFILE,
28   SCTAG_DOM_FILE,
29 
30   SCTAG_DOM_WASM,
31 
32   // New IDB tags go here!
33 
34   // These tags are used for both main thread and workers.
35   SCTAG_DOM_IMAGEDATA,
36   SCTAG_DOM_MAP_MESSAGEPORT,
37 
38   SCTAG_DOM_FUNCTION,
39 
40   // This tag is for WebCrypto keys
41   SCTAG_DOM_WEBCRYPTO_KEY,
42 
43   SCTAG_DOM_NULL_PRINCIPAL,
44   SCTAG_DOM_SYSTEM_PRINCIPAL,
45   SCTAG_DOM_CONTENT_PRINCIPAL,
46 
47   SCTAG_DOM_IMAGEBITMAP,
48 
49   SCTAG_DOM_RTC_CERTIFICATE,
50 
51   SCTAG_DOM_FORMDATA,
52 
53   // This tag is for OffscreenCanvas.
54   SCTAG_DOM_CANVAS,
55 
56   SCTAG_DOM_EXPANDED_PRINCIPAL,
57 
58   SCTAG_DOM_DIRECTORY,
59 
60   // This tag is used by both main thread and workers.
61   SCTAG_DOM_URLSEARCHPARAMS,
62 
63   SCTAG_DOM_INPUTSTREAM,
64 
65   SCTAG_DOM_STRUCTURED_CLONE_HOLDER,
66 
67   // When adding a new tag for IDB, please don't add it to the end of the list!
68   // Tags that are supported by IDB must not ever change. See the static assert
69   // in IDBObjectStore.cpp, method CommonStructuredCloneReadCallback.
70   // Adding to the end of the list would make removing of other tags harder in
71   // future.
72 
73   SCTAG_DOM_MAX
74 };
75 
76 }  // namespace dom
77 }  // namespace mozilla
78 
79 #endif  // StructuredCloneTags_h__
80