/work/obj-fuzz/dist/include/mozilla/dom/EventBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM Event.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_EventBinding_h |
4 | | #define mozilla_dom_EventBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/ErrorResult.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | #include "mozilla/dom/Nullable.h" |
12 | | #include "mozilla/dom/PrototypeList.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | class Event; |
18 | | struct EventAtoms; |
19 | | struct EventInitAtoms; |
20 | | struct NativePropertyHooks; |
21 | | class ProtoAndIfaceCache; |
22 | | |
23 | | } // namespace dom |
24 | | } // namespace mozilla |
25 | | |
26 | | namespace mozilla { |
27 | | namespace dom { |
28 | | |
29 | | struct EventInit : public DictionaryBase |
30 | | { |
31 | | MOZ_INIT_OUTSIDE_CTOR bool mBubbles; |
32 | | MOZ_INIT_OUTSIDE_CTOR bool mCancelable; |
33 | | MOZ_INIT_OUTSIDE_CTOR bool mComposed; |
34 | | |
35 | | EventInit(); |
36 | | |
37 | | explicit inline EventInit(const FastDictionaryInitializer& ) |
38 | 0 | { |
39 | 0 | // Do nothing here; this is used by our "Fast" subclass |
40 | 0 | } |
41 | | |
42 | | explicit inline EventInit(const EventInit& aOther) |
43 | 0 | { |
44 | 0 | *this = aOther; |
45 | 0 | } |
46 | | |
47 | | bool |
48 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
49 | | |
50 | | bool |
51 | | Init(const nsAString& aJSON); |
52 | | |
53 | | bool |
54 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
55 | | |
56 | | bool |
57 | | ToJSON(nsAString& aJSON) const; |
58 | | |
59 | | void |
60 | | TraceDictionary(JSTracer* trc); |
61 | | |
62 | | EventInit& |
63 | | operator=(const EventInit& aOther); |
64 | | |
65 | | private: |
66 | | static bool |
67 | | InitIds(JSContext* cx, EventInitAtoms* atomsCache); |
68 | | }; |
69 | | |
70 | | namespace binding_detail { |
71 | | struct FastEventInit : public EventInit |
72 | | { |
73 | | inline FastEventInit() |
74 | | : EventInit(FastDictionaryInitializer()) |
75 | 0 | { |
76 | 0 | // Doesn't matter what int we pass to the parent constructor |
77 | 0 | } |
78 | | }; |
79 | | } // namespace binding_detail |
80 | | |
81 | | |
82 | | namespace Event_Binding { |
83 | | |
84 | | typedef mozilla::dom::Event NativeType; |
85 | | |
86 | | static const uint16_t NONE = 0; |
87 | | static const uint16_t CAPTURING_PHASE = 1; |
88 | | static const uint16_t AT_TARGET = 2; |
89 | | static const uint16_t BUBBLING_PHASE = 3; |
90 | | static const int32_t ALT_MASK = 1; |
91 | | static const int32_t CONTROL_MASK = 2; |
92 | | static const int32_t SHIFT_MASK = 4; |
93 | | static const int32_t META_MASK = 8; |
94 | | const JSClass* |
95 | | GetJSClass(); |
96 | | |
97 | | bool |
98 | | Wrap(JSContext* aCx, mozilla::dom::Event* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
99 | | |
100 | | template <class T> |
101 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
102 | 0 | { |
103 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
104 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
105 | 0 | } |
106 | | |
107 | | // We declare this as an array so that retrieving a pointer to this |
108 | | // binding's property hooks only requires compile/link-time resolvable |
109 | | // address arithmetic. Declaring it as a pointer instead would require |
110 | | // doing a run-time load to fetch a pointer to this binding's property |
111 | | // hooks. And then structures which embedded a pointer to this structure |
112 | | // would require a run-time load for proper initialization, which would |
113 | | // then induce static constructors. Lots of static constructors. |
114 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
115 | | |
116 | | void |
117 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
118 | | |
119 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
120 | 0 | { |
121 | 0 | /* Get the interface prototype object for this class. This will create the |
122 | 0 | object as needed. */ |
123 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::Event, |
124 | 0 | &CreateInterfaceObjects, |
125 | 0 | /* aDefineOnGlobal = */ true); |
126 | 0 |
|
127 | 0 | } |
128 | | |
129 | | JSObject* |
130 | | GetProtoObject(JSContext* aCx); |
131 | | |
132 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
133 | 0 | { |
134 | 0 | /* Get the interface object for this class. This will create the object as |
135 | 0 | needed. */ |
136 | 0 |
|
137 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::Event, |
138 | 0 | &CreateInterfaceObjects, |
139 | 0 | aDefineOnGlobal); |
140 | 0 | } |
141 | | |
142 | | JSObject* |
143 | | GetConstructorObject(JSContext* aCx); |
144 | | |
145 | | } // namespace Event_Binding |
146 | | |
147 | | |
148 | | |
149 | | } // namespace dom |
150 | | } // namespace mozilla |
151 | | |
152 | | #endif // mozilla_dom_EventBinding_h |