/work/obj-fuzz/dist/include/mozilla/dom/XPathNSResolverBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM XPathNSResolver.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_XPathNSResolverBinding_h |
4 | | #define mozilla_dom_XPathNSResolverBinding_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/CallbackInterface.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/ToJSValue.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | struct NativePropertyHooks; |
19 | | class ProtoAndIfaceCache; |
20 | | class XPathNSResolver; |
21 | | struct XPathNSResolverAtoms; |
22 | | |
23 | | } // namespace dom |
24 | | } // namespace mozilla |
25 | | |
26 | | namespace mozilla { |
27 | | namespace dom { |
28 | | |
29 | | class XPathNSResolver : public CallbackInterface |
30 | | { |
31 | | public: |
32 | | explicit inline XPathNSResolver(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
33 | | : CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
34 | 0 | { |
35 | 0 | } |
36 | | |
37 | | explicit inline XPathNSResolver(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
38 | | : CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
39 | 0 | { |
40 | 0 | } |
41 | | |
42 | | explicit inline XPathNSResolver(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
43 | | : CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | | template <typename T> |
48 | | inline void |
49 | | LookupNamespaceURI(const T& thisVal, const nsAString& prefix, nsString& aRetVal, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr) |
50 | | { |
51 | | MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!"); |
52 | | if (!aExecutionReason) { |
53 | | aExecutionReason = "XPathNSResolver.lookupNamespaceURI"; |
54 | | } |
55 | | CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm); |
56 | | if (!s.GetContext()) { |
57 | | MOZ_ASSERT(aRv.Failed()); |
58 | | return; |
59 | | } |
60 | | JS::Rooted<JS::Value> thisValJS(s.GetContext()); |
61 | | if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) { |
62 | | aRv.Throw(NS_ERROR_FAILURE); |
63 | | return; |
64 | | } |
65 | | return LookupNamespaceURI(s.GetContext(), thisValJS, prefix, aRetVal, aRv); |
66 | | } |
67 | | |
68 | | inline void |
69 | | LookupNamespaceURI(const nsAString& prefix, nsString& aRetVal, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr) |
70 | 0 | { |
71 | 0 | MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!"); |
72 | 0 | if (!aExecutionReason) { |
73 | 0 | aExecutionReason = "XPathNSResolver.lookupNamespaceURI"; |
74 | 0 | } |
75 | 0 | CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm); |
76 | 0 | if (!s.GetContext()) { |
77 | 0 | MOZ_ASSERT(aRv.Failed()); |
78 | 0 | return; |
79 | 0 | } |
80 | 0 | return LookupNamespaceURI(s.GetContext(), JS::UndefinedHandleValue, prefix, aRetVal, aRv); |
81 | 0 | } |
82 | | |
83 | | template <typename T> |
84 | | inline void |
85 | | LookupNamespaceURI(const T& thisVal, const nsAString& prefix, nsString& aRetVal, const char* aExecutionReason = nullptr) |
86 | | { |
87 | | return LookupNamespaceURI(thisVal, prefix, aRetVal, IgnoreErrors(), aExecutionReason); |
88 | | } |
89 | | |
90 | | inline void |
91 | | LookupNamespaceURI(const nsAString& prefix, nsString& aRetVal, const char* aExecutionReason = nullptr) |
92 | 0 | { |
93 | 0 | return LookupNamespaceURI(prefix, aRetVal, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr); |
94 | 0 | } |
95 | | |
96 | | inline bool |
97 | | operator==(const XPathNSResolver& aOther) const |
98 | 0 | { |
99 | 0 | return CallbackInterface::operator==(aOther); |
100 | 0 | } |
101 | | |
102 | | private: |
103 | | void LookupNamespaceURI(JSContext* cx, JS::Handle<JS::Value> aThisVal, const nsAString& prefix, nsString& aRetVal, ErrorResult& aRv); |
104 | | |
105 | | static bool |
106 | | InitIds(JSContext* cx, XPathNSResolverAtoms* atomsCache); |
107 | | }; |
108 | | |
109 | | |
110 | | namespace binding_detail { |
111 | | class FastXPathNSResolver : public XPathNSResolver |
112 | | { |
113 | | public: |
114 | | explicit inline FastXPathNSResolver(JSObject* aCallback, JSObject* aCallbackGlobal) |
115 | | : XPathNSResolver(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
116 | 0 | { |
117 | 0 | } |
118 | | |
119 | | inline void |
120 | | Trace(JSTracer* aTracer) |
121 | 0 | { |
122 | 0 | XPathNSResolver::Trace(aTracer); |
123 | 0 | } |
124 | | |
125 | | inline void |
126 | | FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx) |
127 | 0 | { |
128 | 0 | XPathNSResolver::FinishSlowJSInitIfMoreThanOneOwner(aCx); |
129 | 0 | } |
130 | | }; |
131 | | } // namespace binding_detail |
132 | | |
133 | | |
134 | | } // namespace dom |
135 | | } // namespace mozilla |
136 | | |
137 | | #endif // mozilla_dom_XPathNSResolverBinding_h |