/work/obj-fuzz/dom/bindings/SVGZoomAndPanBinding.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM SVGZoomAndPan.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #include "SVGZoomAndPanBinding.h" |
4 | | #include "WrapperFactory.h" |
5 | | #include "mozilla/OwningNonNull.h" |
6 | | #include "mozilla/dom/BindingUtils.h" |
7 | | #include "mozilla/dom/DOMJSClass.h" |
8 | | #include "mozilla/dom/NonRefcountedDOMObject.h" |
9 | | #include "mozilla/dom/PrimitiveConversions.h" |
10 | | #include "mozilla/dom/XrayExpandoClass.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | namespace binding_detail {}; // Just to make sure it's known as a namespace |
16 | | using namespace mozilla::dom::binding_detail; |
17 | | |
18 | | |
19 | | namespace SVGZoomAndPan_Binding { |
20 | | |
21 | | // We deliberately use brace-elision to make Visual Studio produce better initalization code. |
22 | | #if defined(__clang__) |
23 | | #pragma clang diagnostic push |
24 | | #pragma clang diagnostic ignored "-Wmissing-braces" |
25 | | #endif |
26 | | static const ConstantSpec sConstants_specs[] = { |
27 | | { "SVG_ZOOMANDPAN_UNKNOWN", JS::Int32Value(0) }, |
28 | | { "SVG_ZOOMANDPAN_DISABLE", JS::Int32Value(1) }, |
29 | | { "SVG_ZOOMANDPAN_MAGNIFY", JS::Int32Value(2) }, |
30 | | { 0, JS::UndefinedValue() } |
31 | | }; |
32 | | #if defined(__clang__) |
33 | | #pragma clang diagnostic pop |
34 | | #endif |
35 | | |
36 | | |
37 | | static const Prefable<const ConstantSpec> sConstants[] = { |
38 | | { nullptr, &sConstants_specs[0] }, |
39 | | { nullptr, nullptr } |
40 | | }; |
41 | | |
42 | | static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX, |
43 | | "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)"); |
44 | | static_assert(3 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX, |
45 | | "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)"); |
46 | | |
47 | | |
48 | | static uint16_t sNativeProperties_sortedPropertyIndices[3]; |
49 | | static PropertyInfo sNativeProperties_propertyInfos[3]; |
50 | | |
51 | | static const NativePropertiesN<1> sNativeProperties = { |
52 | | false, 0, |
53 | | false, 0, |
54 | | false, 0, |
55 | | false, 0, |
56 | | false, 0, |
57 | | false, 0, |
58 | | true, 0 /* sConstants */, |
59 | | -1, |
60 | | 3, |
61 | | sNativeProperties_sortedPropertyIndices, |
62 | | { |
63 | | { sConstants, &sNativeProperties_propertyInfos[0] } |
64 | | } |
65 | | }; |
66 | | static_assert(3 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount), |
67 | | "We have a property info count that is oversized"); |
68 | | |
69 | | static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = { |
70 | | { |
71 | | "Function", |
72 | | JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE), |
73 | | &sBoringInterfaceObjectClassClassOps, |
74 | | JS_NULL_CLASS_SPEC, |
75 | | JS_NULL_CLASS_EXT, |
76 | | &sInterfaceObjectClassObjectOps |
77 | | }, |
78 | | eInterface, |
79 | | false, |
80 | | prototypes::id::_ID_Count, |
81 | | 0, |
82 | | sNativePropertyHooks, |
83 | | "function SVGZoomAndPan() {\n [native code]\n}", |
84 | | JS::GetRealmFunctionPrototype |
85 | | }; |
86 | | |
87 | | const NativePropertyHooks sNativePropertyHooks[] = { { |
88 | | nullptr, |
89 | | nullptr, |
90 | | nullptr, |
91 | | { sNativeProperties.Upcast(), nullptr }, |
92 | | prototypes::id::_ID_Count, |
93 | | constructors::id::SVGZoomAndPan, |
94 | | nullptr, |
95 | | &DefaultXrayExpandoObjectClass |
96 | | } }; |
97 | | |
98 | | void |
99 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal) |
100 | 0 | { |
101 | 0 | JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx)); |
102 | 0 | if (!constructorProto) { |
103 | 0 | return; |
104 | 0 | } |
105 | 0 | |
106 | 0 | static bool sIdsInited = false; |
107 | 0 | if (!sIdsInited && NS_IsMainThread()) { |
108 | 0 | if (!InitIds(aCx, sNativeProperties.Upcast())) { |
109 | 0 | return; |
110 | 0 | } |
111 | 0 | sIdsInited = true; |
112 | 0 | } |
113 | 0 |
|
114 | 0 | JS::Heap<JSObject*>* protoCache = nullptr; |
115 | 0 | JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGZoomAndPan); |
116 | 0 | dom::CreateInterfaceObjects(aCx, aGlobal, nullptr, |
117 | 0 | nullptr, protoCache, |
118 | 0 | nullptr, |
119 | 0 | constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr, |
120 | 0 | interfaceCache, |
121 | 0 | sNativeProperties.Upcast(), |
122 | 0 | nullptr, |
123 | 0 | "SVGZoomAndPan", aDefineOnGlobal, |
124 | 0 | nullptr, |
125 | 0 | false); |
126 | 0 | } |
127 | | |
128 | | JSObject* |
129 | | GetConstructorObject(JSContext* aCx) |
130 | 0 | { |
131 | 0 | return GetConstructorObjectHandle(aCx); |
132 | 0 | } |
133 | | |
134 | | } // namespace SVGZoomAndPan_Binding |
135 | | |
136 | | |
137 | | |
138 | | } // namespace dom |
139 | | } // namespace mozilla |