File: | var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/WebIDLSerializable.cpp |
Warning: | line 17, column 8 Excessive padding in 'struct mozilla::dom::WebIDLSerializableEntry' (10 padding bytes, where 2 is optimal). Optimal fields order: mDeserialize, mTag, mExposedGlobals, consider reordering the fields or adding explicit padding members |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | #include "DOMExceptionBinding.h" |
2 | #include "DOMMatrixBinding.h" |
3 | #include "DOMPointBinding.h" |
4 | #include "DOMQuadBinding.h" |
5 | #include "DOMRectBinding.h" |
6 | #include "FileSystemDirectoryHandleBinding.h" |
7 | #include "FileSystemFileHandleBinding.h" |
8 | #include "FileSystemHandleBinding.h" |
9 | #include "ImageDataBinding.h" |
10 | #include "RTCCertificateBinding.h" |
11 | #include "StructuredCloneTesterBinding.h" |
12 | #include "SubtleCryptoBinding.h" |
13 | #include "mozilla/PerfectHash.h" |
14 | #include "mozilla/dom/WebIDLSerializable.h" |
15 | |
16 | namespace mozilla::dom { |
17 | struct WebIDLSerializableEntry { |
Excessive padding in 'struct mozilla::dom::WebIDLSerializableEntry' (10 padding bytes, where 2 is optimal). Optimal fields order: mDeserialize, mTag, mExposedGlobals, consider reordering the fields or adding explicit padding members | |
18 | StructuredCloneTags mTag; |
19 | WebIDLDeserializer mDeserialize; |
20 | uint16_t mExposedGlobals; |
21 | }; |
22 | |
23 | static const WebIDLSerializableEntry sEntries[] = { |
24 | { |
25 | /* mTag */ SCTAG_DOM_CRYPTOKEY, |
26 | /* mDeserialize */ CryptoKey_Binding::Deserialize, |
27 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
28 | }, |
29 | { |
30 | /* mTag */ SCTAG_DOM_DOMEXCEPTION, |
31 | /* mDeserialize */ DOMException_Binding::Deserialize, |
32 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
33 | }, |
34 | { |
35 | /* mTag */ SCTAG_DOM_DOMMATRIX, |
36 | /* mDeserialize */ DOMMatrix_Binding::Deserialize, |
37 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
38 | }, |
39 | { |
40 | /* mTag */ SCTAG_DOM_DOMMATRIXREADONLY, |
41 | /* mDeserialize */ DOMMatrixReadOnly_Binding::Deserialize, |
42 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
43 | }, |
44 | { |
45 | /* mTag */ SCTAG_DOM_DOMPOINT, |
46 | /* mDeserialize */ DOMPoint_Binding::Deserialize, |
47 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
48 | }, |
49 | { |
50 | /* mTag */ SCTAG_DOM_DOMPOINTREADONLY, |
51 | /* mDeserialize */ DOMPointReadOnly_Binding::Deserialize, |
52 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
53 | }, |
54 | { |
55 | /* mTag */ SCTAG_DOM_DOMQUAD, |
56 | /* mDeserialize */ DOMQuad_Binding::Deserialize, |
57 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
58 | }, |
59 | { |
60 | /* mTag */ SCTAG_DOM_DOMRECT, |
61 | /* mDeserialize */ DOMRect_Binding::Deserialize, |
62 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
63 | }, |
64 | { |
65 | /* mTag */ SCTAG_DOM_DOMRECTREADONLY, |
66 | /* mDeserialize */ DOMRectReadOnly_Binding::Deserialize, |
67 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
68 | }, |
69 | { |
70 | /* mTag */ SCTAG_DOM_FILESYSTEMDIRECTORYHANDLE, |
71 | /* mDeserialize */ FileSystemDirectoryHandle_Binding::Deserialize, |
72 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
73 | }, |
74 | { |
75 | /* mTag */ SCTAG_DOM_FILESYSTEMFILEHANDLE, |
76 | /* mDeserialize */ FileSystemFileHandle_Binding::Deserialize, |
77 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
78 | }, |
79 | { |
80 | /* mTag */ SCTAG_DOM_FILESYSTEMHANDLE, |
81 | /* mDeserialize */ FileSystemHandle_Binding::Deserialize, |
82 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
83 | }, |
84 | { |
85 | /* mTag */ SCTAG_DOM_IMAGEDATA, |
86 | /* mDeserialize */ ImageData_Binding::Deserialize, |
87 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
88 | }, |
89 | { |
90 | /* mTag */ SCTAG_DOM_RTCCERTIFICATE, |
91 | /* mDeserialize */ RTCCertificate_Binding::Deserialize, |
92 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
93 | }, |
94 | { |
95 | /* mTag */ SCTAG_DOM_STRUCTUREDCLONETESTER, |
96 | /* mDeserialize */ StructuredCloneTester_Binding::Deserialize, |
97 | /* mExposedGlobals */ GlobalNames::DedicatedWorkerGlobalScope | GlobalNames::ServiceWorkerGlobalScope | GlobalNames::SharedWorkerGlobalScope | GlobalNames::Window, |
98 | } |
99 | }; |
100 | |
101 | Maybe<std::pair<uint16_t, WebIDLDeserializer>> LookupDeserializer(StructuredCloneTags aTag) { |
102 | for (auto& entry : sEntries) { |
103 | if (entry.mTag == aTag) { |
104 | return Some(std::pair(entry.mExposedGlobals, entry.mDeserialize)); |
105 | } |
106 | } |
107 | return Nothing(); |
108 | } |
109 | } // namespace mozilla::dom |
110 |