/work/obj-fuzz/dist/include/mozilla/dom/LocationBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM Location.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_LocationBinding_h |
4 | | #define mozilla_dom_LocationBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "jsapi.h" |
8 | | #include "mozilla/ErrorResult.h" |
9 | | #include "mozilla/dom/BindingDeclarations.h" |
10 | | #include "mozilla/dom/Nullable.h" |
11 | | #include "mozilla/dom/PrototypeList.h" |
12 | | |
13 | | namespace mozilla { |
14 | | namespace dom { |
15 | | |
16 | | class Location; |
17 | | struct LocationAtoms; |
18 | | struct NativePropertyHooks; |
19 | | class ProtoAndIfaceCache; |
20 | | |
21 | | } // namespace dom |
22 | | } // namespace mozilla |
23 | | |
24 | | namespace mozilla { |
25 | | namespace dom { |
26 | | |
27 | | namespace Location_Binding { |
28 | | |
29 | | typedef mozilla::dom::Location NativeType; |
30 | | |
31 | | bool |
32 | | Wrap(JSContext* aCx, mozilla::dom::Location* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
33 | | |
34 | | template <class T> |
35 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
36 | 0 | { |
37 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
38 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
39 | 0 | } |
40 | | |
41 | | // We declare this as an array so that retrieving a pointer to this |
42 | | // binding's property hooks only requires compile/link-time resolvable |
43 | | // address arithmetic. Declaring it as a pointer instead would require |
44 | | // doing a run-time load to fetch a pointer to this binding's property |
45 | | // hooks. And then structures which embedded a pointer to this structure |
46 | | // would require a run-time load for proper initialization, which would |
47 | | // then induce static constructors. Lots of static constructors. |
48 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
49 | | |
50 | | void |
51 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
52 | | |
53 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
54 | 0 | { |
55 | 0 | /* Get the interface prototype object for this class. This will create the |
56 | 0 | object as needed. */ |
57 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::Location, |
58 | 0 | &CreateInterfaceObjects, |
59 | 0 | /* aDefineOnGlobal = */ true); |
60 | 0 |
|
61 | 0 | } |
62 | | |
63 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
64 | 0 | { |
65 | 0 | /* Get the interface object for this class. This will create the object as |
66 | 0 | needed. */ |
67 | 0 |
|
68 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::Location, |
69 | 0 | &CreateInterfaceObjects, |
70 | 0 | aDefineOnGlobal); |
71 | 0 | } |
72 | | |
73 | | JSObject* |
74 | | GetConstructorObject(JSContext* aCx); |
75 | | |
76 | | inline bool IsPermitted(JSFlatString* prop, char16_t propFirstChar, bool set) |
77 | 0 | { |
78 | 0 | switch (propFirstChar) { |
79 | 0 | case 'h': { |
80 | 0 | if (set && JS_FlatStringEqualsAscii(prop, "href")) { |
81 | 0 | return true; |
82 | 0 | } |
83 | 0 | break; |
84 | 0 | } |
85 | 0 | case 'r': { |
86 | 0 | if (!set && JS_FlatStringEqualsAscii(prop, "replace")) { |
87 | 0 | return true; |
88 | 0 | } |
89 | 0 | break; |
90 | 0 | } |
91 | 0 | } |
92 | 0 | |
93 | 0 | return false; |
94 | 0 | } |
95 | | |
96 | | } // namespace Location_Binding |
97 | | |
98 | | |
99 | | |
100 | | } // namespace dom |
101 | | } // namespace mozilla |
102 | | |
103 | | #endif // mozilla_dom_LocationBinding_h |