#ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_GENERATED_CODE_HELPER_H_
#define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_GENERATED_CODE_HELPER_H_
#include <optional>
#include "third_party/blink/renderer/bindings/core/v8/idl_types.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "v8/include/v8.h"
namespace blink {
class DOMParser;
class Document;
class ExecutionContext;
class QualifiedName;
class Range;
class ScriptState;
class CORE_EXPORT ExceptionToRejectPromiseScope final { … };
CORE_EXPORT bool IsCallbackFunctionRunnable(
const ScriptState* callback_relevant_script_state,
const ScriptState* incumbent_script_state);
CORE_EXPORT bool IsCallbackFunctionRunnableIgnoringPause(
const ScriptState* callback_relevant_script_state,
const ScriptState* incumbent_script_state);
namespace bindings {
CORE_EXPORT void SetupIDLInterfaceTemplate(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type_info,
v8::Local<v8::ObjectTemplate> instance_template,
v8::Local<v8::ObjectTemplate> prototype_template,
v8::Local<v8::FunctionTemplate> interface_template,
v8::Local<v8::FunctionTemplate> parent_interface_template);
CORE_EXPORT void SetupIDLNamespaceTemplate(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type_info,
v8::Local<v8::ObjectTemplate> interface_template);
CORE_EXPORT void SetupIDLCallbackInterfaceTemplate(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type_info,
v8::Local<v8::FunctionTemplate> interface_template);
CORE_EXPORT void SetupIDLObservableArrayBackingListTemplate(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type_info,
v8::Local<v8::ObjectTemplate> instance_template,
v8::Local<v8::FunctionTemplate> interface_template);
CORE_EXPORT void SetupIDLIteratorTemplate(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type_info,
v8::Local<v8::ObjectTemplate> instance_template,
v8::Local<v8::ObjectTemplate> prototype_template,
v8::Local<v8::FunctionTemplate> interface_template,
v8::Intrinsic parent_intrinsic_prototype,
const char* class_string);
inline int NonUndefinedArgumentLength(
const v8::FunctionCallbackInfo<v8::Value>& info) { … }
template <typename T, typename... ExtraArgs>
typename IDLSequence<T>::ImplType VariadicArgumentsToNativeValues(
v8::Isolate* isolate,
const v8::FunctionCallbackInfo<v8::Value>& info,
int start_index,
ExceptionState& exception_state,
ExtraArgs... extra_args) { … }
CORE_EXPORT std::optional<size_t> FindIndexInEnumStringTable(
v8::Isolate* isolate,
v8::Local<v8::Value> value,
base::span<const char* const> enum_value_table,
const char* enum_type_name,
ExceptionState& exception_state);
CORE_EXPORT std::optional<size_t> FindIndexInEnumStringTable(
const String& str_value,
base::span<const char* const> enum_value_table);
CORE_EXPORT void ReportInvalidEnumSetToAttribute(
v8::Isolate* isolate,
const String& value,
const String& enum_type_name,
ExceptionState& exception_state);
CORE_EXPORT bool IsEsIterableObject(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state);
CORE_EXPORT Document* ToDocumentFromExecutionContext(
ExecutionContext* execution_context);
CORE_EXPORT inline ExecutionContext* ExecutionContextFromV8Wrappable(
const EventTarget* event_target) { … }
CORE_EXPORT ExecutionContext* ExecutionContextFromV8Wrappable(
const Range* range);
CORE_EXPORT ExecutionContext* ExecutionContextFromV8Wrappable(
const DOMParser* parser);
CORE_EXPORT v8::MaybeLocal<v8::Value> CreateLegacyFactoryFunctionFunction(
ScriptState* script_state,
v8::FunctionCallback callback,
const char* func_name,
int func_length,
const WrapperTypeInfo* wrapper_type_info);
CORE_EXPORT void InstallUnscopablePropertyNames(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
v8::Local<v8::Object> prototype_object,
base::span<const char* const> property_name_table);
CORE_EXPORT v8::Local<v8::Array> EnumerateIndexedProperties(
v8::Isolate* isolate,
uint32_t length);
template <typename IDLType, bool is_required, typename ValueType>
bool GetDictionaryMemberFromV8Object(v8::Isolate* isolate,
v8::Local<v8::Context> current_context,
v8::Local<v8::Object> v8_dictionary,
v8::Local<v8::Name> v8_member_name,
bool& presence,
ValueType& value,
ExceptionState& exception_state) { … }
CORE_EXPORT void PerformAttributeSetCEReactionsReflectTypeBoolean(
const v8::FunctionCallbackInfo<v8::Value>& info,
const QualifiedName& content_attribute,
const char* interface_name,
const char* attribute_name);
CORE_EXPORT void PerformAttributeSetCEReactionsReflectTypeString(
const v8::FunctionCallbackInfo<v8::Value>& info,
const QualifiedName& content_attribute,
const char* interface_name,
const char* attribute_name);
CORE_EXPORT void
PerformAttributeSetCEReactionsReflectTypeStringLegacyNullToEmptyString(
const v8::FunctionCallbackInfo<v8::Value>& info,
const QualifiedName& content_attribute,
const char* interface_name,
const char* attribute_name);
CORE_EXPORT void PerformAttributeSetCEReactionsReflectTypeStringOrNull(
const v8::FunctionCallbackInfo<v8::Value>& info,
const QualifiedName& content_attribute,
const char* interface_name,
const char* attribute_name);
CORE_EXPORT void CountWebDXFeature(v8::Isolate* isolate, WebDXFeature feature);
}
}
#endif