Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM CustomEvent.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_CustomEventBinding_h
4 : #define mozilla_dom_CustomEventBinding_h
5 :
6 : #include "EventBinding.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 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : class CustomEvent;
17 : struct CustomEventAtoms;
18 : struct CustomEventInitAtoms;
19 : struct NativePropertyHooks;
20 : class ProtoAndIfaceCache;
21 :
22 : } // namespace dom
23 : } // namespace mozilla
24 :
25 : namespace mozilla {
26 : namespace dom {
27 :
28 : struct CustomEventInit : public EventInit
29 : {
30 : MOZ_INIT_OUTSIDE_CTOR JS::Value mDetail;
31 :
32 : CustomEventInit();
33 :
34 9 : explicit inline CustomEventInit(const FastDictionaryInitializer& )
35 18 : : EventInit(FastDictionaryInitializer()),
36 18 : mDetail(JS::UndefinedValue())
37 : {
38 : // Do nothing here; this is used by our "Fast" subclass
39 9 : }
40 :
41 : private:
42 : CustomEventInit(const CustomEventInit&) = delete;
43 : CustomEventInit& operator=(const CustomEventInit&) = delete;
44 :
45 : static bool
46 : InitIds(JSContext* cx, CustomEventInitAtoms* atomsCache);
47 :
48 : public:
49 : bool
50 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
51 :
52 : bool
53 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
54 :
55 : void
56 : TraceDictionary(JSTracer* trc);
57 : };
58 :
59 : namespace binding_detail {
60 : struct FastCustomEventInit : public CustomEventInit
61 : {
62 9 : inline FastCustomEventInit()
63 9 : : CustomEventInit(FastDictionaryInitializer())
64 : {
65 : // Doesn't matter what int we pass to the parent constructor
66 9 : }
67 : };
68 : } // namespace binding_detail
69 :
70 :
71 : namespace CustomEventBinding {
72 :
73 : typedef mozilla::dom::CustomEvent NativeType;
74 :
75 : JSObject*
76 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
77 :
78 : const JSClass*
79 : GetJSClass();
80 :
81 : bool
82 : Wrap(JSContext* aCx, mozilla::dom::CustomEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
83 :
84 : template <class T>
85 9 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
86 : {
87 18 : JS::Rooted<JSObject*> reflector(aCx);
88 18 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
89 : }
90 :
91 : // We declare this as an array so that retrieving a pointer to this
92 : // binding's property hooks only requires compile/link-time resolvable
93 : // address arithmetic. Declaring it as a pointer instead would require
94 : // doing a run-time load to fetch a pointer to this binding's property
95 : // hooks. And then structures which embedded a pointer to this structure
96 : // would require a run-time load for proper initialization, which would
97 : // then induce static constructors. Lots of static constructors.
98 : extern const NativePropertyHooks sNativePropertyHooks[];
99 :
100 : void
101 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
102 :
103 : JS::Handle<JSObject*>
104 : GetProtoObjectHandle(JSContext* aCx);
105 :
106 : JS::Handle<JSObject*>
107 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
108 :
109 : JSObject*
110 : GetConstructorObject(JSContext* aCx);
111 :
112 : } // namespace CustomEventBinding
113 :
114 :
115 :
116 : } // namespace dom
117 : } // namespace mozilla
118 :
119 : #endif // mozilla_dom_CustomEventBinding_h
|