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