/work/obj-fuzz/dist/include/mozilla/dom/RangeBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM Range.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_RangeBinding_h |
4 | | #define mozilla_dom_RangeBinding_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/DOMRect.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrototypeList.h" |
14 | | |
15 | | class nsRange; |
16 | | struct nsRangeAtoms; |
17 | | |
18 | | namespace mozilla { |
19 | | namespace dom { |
20 | | |
21 | | struct ClientRectsAndTextsAtoms; |
22 | | class DOMRectList; |
23 | | struct NativePropertyHooks; |
24 | | class ProtoAndIfaceCache; |
25 | | |
26 | | } // namespace dom |
27 | | } // namespace mozilla |
28 | | |
29 | | namespace mozilla { |
30 | | namespace dom { |
31 | | |
32 | | struct ClientRectsAndTexts : public DictionaryBase |
33 | | { |
34 | | MOZ_INIT_OUTSIDE_CTOR OwningNonNull<mozilla::dom::DOMRectList> mRectList; |
35 | | MOZ_INIT_OUTSIDE_CTOR Sequence<nsString> mTextList; |
36 | | |
37 | | ClientRectsAndTexts(); |
38 | | |
39 | | explicit inline ClientRectsAndTexts(const FastDictionaryInitializer& ) |
40 | 0 | { |
41 | 0 | // Do nothing here; this is used by our "Fast" subclass |
42 | 0 | } |
43 | | |
44 | | explicit inline ClientRectsAndTexts(const ClientRectsAndTexts& aOther) |
45 | 0 | { |
46 | 0 | *this = aOther; |
47 | 0 | } |
48 | | |
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 | | inline void |
59 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
60 | 0 | { |
61 | 0 | ImplCycleCollectionTraverse(aCallback, mRectList, "mRectList", aFlags); |
62 | 0 | } |
63 | | |
64 | | inline void |
65 | | UnlinkForCC() |
66 | 0 | { |
67 | 0 | ImplCycleCollectionUnlink(mRectList); |
68 | 0 | } |
69 | | |
70 | | ClientRectsAndTexts& |
71 | | operator=(const ClientRectsAndTexts& aOther); |
72 | | |
73 | | private: |
74 | | static bool |
75 | | InitIds(JSContext* cx, ClientRectsAndTextsAtoms* atomsCache); |
76 | | }; |
77 | | |
78 | | namespace binding_detail { |
79 | | struct FastClientRectsAndTexts : public ClientRectsAndTexts |
80 | | { |
81 | | inline FastClientRectsAndTexts() |
82 | | : ClientRectsAndTexts(FastDictionaryInitializer()) |
83 | 0 | { |
84 | 0 | // Doesn't matter what int we pass to the parent constructor |
85 | 0 | } |
86 | | }; |
87 | | } // namespace binding_detail |
88 | | |
89 | | |
90 | | namespace Range_Binding { |
91 | | |
92 | | typedef nsRange NativeType; |
93 | | |
94 | | static const uint16_t START_TO_START = 0; |
95 | | static const uint16_t START_TO_END = 1; |
96 | | static const uint16_t END_TO_END = 2; |
97 | | static const uint16_t END_TO_START = 3; |
98 | | const JSClass* |
99 | | GetJSClass(); |
100 | | |
101 | | bool |
102 | | Wrap(JSContext* aCx, nsRange* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
103 | | |
104 | | template <class T> |
105 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
106 | 0 | { |
107 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
108 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
109 | 0 | } |
110 | | |
111 | | // We declare this as an array so that retrieving a pointer to this |
112 | | // binding's property hooks only requires compile/link-time resolvable |
113 | | // address arithmetic. Declaring it as a pointer instead would require |
114 | | // doing a run-time load to fetch a pointer to this binding's property |
115 | | // hooks. And then structures which embedded a pointer to this structure |
116 | | // would require a run-time load for proper initialization, which would |
117 | | // then induce static constructors. Lots of static constructors. |
118 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
119 | | |
120 | | void |
121 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
122 | | |
123 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
124 | 0 | { |
125 | 0 | /* Get the interface prototype object for this class. This will create the |
126 | 0 | object as needed. */ |
127 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::Range, |
128 | 0 | &CreateInterfaceObjects, |
129 | 0 | /* aDefineOnGlobal = */ true); |
130 | 0 |
|
131 | 0 | } |
132 | | |
133 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
134 | 0 | { |
135 | 0 | /* Get the interface object for this class. This will create the object as |
136 | 0 | needed. */ |
137 | 0 |
|
138 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::Range, |
139 | 0 | &CreateInterfaceObjects, |
140 | 0 | aDefineOnGlobal); |
141 | 0 | } |
142 | | |
143 | | JSObject* |
144 | | GetConstructorObject(JSContext* aCx); |
145 | | |
146 | | } // namespace Range_Binding |
147 | | |
148 | | |
149 | | |
150 | | } // namespace dom |
151 | | } // namespace mozilla |
152 | | |
153 | | #endif // mozilla_dom_RangeBinding_h |