Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM XPathNSResolver.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_XPATHNSRESOLVERBINDING_H_
#define DOM_XPATHNSRESOLVERBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackInterface.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/ToJSValue.h"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
class XPathNSResolver;
struct XPathNSResolverAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
class XPathNSResolver : public CallbackInterface
{
public:
explicit inline XPathNSResolver(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
}
explicit inline XPathNSResolver(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
explicit inline XPathNSResolver(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
}
template <typename T>
inline void
LookupNamespaceURI(const T& thisVal, const nsAString& prefix, nsString& aRetVal, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr)
{
MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
if (!aExecutionReason) {
aExecutionReason = "XPathNSResolver.lookupNamespaceURI";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return LookupNamespaceURI(s.GetCallContext(), thisValJS, prefix, aRetVal, aRv);
}
inline void
LookupNamespaceURI(const nsAString& prefix, nsString& aRetVal, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr)
{
MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
if (!aExecutionReason) {
aExecutionReason = "XPathNSResolver.lookupNamespaceURI";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return LookupNamespaceURI(s.GetCallContext(), JS::UndefinedHandleValue, prefix, aRetVal, aRv);
}
template <typename T>
inline void
LookupNamespaceURI(const T& thisVal, const nsAString& prefix, nsString& aRetVal, const char* aExecutionReason = nullptr)
{
return LookupNamespaceURI(thisVal, prefix, aRetVal, IgnoreErrors(), aExecutionReason);
}
inline void
LookupNamespaceURI(const nsAString& prefix, nsString& aRetVal, const char* aExecutionReason = nullptr)
{
return LookupNamespaceURI(prefix, aRetVal, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const XPathNSResolver& aOther) const
{
return CallbackInterface::operator==(aOther);
}
private:
void LookupNamespaceURI(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const nsAString& prefix, nsString& aRetVal, ErrorResult& aRv);
static bool
InitIds(JSContext* cx, XPathNSResolverAtoms* atomsCache);
};
namespace binding_detail {
class FastXPathNSResolver : public XPathNSResolver
{
public:
explicit inline FastXPathNSResolver(JSObject* aCallback, JSObject* aCallbackGlobal)
: XPathNSResolver(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
XPathNSResolver::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
XPathNSResolver::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
} // namespace mozilla::dom
#endif // DOM_XPATHNSRESOLVERBINDING_H_