Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM ReferrerPolicy.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_REFERRERPOLICYBINDING_H_
#define DOM_REFERRERPOLICYBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class ReferrerPolicy : uint8_t {
_empty,
No_referrer,
No_referrer_when_downgrade,
Origin,
Origin_when_cross_origin,
Unsafe_url,
Same_origin,
Strict_origin,
Strict_origin_when_cross_origin,
};
namespace binding_detail {
template <> struct EnumStrings<ReferrerPolicy> {
static constexpr nsLiteralCString Values[9] {
""_ns,
"no-referrer"_ns,
"no-referrer-when-downgrade"_ns,
"origin"_ns,
"origin-when-cross-origin"_ns,
"unsafe-url"_ns,
"same-origin"_ns,
"strict-origin"_ns,
"strict-origin-when-cross-origin"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, ReferrerPolicy aArgument, JS::MutableHandle<JS::Value> aValue);
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::ReferrerPolicy>
{
static constexpr dom::ReferrerPolicy value = dom::ReferrerPolicy::Strict_origin_when_cross_origin;
static_assert(static_cast<uint8_t>(dom::ReferrerPolicy::_empty) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::ReferrerPolicy>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_REFERRERPOLICYBINDING_H_