#include "third_party/blink/renderer/platform/bindings/idl_member_installer.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/bindings/v8_private_property.h"
namespace blink {
namespace bindings {
namespace {
template <typename Config>
bool DoesWorldMatch(const Config& config, const DOMWrapperWorld& world) { … }
template <v8::ExceptionContext kind, typename Config>
v8::FunctionCallback GetConfigCallback(const Config& config);
template <>
v8::FunctionCallback GetConfigCallback<v8::ExceptionContext::kAttributeGet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
v8::FunctionCallback GetConfigCallback<v8::ExceptionContext::kAttributeSet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
v8::FunctionCallback GetConfigCallback<v8::ExceptionContext::kOperation>(
const IDLMemberInstaller::OperationConfig& config) { … }
template <v8::ExceptionContext kind, typename Config>
int GetConfigLength(const Config& config);
template <>
int GetConfigLength<v8::ExceptionContext::kAttributeGet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
int GetConfigLength<v8::ExceptionContext::kAttributeSet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
int GetConfigLength<v8::ExceptionContext::kOperation>(
const IDLMemberInstaller::OperationConfig& config) { … }
template <v8::ExceptionContext kind, typename Config>
IDLMemberInstaller::FlagCrossOriginCheck GetConfigCrossOriginCheck(
const Config& config);
template <>
IDLMemberInstaller::FlagCrossOriginCheck
GetConfigCrossOriginCheck<v8::ExceptionContext::kAttributeGet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
IDLMemberInstaller::FlagCrossOriginCheck
GetConfigCrossOriginCheck<v8::ExceptionContext::kAttributeSet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
IDLMemberInstaller::FlagCrossOriginCheck
GetConfigCrossOriginCheck<v8::ExceptionContext::kOperation>(
const IDLMemberInstaller::OperationConfig& config) { … }
template <v8::ExceptionContext kind, typename Config>
v8::SideEffectType GetConfigSideEffect(const Config& config);
template <>
v8::SideEffectType GetConfigSideEffect<v8::ExceptionContext::kAttributeGet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
v8::SideEffectType GetConfigSideEffect<v8::ExceptionContext::kAttributeSet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
v8::SideEffectType GetConfigSideEffect<v8::ExceptionContext::kOperation>(
const IDLMemberInstaller::OperationConfig& config) { … }
template <v8::ExceptionContext kind, typename Config>
V8PrivateProperty::CachedAccessor GetConfigV8CachedAccessor(
const Config& config);
template <>
V8PrivateProperty::CachedAccessor
GetConfigV8CachedAccessor<v8::ExceptionContext::kAttributeGet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
V8PrivateProperty::CachedAccessor
GetConfigV8CachedAccessor<v8::ExceptionContext::kAttributeSet>(
const IDLMemberInstaller::AttributeConfig& config) { … }
template <>
V8PrivateProperty::CachedAccessor
GetConfigV8CachedAccessor<v8::ExceptionContext::kOperation>(
const IDLMemberInstaller::OperationConfig& config) { … }
template <v8::ExceptionContext kind, typename Config>
v8::Local<v8::FunctionTemplate> CreateFunctionTemplate(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Signature> signature,
v8::Local<v8::String> property_name,
v8::Local<v8::String> interface_name,
v8::ExceptionContext exception_context,
const Config& config,
const v8::CFunction* v8_cfunction_table_data = nullptr,
uint32_t v8_cfunction_table_size = 0) { … }
template <v8::ExceptionContext kind, typename Config>
v8::Local<v8::Function> CreateFunction(
v8::Isolate* isolate,
v8::Local<v8::Context> context,
const DOMWrapperWorld& world,
v8::Local<v8::Signature> signature,
v8::Local<v8::String> property_name,
v8::Local<v8::String> interface_name,
v8::ExceptionContext exception_context,
const Config& config,
const v8::CFunction* v8_cfunction_table_data = nullptr,
uint32_t v8_cfunction_table_size = 0) { … }
void InstallAttribute(v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
const IDLMemberInstaller::AttributeConfig& config) { … }
void InstallAttribute(v8::Isolate* isolate,
v8::Local<v8::Context> context,
const DOMWrapperWorld& world,
v8::Local<v8::Object> instance_object,
v8::Local<v8::Object> prototype_object,
v8::Local<v8::Object> interface_object,
v8::Local<v8::Signature> signature,
const IDLMemberInstaller::AttributeConfig& config) { … }
void InstallOperation(v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
const IDLMemberInstaller::OperationConfig& config,
const v8::CFunction* v8_cfunction_table_data = nullptr,
uint32_t v8_cfunction_table_size = 0) { … }
void InstallOperation(v8::Isolate* isolate,
v8::Local<v8::Context> context,
const DOMWrapperWorld& world,
v8::Local<v8::Object> instance_object,
v8::Local<v8::Object> prototype_object,
v8::Local<v8::Object> interface_object,
v8::Local<v8::Signature> signature,
const IDLMemberInstaller::OperationConfig& config,
const v8::CFunction* v8_cfunction_table_data = nullptr,
uint32_t v8_cfunction_table_size = 0) { … }
}
void IDLMemberInstaller::InstallAttributes(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
base::span<const AttributeConfig> configs) { … }
void IDLMemberInstaller::InstallAttributes(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Object> instance_object,
v8::Local<v8::Object> prototype_object,
v8::Local<v8::Object> interface_object,
v8::Local<v8::Signature> signature,
base::span<const AttributeConfig> configs) { … }
void IDLMemberInstaller::InstallConstants(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
base::span<const ConstantCallbackConfig> configs) { … }
void IDLMemberInstaller::InstallConstants(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
base::span<const ConstantValueConfig> configs) { … }
void IDLMemberInstaller::InstallOperations(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
base::span<const OperationConfig> configs) { … }
void IDLMemberInstaller::InstallOperations(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Object> instance_object,
v8::Local<v8::Object> prototype_object,
v8::Local<v8::Object> interface_object,
v8::Local<v8::Signature> signature,
base::span<const OperationConfig> configs) { … }
void IDLMemberInstaller::InstallOperations(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
base::span<const NoAllocDirectCallOperationConfig> configs) { … }
void IDLMemberInstaller::InstallOperations(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Object> instance_object,
v8::Local<v8::Object> prototype_object,
v8::Local<v8::Object> interface_object,
v8::Local<v8::Signature> signature,
base::span<const NoAllocDirectCallOperationConfig> configs) { … }
void IDLMemberInstaller::InstallExposedConstructs(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Template> instance_template,
v8::Local<v8::Template> prototype_template,
v8::Local<v8::Template> interface_template,
v8::Local<v8::Signature> signature,
base::span<const ExposedConstructConfig> configs) { … }
void IDLMemberInstaller::InstallExposedConstructs(
v8::Isolate* isolate,
const DOMWrapperWorld& world,
v8::Local<v8::Object> instance_object,
v8::Local<v8::Object> prototype_object,
v8::Local<v8::Object> interface_object,
v8::Local<v8::Signature> signature,
base::span<const ExposedConstructConfig> configs) { … }
}
}