#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_TO_V8_TRAITS_H_
#define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_TO_V8_TRAITS_H_
#include <optional>
#include "base/numerics/safe_conversions.h"
#include "third_party/blink/renderer/bindings/core/v8/idl_types.h"
#include "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h"
#include "third_party/blink/renderer/platform/bindings/dom_data_store.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_deque.h"
#include "third_party/blink/renderer/platform/wtf/type_traits.h"
#include "v8/include/v8.h"
namespace blink {
class CallbackFunctionBase;
class CallbackInterfaceBase;
class ScriptWrappable;
template <typename IDLType>
class FrozenArray;
namespace bindings {
class DictionaryBase;
class EnumerationBase;
class UnionBase;
}
template <typename T, typename SFINAEHelper = void>
struct ToV8Traits;
struct ToV8UndefinedGenerator { … };
template <>
struct ToV8Traits<IDLUndefined> { … };
template <>
struct ToV8Traits<IDLAny> { … };
template <>
struct ToV8Traits<IDLBoolean> { … };
template <>
struct ToV8Traits<IDLBigint> { … };
ToV8Traits<IDLIntegerTypeBase<int8_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<int16_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<int32_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<int64_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<uint8_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<uint16_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<uint32_t, mode>>;
ToV8Traits<IDLIntegerTypeBase<uint64_t, mode>>;
ToV8Traits<IDLFloatingPointNumberTypeBase<T, mode>>;
ToV8Traits<T, std::enable_if_t<std::is_base_of<IDLStringTypeBase, T>::value>>;
template <>
struct ToV8Traits<IDLObject> { … };
template <>
struct ToV8Traits<IDLPromise> { … };
ToV8Traits<T, std::enable_if_t<std::is_base_of<ScriptWrappable, T>::value>>;
ToV8Traits<T, std::enable_if_t<std::is_base_of<bindings::DictionaryBase, T>::value>>;
ToV8Traits<T, std::enable_if_t<std::is_base_of<CallbackFunctionBase, T>::value>>;
ToV8Traits<T, std::enable_if_t<std::is_base_of<CallbackInterfaceBase, T>::value>>;
ToV8Traits<T, std::enable_if_t<std::is_base_of<bindings::EnumerationBase, T>::value>>;
ToV8Traits<NotShared<T>>;
ToV8Traits<MaybeShared<T>>;
namespace bindings {
template <typename ElementIDLType, typename ContainerType>
[[nodiscard]] inline v8::Local<v8::Value> ToV8HelperSequence(
ScriptState* script_state,
const ContainerType& sequence) { … }
template <typename BaseClassOfT, typename T>
[[nodiscard]] inline v8::Local<v8::Value> ToV8HelperSequenceWithMemberUpcast(
ScriptState* script_state,
const HeapVector<Member<T>>& sequence) { … }
template <typename BaseClassOfT, typename T>
[[nodiscard]] inline v8::Local<v8::Value> ToV8HelperSequenceWithMemberUpcast(
ScriptState* script_state,
const HeapDeque<Member<T>>& sequence) { … }
template <typename ValueIDLType, typename ContainerType>
[[nodiscard]] inline v8::Local<v8::Value> ToV8HelperRecord(
ScriptState* script_state,
const ContainerType& record) { … }
}
ToV8Traits<IDLSequence<T>, std::enable_if_t<std::is_base_of<bindings::DictionaryBase, T>::value>>;
ToV8Traits<IDLSequence<T>, std::enable_if_t<std::is_base_of<ScriptWrappable, T>::value>>;
ToV8Traits<IDLSequence<T>, std::enable_if_t<!std::is_base_of<bindings::DictionaryBase, T>::value && !std::is_base_of<ScriptWrappable, T>::value>>;
ToV8Traits<IDLArray<T>>;
ToV8Traits<IDLRecord<K, V>>;
ToV8Traits<IDLNullable<IDLNullable<T>>>;
template <>
struct ToV8Traits<IDLNullable<IDLBoolean>> { … };
ToV8Traits<IDLNullable<IDLIntegerTypeBase<T, mode>>>;
template <>
struct ToV8Traits<IDLNullable<IDLBigint>> { … };
ToV8Traits<IDLNullable<IDLFloatingPointNumberTypeBase<T, mode>>>;
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<IDLStringTypeBase, T>::value>>;
template <>
struct ToV8Traits<IDLNullable<IDLObject>> { … };
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<ScriptWrappable, T>::value>>;
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<bindings::DictionaryBase, T>::value>>;
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<CallbackFunctionBase, T>::value>>;
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<CallbackInterfaceBase, T>::value>>;
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<bindings::EnumerationBase, T>::value>>;
ToV8Traits<IDLNullable<NotShared<T>>>;
ToV8Traits<IDLNullable<MaybeShared<T>>>;
ToV8Traits<IDLNullable<IDLSequence<T>>>;
ToV8Traits<IDLNullable<IDLArray<T>>>;
ToV8Traits<IDLNullable<IDLRecord<K, V>>>;
template <>
struct ToV8Traits<IDLNullable<IDLDate>> { … };
ToV8Traits<T, std::enable_if_t<std::is_base_of<bindings::UnionBase, T>::value>>;
ToV8Traits<IDLNullable<T>, std::enable_if_t<std::is_base_of<bindings::UnionBase, T>::value>>;
ToV8Traits<IDLOptional<T>>;
template <typename IDLType, typename BlinkType>
ScriptPromise<IDLType> ToResolvedPromise(ScriptState* script_state,
BlinkType value) { … }
}
#endif