Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM SessionStoreUtils.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_SESSIONSTOREUTILSBINDING_H_
#define DOM_SESSIONSTOREUTILSBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackFunction.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/Record.h"
#include "mozilla/dom/ToJSValue.h"
#include "mozilla/dom/UnionTypes.h"
namespace mozilla {
namespace dom {
struct CollectedCustomElementValueAtoms;
struct CollectedDataAtoms;
struct CollectedFileListValueAtoms;
struct CollectedNonMultipleSelectValueAtoms;
class FileOrUSVStringOrFormData;
struct InputElementDataAtoms;
struct NativePropertyHooks;
class OwningFileOrUSVStringOrFormData;
class OwningStringOrBooleanOrObject;
class ProtoAndIfaceCache;
class SessionStoreUtils;
class SessionStoreUtilsFrameCallback;
class StringOrBooleanOrObject;
class WindowProxyHolder;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct CollectedCustomElementValue : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Nullable<OwningFileOrUSVStringOrFormData > mState;
MOZ_INIT_OUTSIDE_CTOR Nullable<OwningFileOrUSVStringOrFormData > mValue;
CollectedCustomElementValue();
explicit inline CollectedCustomElementValue(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectedCustomElementValue(CollectedCustomElementValue&& aOther) = default;
explicit inline CollectedCustomElementValue(const CollectedCustomElementValue& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mState, "mState", aFlags);
ImplCycleCollectionTraverse(aCallback, mValue, "mValue", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mState);
ImplCycleCollectionUnlink(mValue);
}
CollectedCustomElementValue&
operator=(const CollectedCustomElementValue& aOther);
private:
static bool
InitIds(JSContext* cx, CollectedCustomElementValueAtoms* atomsCache);
};
namespace binding_detail {
struct FastCollectedCustomElementValue : public CollectedCustomElementValue
{
inline FastCollectedCustomElementValue()
: CollectedCustomElementValue(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct CollectedData : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<JSObject*>> mChildren;
MOZ_INIT_OUTSIDE_CTOR Optional<Record<nsString, OwningStringOrBooleanOrObject>> mId;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mInnerHTML;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mScroll;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mUrl;
MOZ_INIT_OUTSIDE_CTOR Optional<Record<nsString, OwningStringOrBooleanOrObject>> mXpath;
CollectedData();
explicit inline CollectedData(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectedData(CollectedData&& aOther) = default;
private:
CollectedData(const CollectedData&) = delete;
CollectedData& operator=(const CollectedData&) = delete;
static bool
InitIds(JSContext* cx, CollectedDataAtoms* atomsCache);
public:
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
};
namespace binding_detail {
struct FastCollectedData : public CollectedData
{
inline FastCollectedData()
: CollectedData(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct CollectedFileListValue : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Sequence<nsString> mFileList;
MOZ_INIT_OUTSIDE_CTOR nsString mType;
CollectedFileListValue();
explicit inline CollectedFileListValue(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectedFileListValue(CollectedFileListValue&& aOther) = default;
explicit inline CollectedFileListValue(const CollectedFileListValue& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectedFileListValue&
operator=(const CollectedFileListValue& aOther);
private:
static bool
InitIds(JSContext* cx, CollectedFileListValueAtoms* atomsCache);
};
namespace binding_detail {
struct FastCollectedFileListValue : public CollectedFileListValue
{
inline FastCollectedFileListValue()
: CollectedFileListValue(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct CollectedNonMultipleSelectValue : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR int32_t mSelectedIndex;
MOZ_INIT_OUTSIDE_CTOR nsString mValue;
CollectedNonMultipleSelectValue();
explicit inline CollectedNonMultipleSelectValue(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CollectedNonMultipleSelectValue(CollectedNonMultipleSelectValue&& aOther) = default;
explicit inline CollectedNonMultipleSelectValue(const CollectedNonMultipleSelectValue& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CollectedNonMultipleSelectValue&
operator=(const CollectedNonMultipleSelectValue& aOther);
private:
static bool
InitIds(JSContext* cx, CollectedNonMultipleSelectValueAtoms* atomsCache);
};
namespace binding_detail {
struct FastCollectedNonMultipleSelectValue : public CollectedNonMultipleSelectValue
{
inline FastCollectedNonMultipleSelectValue()
: CollectedNonMultipleSelectValue(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct InputElementData : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<bool>> mBoolVal;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mId;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mSelectVal;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<int32_t>> mSelectedIndex;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mStrVal;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mType;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<int32_t>> mValueIdx;
InputElementData();
explicit inline InputElementData(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
InputElementData(InputElementData&& aOther) = default;
explicit inline InputElementData(const InputElementData& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
InputElementData&
operator=(const InputElementData& aOther);
private:
static bool
InitIds(JSContext* cx, InputElementDataAtoms* atomsCache);
};
namespace binding_detail {
struct FastInputElementData : public InputElementData
{
inline FastInputElementData()
: InputElementData(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
class SessionStoreUtilsFrameCallback : public CallbackFunction
{
public:
explicit inline SessionStoreUtilsFrameCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline SessionStoreUtilsFrameCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline SessionStoreUtilsFrameCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline SessionStoreUtilsFrameCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const WindowProxyHolder& frame, uint32_t index, 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 = "SessionStoreUtilsFrameCallback";
}
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 Call(s.GetCallContext(), thisValJS, frame, index, aRv);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const WindowProxyHolder& frame, uint32_t index, 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 = "SessionStoreUtilsFrameCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, frame, index, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const WindowProxyHolder& frame, uint32_t index, const char* aExecutionReason = nullptr)
{
return Call(thisVal, frame, index, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const WindowProxyHolder& frame, uint32_t index, const char* aExecutionReason = nullptr)
{
return Call(frame, index, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const SessionStoreUtilsFrameCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT void Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const WindowProxyHolder& frame, uint32_t index, ErrorResult& aRv);
};
namespace binding_detail {
class FastSessionStoreUtilsFrameCallback : public SessionStoreUtilsFrameCallback
{
public:
explicit inline FastSessionStoreUtilsFrameCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: SessionStoreUtilsFrameCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
SessionStoreUtilsFrameCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
SessionStoreUtilsFrameCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
namespace SessionStoreUtils_Binding {
typedef mozilla::dom::SessionStoreUtils NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::SessionStoreUtils,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace SessionStoreUtils_Binding
} // namespace mozilla::dom
#endif // DOM_SESSIONSTOREUTILSBINDING_H_