blob: 872638abf5c18996eec12b2c389b541da26f2a8e [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated from the Jinja2 template
// third_party/blink/renderer/bindings/templates/interface.cc.tmpl
// by the script code_generator_v8.py.
// DO NOT MODIFY!
// clang-format off
#include "third_party/blink/renderer/bindings/tests/results/core/v8_test_interface.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/bindings/core/v8/idl_types.h"
#include "third_party/blink/renderer/bindings/core/v8/js_event_handler.h"
#include "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_dom_configuration.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_element.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_iterator.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_node.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_test_interface.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_test_interface_2.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_test_interface_empty.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_window.h"
#include "third_party/blink/renderer/bindings/tests/idls/core/test_implements_2.h"
#include "third_party/blink/renderer/bindings/tests/idls/core/test_implements_3_implementation.h"
#include "third_party/blink/renderer/bindings/tests/idls/core/test_interface_partial.h"
#include "third_party/blink/renderer/bindings/tests/idls/core/test_interface_partial_2_implementation.h"
#include "third_party/blink/renderer/bindings/tests/idls/core/test_interface_partial_secure_context.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/use_counter.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/runtime_call_stats.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_object_constructor.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/get_ptr.h"
namespace blink {
// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
WrapperTypeInfo v8_test_interface_wrapper_type_info = {
gin::kEmbedderBlink,
V8TestInterface::DomTemplate,
V8TestInterface::InstallConditionalFeatures,
"TestInterface",
V8TestInterfaceEmpty::GetWrapperTypeInfo(),
WrapperTypeInfo::kWrapperTypeObjectPrototype,
WrapperTypeInfo::kObjectClassId,
WrapperTypeInfo::kInheritFromActiveScriptWrappable,
};
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic pop
#endif
// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceImplementation.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// platform/bindings/ScriptWrappable.h.
const WrapperTypeInfo& TestInterfaceImplementation::wrapper_type_info_ = v8_test_interface_wrapper_type_info;
// [ActiveScriptWrappable]
static_assert(
std::is_base_of<ActiveScriptWrappableBase, TestInterfaceImplementation>::value,
"TestInterfaceImplementation does not inherit from ActiveScriptWrappable<>, but specifying "
"[ActiveScriptWrappable] extended attribute in the IDL file. "
"Be consistent.");
static_assert(
!std::is_same<decltype(&TestInterfaceImplementation::HasPendingActivity),
decltype(&ScriptWrappable::HasPendingActivity)>::value,
"TestInterfaceImplementation is not overriding hasPendingActivity(), but is specifying "
"[ActiveScriptWrappable] extended attribute in the IDL file. "
"Be consistent.");
namespace test_interface_implementation_v8_internal {
static void (*voidMethodPartialOverloadMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
static void (*staticVoidMethodPartialOverloadMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
static void (*promiseMethodPartialOverloadMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
static void (*staticPromiseMethodPartialOverloadMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
static void (*partial2VoidMethodMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
static void (*partial2StaticVoidMethodMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
static void TestInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueFast(info, WTF::GetPtr(impl->testInterfaceAttribute()), impl);
}
static void TestInterfaceAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "testInterfaceAttribute");
// Prepare the value to be set.
TestInterfaceImplementation* cpp_value = V8TestInterface::ToImplWithTypeCheck(info.GetIsolate(), v8_value);
// Type check per: http://heycam.github.io/webidl/#es-interface
if (!cpp_value) {
exception_state.ThrowTypeError("The provided value is not of type 'TestInterface'.");
return;
}
impl->setTestInterfaceAttribute(cpp_value);
}
static void DoubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValue(info, impl->doubleAttribute());
}
static void DoubleAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "doubleAttribute");
// Prepare the value to be set.
double cpp_value = NativeValueTraits<IDLDouble>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setDoubleAttribute(cpp_value);
}
static void FloatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValue(info, impl->floatAttribute());
}
static void FloatAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "floatAttribute");
// Prepare the value to be set.
float cpp_value = NativeValueTraits<IDLFloat>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setFloatAttribute(cpp_value);
}
static void UnrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValue(info, impl->unrestrictedDoubleAttribute());
}
static void UnrestrictedDoubleAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "unrestrictedDoubleAttribute");
// Prepare the value to be set.
double cpp_value = NativeValueTraits<IDLUnrestrictedDouble>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setUnrestrictedDoubleAttribute(cpp_value);
}
static void UnrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValue(info, impl->unrestrictedFloatAttribute());
}
static void UnrestrictedFloatAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "unrestrictedFloatAttribute");
// Prepare the value to be set.
float cpp_value = NativeValueTraits<IDLUnrestrictedFloat>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setUnrestrictedFloatAttribute(cpp_value);
}
static void TestEnumAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, impl->testEnumAttribute(), info.GetIsolate());
}
static void TestEnumAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "testEnumAttribute");
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
// Type check per: http://heycam.github.io/webidl/#dfn-attribute-setter
// Returns undefined without setting the value if the value is invalid.
DummyExceptionStateForTesting dummy_exception_state;
{
const char* kValidValues[] = {
"",
"EnumValue1",
"EnumValue2",
"EnumValue3",
};
if (!IsValidEnum(cpp_value, kValidValues, base::size(kValidValues),
"TestEnum", dummy_exception_state)) {
ExecutionContext::ForCurrentRealm(info)->AddConsoleMessage(
ConsoleMessage::Create(kJSMessageSource, kWarningMessageLevel,
dummy_exception_state.Message()));
return;
}
}
impl->setTestEnumAttribute(cpp_value);
}
static void TestEnumOrNullAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueStringOrNull(info, impl->testEnumOrNullAttribute(), info.GetIsolate());
}
static void TestEnumOrNullAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "testEnumOrNullAttribute");
// Prepare the value to be set.
V8StringResource<kTreatNullAndUndefinedAsNullString> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
// Type check per: http://heycam.github.io/webidl/#dfn-attribute-setter
// Returns undefined without setting the value if the value is invalid.
DummyExceptionStateForTesting dummy_exception_state;
{
const char* kValidValues[] = {
nullptr,
"",
"EnumValue1",
"EnumValue2",
"EnumValue3",
};
if (!IsValidEnum(cpp_value, kValidValues, base::size(kValidValues),
"TestEnum", dummy_exception_state)) {
ExecutionContext::ForCurrentRealm(info)->AddConsoleMessage(
ConsoleMessage::Create(kJSMessageSource, kWarningMessageLevel,
dummy_exception_state.Message()));
return;
}
}
impl->setTestEnumOrNullAttribute(cpp_value);
}
static void StringOrDoubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
StringOrDouble result;
impl->stringOrDoubleAttribute(result);
V8SetReturnValue(info, result);
}
static void StringOrDoubleAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "stringOrDoubleAttribute");
// Prepare the value to be set.
StringOrDouble cpp_value;
V8StringOrDouble::ToImpl(info.GetIsolate(), v8_value, cpp_value, UnionTypeConversionMode::kNotNullable, exception_state);
if (exception_state.HadException())
return;
impl->setStringOrDoubleAttribute(cpp_value);
}
static void WithExtendedAttributeStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, impl->withExtendedAttributeStringAttribute());
}
static void WithExtendedAttributeStringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "withExtendedAttributeStringAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLongEnforceRange>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setWithExtendedAttributeStringAttribute(cpp_value);
}
static void UncapitalAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueFast(info, WTF::GetPtr(impl->CapitalImplementation()), impl);
}
static void UncapitalAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "uncapitalAttribute");
// Prepare the value to be set.
Implementation* cpp_value = V8Implementation::ToImplWithTypeCheck(info.GetIsolate(), v8_value);
// Type check per: http://heycam.github.io/webidl/#es-interface
if (!cpp_value) {
exception_state.ThrowTypeError("The provided value is not of type 'Implementation'.");
return;
}
impl->setCapitalImplementation(cpp_value);
}
static void ConditionalLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, impl->conditionalLongAttribute());
}
static void ConditionalLongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "conditionalLongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setConditionalLongAttribute(cpp_value);
}
static void ConditionalReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, impl->conditionalReadOnlyLongAttribute());
}
static void StaticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueString(info, TestInterfaceImplementation::staticStringAttribute(), info.GetIsolate());
}
static void StaticStringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
TestInterfaceImplementation::setStaticStringAttribute(cpp_value);
}
static void StaticReturnDOMWrapperAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValue(info, WTF::GetPtr(TestInterfaceImplementation::staticReturnDOMWrapperAttribute()), info.GetIsolate()->GetCurrentContext()->Global());
}
static void StaticReturnDOMWrapperAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "staticReturnDOMWrapperAttribute");
// Prepare the value to be set.
TestInterfaceImplementation* cpp_value = V8TestInterface::ToImplWithTypeCheck(info.GetIsolate(), v8_value);
// Type check per: http://heycam.github.io/webidl/#es-interface
if (!cpp_value) {
exception_state.ThrowTypeError("The provided value is not of type 'TestInterface'.");
return;
}
TestInterfaceImplementation::setStaticReturnDOMWrapperAttribute(cpp_value);
}
static void StaticReadOnlyStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueString(info, TestInterfaceImplementation::staticReadOnlyStringAttribute(), info.GetIsolate());
}
static void StaticReadOnlyReturnDOMWrapperAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValue(info, WTF::GetPtr(TestInterfaceImplementation::staticReadOnlyReturnDOMWrapperAttribute()), info.GetIsolate()->GetCurrentContext()->Global());
}
static void StaticConditionalReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueInt(info, TestInterfaceImplementation::staticConditionalReadOnlyLongAttribute());
}
static void LegacyInterfaceTypeCheckingAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueFast(info, WTF::GetPtr(impl->legacyInterfaceTypeCheckingAttribute()), impl);
}
static void LegacyInterfaceTypeCheckingAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
TestInterfaceEmpty* cpp_value = V8TestInterfaceEmpty::ToImplWithTypeCheck(info.GetIsolate(), v8_value);
impl->setLegacyInterfaceTypeCheckingAttribute(cpp_value);
}
static void StringNullAsEmptyAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, impl->stringNullAsEmptyAttribute(), info.GetIsolate());
}
static void StringNullAsEmptyAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
V8StringResource<kTreatNullAsEmptyString> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
impl->setStringNullAsEmptyAttribute(cpp_value);
}
static void UsvStringOrNullAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueStringOrNull(info, impl->usvStringOrNullAttribute(), info.GetIsolate());
}
static void UsvStringOrNullAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "usvStringOrNullAttribute");
// Prepare the value to be set.
V8StringResource<kTreatNullAndUndefinedAsNullString> cpp_value = NativeValueTraits<IDLUSVStringOrNull>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setUsvStringOrNullAttribute(cpp_value);
}
static void AlwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, impl->alwaysExposedAttribute());
}
static void AlwaysExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "alwaysExposedAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setAlwaysExposedAttribute(cpp_value);
}
static void WorkerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, impl->workerExposedAttribute());
}
static void WorkerExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "workerExposedAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setWorkerExposedAttribute(cpp_value);
}
static void WindowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, impl->windowExposedAttribute());
}
static void WindowExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "windowExposedAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setWindowExposedAttribute(cpp_value);
}
static void LenientThisAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
// [LenientThis]
// Make sure that info.Holder() really points to an instance if [LenientThis].
if (!V8TestInterface::HasInstance(info.Holder(), info.GetIsolate()))
return; // Return silently because of [LenientThis].
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValue(info, impl->lenientThisAttribute().V8Value());
}
static void LenientThisAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
// [LenientThis]
// Make sure that info.Holder() really points to an instance if [LenientThis].
if (!V8TestInterface::HasInstance(holder, isolate))
return; // Return silently because of [LenientThis].
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
ScriptValue cpp_value = ScriptValue(ScriptState::Current(info.GetIsolate()), v8_value);
impl->setLenientThisAttribute(cpp_value);
}
static void AttributeWithSideEffectFreeGetterAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->attributeWithSideEffectFreeGetter());
}
static void AttributeWithSideEffectFreeGetterAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "attributeWithSideEffectFreeGetter");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setAttributeWithSideEffectFreeGetter(cpp_value);
}
static void SecureContextAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextAttribute());
}
static void SecureContextAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextAttribute(cpp_value);
}
static void SecureContextRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextRuntimeEnabledAttribute());
}
static void SecureContextRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextRuntimeEnabledAttribute(cpp_value);
}
static void SecureContextnessRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextnessRuntimeEnabledAttribute());
}
static void SecureContextnessRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextnessRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextnessRuntimeEnabledAttribute(cpp_value);
}
static void SecureContextWindowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextWindowExposedAttribute());
}
static void SecureContextWindowExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextWindowExposedAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextWindowExposedAttribute(cpp_value);
}
static void SecureContextWorkerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextWorkerExposedAttribute());
}
static void SecureContextWorkerExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextWorkerExposedAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextWorkerExposedAttribute(cpp_value);
}
static void SecureContextWindowExposedRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextWindowExposedRuntimeEnabledAttribute());
}
static void SecureContextWindowExposedRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextWindowExposedRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextWindowExposedRuntimeEnabledAttribute(cpp_value);
}
static void SecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, impl->secureContextWorkerExposedRuntimeEnabledAttribute());
}
static void SecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "secureContextWorkerExposedRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
impl->setSecureContextWorkerExposedRuntimeEnabledAttribute(cpp_value);
}
static void ImplementsStaticReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueInt(info, TestInterfaceImplementation::implementsStaticReadOnlyLongAttribute());
}
static void ImplementsStaticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueString(info, TestInterfaceImplementation::implementsStaticStringAttribute(), info.GetIsolate());
}
static void ImplementsStaticStringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
TestInterfaceImplementation::setImplementsStaticStringAttribute(cpp_value);
}
static void ImplementsReadonlyStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, impl->implementsReadonlyStringAttribute(), info.GetIsolate());
}
static void ImplementsStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, impl->implementsStringAttribute(), info.GetIsolate());
}
static void ImplementsStringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
impl->setImplementsStringAttribute(cpp_value);
}
static void ImplementsNodeAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueFast(info, WTF::GetPtr(impl->implementsNodeAttribute()), impl);
}
static void ImplementsNodeAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "implementsNodeAttribute");
// Prepare the value to be set.
Node* cpp_value = V8Node::ToImplWithTypeCheck(info.GetIsolate(), v8_value);
// Type check per: http://heycam.github.io/webidl/#es-interface
if (!cpp_value) {
exception_state.ThrowTypeError("The provided value is not of type 'Node'.");
return;
}
impl->setImplementsNodeAttribute(cpp_value);
}
static void ImplementsEventHandlerAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
EventListener* cpp_value(WTF::GetPtr(impl->implementsEventHandlerAttribute()));
V8SetReturnValue(info, JSEventHandler::AsV8Value(info.GetIsolate(), impl, cpp_value));
}
static void ImplementsEventHandlerAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
impl->setImplementsEventHandlerAttribute(JSEventHandler::CreateOrNull(v8_value, JSEventHandler::HandlerType::kEventHandler));
}
static void ImplementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueFast(info, WTF::GetPtr(impl->implementsRuntimeEnabledNodeAttribute()), impl);
}
static void ImplementsRuntimeEnabledNodeAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "implementsRuntimeEnabledNodeAttribute");
// Prepare the value to be set.
Node* cpp_value = V8Node::ToImplWithTypeCheck(info.GetIsolate(), v8_value);
// Type check per: http://heycam.github.io/webidl/#es-interface
if (!cpp_value) {
exception_state.ThrowTypeError("The provided value is not of type 'Node'.");
return;
}
impl->setImplementsRuntimeEnabledNodeAttribute(cpp_value);
}
static void Implements2StaticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueString(info, TestImplements2::implements2StaticStringAttribute(), info.GetIsolate());
}
static void Implements2StaticStringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
TestImplements2::setImplements2StaticStringAttribute(cpp_value);
}
static void Implements2StringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, TestImplements2::implements2StringAttribute(*impl), info.GetIsolate());
}
static void Implements2StringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
TestImplements2::setImplements2StringAttribute(*impl, cpp_value);
}
static void Implements3StringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, TestImplements3Implementation::implements3StringAttribute(*impl), info.GetIsolate());
}
static void Implements3StringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
TestImplements3Implementation::setImplements3StringAttribute(*impl, cpp_value);
}
static void Implements3StaticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueString(info, TestImplements3Implementation::implements3StaticStringAttribute(), info.GetIsolate());
}
static void Implements3StaticStringAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
TestImplements3Implementation::setImplements3StaticStringAttribute(cpp_value);
}
static void PartialLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, TestInterfacePartial::partialLongAttribute(*impl));
}
static void PartialLongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialLongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial::setPartialLongAttribute(*impl, cpp_value);
}
static void PartialStaticLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueInt(info, TestInterfacePartial::partialStaticLongAttribute());
}
static void PartialStaticLongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialStaticLongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial::setPartialStaticLongAttribute(cpp_value);
}
static void PartialCallWithExecutionContextLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExecutionContext* execution_context = ExecutionContext::ForRelevantRealm(info);
V8SetReturnValueInt(info, TestInterfacePartial::partialCallWithExecutionContextLongAttribute(execution_context, *impl));
}
static void PartialCallWithExecutionContextLongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialCallWithExecutionContextLongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
ExecutionContext* execution_context = ExecutionContext::ForRelevantRealm(info);
TestInterfacePartial::setPartialCallWithExecutionContextLongAttribute(execution_context, *impl, cpp_value);
}
static void PartialPartialEnumTypeAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueString(info, TestInterfacePartial::partialPartialEnumTypeAttribute(*impl), info.GetIsolate());
}
static void PartialPartialEnumTypeAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialPartialEnumTypeAttribute");
// Prepare the value to be set.
V8StringResource<> cpp_value = v8_value;
if (!cpp_value.Prepare())
return;
// Type check per: http://heycam.github.io/webidl/#dfn-attribute-setter
// Returns undefined without setting the value if the value is invalid.
DummyExceptionStateForTesting dummy_exception_state;
{
const char* kValidValues[] = {
"foo",
"bar",
};
if (!IsValidEnum(cpp_value, kValidValues, base::size(kValidValues),
"PartialEnumType", dummy_exception_state)) {
ExecutionContext::ForCurrentRealm(info)->AddConsoleMessage(
ConsoleMessage::Create(kJSMessageSource, kWarningMessageLevel,
dummy_exception_state.Message()));
return;
}
}
TestInterfacePartial::setPartialPartialEnumTypeAttribute(*impl, cpp_value);
}
static void PartialSecureContextLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, TestInterfacePartial::partialSecureContextLongAttribute(*impl));
}
static void PartialSecureContextLongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextLongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial::setPartialSecureContextLongAttribute(*impl, cpp_value);
}
static void Partial2LongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueInt(info, TestInterfacePartial2Implementation::partial2LongAttribute(*impl));
}
static void Partial2LongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partial2LongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial2Implementation::setPartial2LongAttribute(*impl, cpp_value);
}
static void Partial2StaticLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValueInt(info, TestInterfacePartial2Implementation::partial2StaticLongAttribute());
}
static void Partial2StaticLongAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partial2StaticLongAttribute");
// Prepare the value to be set.
int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial2Implementation::setPartial2StaticLongAttribute(cpp_value);
}
static void Partial2SecureContextAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartial2Implementation::partial2SecureContextAttribute(*impl));
}
static void Partial2SecureContextAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partial2SecureContextAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial2Implementation::setPartial2SecureContextAttribute(*impl, cpp_value);
}
static void PartialSecureContextAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartialSecureContext::partialSecureContextAttribute(*impl));
}
static void PartialSecureContextAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartialSecureContext::setPartialSecureContextAttribute(*impl, cpp_value);
}
static void PartialSecureContextRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartialSecureContext::partialSecureContextRuntimeEnabledAttribute(*impl));
}
static void PartialSecureContextRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartialSecureContext::setPartialSecureContextRuntimeEnabledAttribute(*impl, cpp_value);
}
static void PartialSecureContextWindowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartialSecureContext::partialSecureContextWindowExposedAttribute(*impl));
}
static void PartialSecureContextWindowExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextWindowExposedAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartialSecureContext::setPartialSecureContextWindowExposedAttribute(*impl, cpp_value);
}
static void PartialSecureContextWorkerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartialSecureContext::partialSecureContextWorkerExposedAttribute(*impl));
}
static void PartialSecureContextWorkerExposedAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextWorkerExposedAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartialSecureContext::setPartialSecureContextWorkerExposedAttribute(*impl, cpp_value);
}
static void PartialSecureContextWindowExposedRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartialSecureContext::partialSecureContextWindowExposedRuntimeEnabledAttribute(*impl));
}
static void PartialSecureContextWindowExposedRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextWindowExposedRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartialSecureContext::setPartialSecureContextWindowExposedRuntimeEnabledAttribute(*impl, cpp_value);
}
static void PartialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
V8SetReturnValueBool(info, TestInterfacePartialSecureContext::partialSecureContextWorkerExposedRuntimeEnabledAttribute(*impl));
}
static void PartialSecureContextWorkerExposedRuntimeEnabledAttributeAttributeSetter(
v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
ALLOW_UNUSED_LOCAL(holder);
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(holder);
ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestInterface", "partialSecureContextWorkerExposedRuntimeEnabledAttribute");
// Prepare the value to be set.
bool cpp_value = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), v8_value, exception_state);
if (exception_state.HadException())
return;
TestInterfacePartialSecureContext::setPartialSecureContextWorkerExposedRuntimeEnabledAttribute(*impl, cpp_value);
}
static void VoidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", ExceptionMessages::NotEnoughArguments(1, info.Length())));
return;
}
TestInterfaceEmpty* test_interface_empty_arg;
test_interface_empty_arg = V8TestInterfaceEmpty::ToImplWithTypeCheck(info.GetIsolate(), info[0]);
if (!test_interface_empty_arg) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'."));
return;
}
impl->voidMethodTestInterfaceEmptyArg(test_interface_empty_arg);
}
static void VoidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "voidMethodDoubleArgFloatArg");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 2)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(2, info.Length()));
return;
}
double double_arg;
float float_arg;
double_arg = NativeValueTraits<IDLDouble>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
float_arg = NativeValueTraits<IDLFloat>::NativeValue(info.GetIsolate(), info[1], exception_state);
if (exception_state.HadException())
return;
impl->voidMethodDoubleArgFloatArg(double_arg, float_arg);
}
static void VoidMethodNullableAndOptionalObjectArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 2)) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodNullableAndOptionalObjectArgs", "TestInterface", ExceptionMessages::NotEnoughArguments(2, info.Length())));
return;
}
ScriptValue object_arg;
ScriptValue nullable_object_arg;
ScriptValue optional_object_arg;
int num_args_passed = info.Length();
while (num_args_passed > 0) {
if (!info[num_args_passed - 1]->IsUndefined())
break;
--num_args_passed;
}
if (info[0]->IsObject()) {
object_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), info[0]);
} else {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodNullableAndOptionalObjectArgs", "TestInterface", "parameter 1 ('objectArg') is not an object."));
return;
}
if (info[1]->IsObject()) {
nullable_object_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), info[1]);
} else if (info[1]->IsNullOrUndefined()) {
nullable_object_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), v8::Null(info.GetIsolate()));
} else {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodNullableAndOptionalObjectArgs", "TestInterface", "parameter 2 ('nullableObjectArg') is not an object."));
return;
}
if (UNLIKELY(num_args_passed <= 2)) {
impl->voidMethodNullableAndOptionalObjectArgs(object_arg, nullable_object_arg);
return;
}
if (info[2]->IsObject()) {
optional_object_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), info[2]);
} else if (info[2]->IsUndefined()) {
optional_object_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), v8::Undefined(info.GetIsolate()));
} else {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodNullableAndOptionalObjectArgs", "TestInterface", "parameter 3 ('optionalObjectArg') is not an object."));
return;
}
impl->voidMethodNullableAndOptionalObjectArgs(object_arg, nullable_object_arg, optional_object_arg);
}
static void VoidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 2)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(2, info.Length()));
return;
}
double unrestricted_double_arg;
float unrestricted_float_arg;
unrestricted_double_arg = NativeValueTraits<IDLUnrestrictedDouble>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
unrestricted_float_arg = NativeValueTraits<IDLUnrestrictedFloat>::NativeValue(info.GetIsolate(), info[1], exception_state);
if (exception_state.HadException())
return;
impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestricted_double_arg, unrestricted_float_arg);
}
static void VoidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "voidMethodTestEnumArg");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length()));
return;
}
V8StringResource<> test_enum_arg;
test_enum_arg = info[0];
if (!test_enum_arg.Prepare())
return;
const char* kValidTestEnumArgValues[] = {
"",
"EnumValue1",
"EnumValue2",
"EnumValue3",
};
if (!IsValidEnum(test_enum_arg, kValidTestEnumArgValues, base::size(kValidTestEnumArgValues), "TestEnum", exception_state)) {
return;
}
impl->voidMethodTestEnumArg(test_enum_arg);
}
static void VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->voidMethod();
}
static void VoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->voidMethod();
}
static void AlwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->alwaysExposedMethod();
}
static void WorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->workerExposedMethod();
}
static void WindowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->windowExposedMethod();
}
static void AlwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation::alwaysExposedStaticMethod();
}
static void WorkerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation::workerExposedStaticMethod();
}
static void WindowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation::windowExposedStaticMethod();
}
static void StaticReturnDOMWrapperMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValue(info, TestInterfaceImplementation::staticReturnDOMWrapperMethod(), info.GetIsolate()->GetCurrentContext()->Global());
}
static void MethodWithExposedAndRuntimeEnabledFlagMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->methodWithExposedAndRuntimeEnabledFlag();
}
static void OverloadMethodWithExposedAndRuntimeEnabledFlag1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "overloadMethodWithExposedAndRuntimeEnabledFlag");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
int32_t long_arg;
long_arg = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
impl->overloadMethodWithExposedAndRuntimeEnabledFlag(long_arg);
}
static void OverloadMethodWithExposedAndRuntimeEnabledFlag2Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
V8StringResource<> string;
string = info[0];
if (!string.Prepare())
return;
impl->overloadMethodWithExposedAndRuntimeEnabledFlag(string);
}
static void OverloadMethodWithExposedAndRuntimeEnabledFlag3Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
DOMWindow* window;
window = ToDOMWindow(info.GetIsolate(), info[0]);
if (!window) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("overloadMethodWithExposedAndRuntimeEnabledFlag", "TestInterface", "parameter 1 is not of type 'Window'."));
return;
}
impl->overloadMethodWithExposedAndRuntimeEnabledFlag(window);
}
static void OverloadMethodWithExposedAndRuntimeEnabledFlagMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
bool is_arity_error = false;
switch (std::min(1, info.Length())) {
case 1:
if (RuntimeEnabledFeatures::FeatureName2Enabled()) {
if (V8Window::HasInstance(info[0], info.GetIsolate())) {
OverloadMethodWithExposedAndRuntimeEnabledFlag3Method(info);
return;
}
}
if (info[0]->IsNumber()) {
OverloadMethodWithExposedAndRuntimeEnabledFlag1Method(info);
return;
}
if (RuntimeEnabledFeatures::FeatureNameEnabled()) {
if (true) {
OverloadMethodWithExposedAndRuntimeEnabledFlag2Method(info);
return;
}
}
if (true) {
OverloadMethodWithExposedAndRuntimeEnabledFlag1Method(info);
return;
}
break;
default:
is_arity_error = true;
}
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "overloadMethodWithExposedAndRuntimeEnabledFlag");
if (is_arity_error) {
if (info.Length() < 1) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length()));
return;
}
}
exception_state.ThrowTypeError("No function was found that matched the signature provided.");
}
static void MethodWithExposedHavingRuntimeEnabldFlagMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->methodWithExposedHavingRuntimeEnabldFlag();
}
static void WindowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->windowAndServiceWorkerExposedMethod();
}
static void VoidMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->voidMethodPartialOverload();
}
static void VoidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "voidMethodPartialOverload");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
double double_arg;
double_arg = NativeValueTraits<IDLDouble>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
impl->voidMethodPartialOverload(double_arg);
}
static void StaticVoidMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation::staticVoidMethodPartialOverload();
}
static void PromiseMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "promiseMethodPartialOverload");
ExceptionToRejectPromiseScope reject_promise_scope(info, exception_state);
// V8DOMConfiguration::kDoNotCheckHolder
// Make sure that info.Holder() really points to an instance of the type.
if (!V8TestInterface::HasInstance(info.Holder(), info.GetIsolate())) {
exception_state.ThrowTypeError("Illegal invocation");
return;
}
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
V8SetReturnValue(info, impl->promiseMethodPartialOverload().V8Value());
}
static void PromiseMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "promiseMethodPartialOverload");
ExceptionToRejectPromiseScope reject_promise_scope(info, exception_state);
// V8DOMConfiguration::kDoNotCheckHolder
// Make sure that info.Holder() really points to an instance of the type.
if (!V8TestInterface::HasInstance(info.Holder(), info.GetIsolate())) {
exception_state.ThrowTypeError("Illegal invocation");
return;
}
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
DOMWindow* window;
window = ToDOMWindow(info.GetIsolate(), info[0]);
if (!window) {
exception_state.ThrowTypeError("parameter 1 is not of type 'Window'.");
return;
}
V8SetReturnValue(info, impl->promiseMethodPartialOverload(window).V8Value());
}
static void StaticPromiseMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8SetReturnValue(info, TestInterfaceImplementation::staticPromiseMethodPartialOverload().V8Value());
}
static void OverloadMethodWithUnionTypeWithStringMember1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "overloadMethodWithUnionTypeWithStringMember");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
DoubleOrString union_arg;
V8DoubleOrString::ToImpl(info.GetIsolate(), info[0], union_arg, UnionTypeConversionMode::kNotNullable, exception_state);
if (exception_state.HadException())
return;
impl->overloadMethodWithUnionTypeWithStringMember(union_arg);
}
static void OverloadMethodWithUnionTypeWithStringMember2Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "overloadMethodWithUnionTypeWithStringMember");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
bool bool_arg;
bool_arg = NativeValueTraits<IDLBoolean>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
impl->overloadMethodWithUnionTypeWithStringMember(bool_arg);
}
static void OverloadMethodWithUnionTypeWithStringMemberMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
bool is_arity_error = false;
switch (std::min(1, info.Length())) {
case 1:
if (info[0]->IsBoolean()) {
OverloadMethodWithUnionTypeWithStringMember2Method(info);
return;
}
if (true) {
OverloadMethodWithUnionTypeWithStringMember1Method(info);
return;
}
if (true) {
OverloadMethodWithUnionTypeWithStringMember2Method(info);
return;
}
break;
default:
is_arity_error = true;
}
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "overloadMethodWithUnionTypeWithStringMember");
if (is_arity_error) {
if (info.Length() < 1) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length()));
return;
}
}
exception_state.ThrowTypeError("No function was found that matched the signature provided.");
}
static void LegacyInterfaceTypeCheckingMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("legacyInterfaceTypeCheckingMethod", "TestInterface", ExceptionMessages::NotEnoughArguments(1, info.Length())));
return;
}
TestInterfaceEmpty* test_interface_empty_arg;
test_interface_empty_arg = V8TestInterfaceEmpty::ToImplWithTypeCheck(info.GetIsolate(), info[0]);
impl->legacyInterfaceTypeCheckingMethod(test_interface_empty_arg);
}
static void SideEffectFreeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->sideEffectFreeMethod();
}
static void SecureContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextMethod();
}
static void SecureContextRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextRuntimeEnabledMethod();
}
static void SecureContextnessRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextnessRuntimeEnabledMethod();
}
static void SecureContextWindowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextWindowExposedMethod();
}
static void SecureContextWorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextWorkerExposedMethod();
}
static void SecureContextWindowExposedRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextWindowExposedRuntimeEnabledMethod();
}
static void SecureContextWorkerExposedRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->secureContextWorkerExposedRuntimeEnabledMethod();
}
static void MethodWithNullableSequencesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "methodWithNullableSequences");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 4)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(4, info.Length()));
return;
}
Vector<base::Optional<double>> numbers;
Vector<String> strings;
HeapVector<Member<Element>> elements;
HeapVector<DoubleOrString> unions;
numbers = NativeValueTraits<IDLSequence<IDLNullable<IDLDouble>>>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
strings = NativeValueTraits<IDLSequence<IDLStringOrNull>>::NativeValue(info.GetIsolate(), info[1], exception_state);
if (exception_state.HadException())
return;
elements = NativeValueTraits<IDLSequence<IDLNullable<Element>>>::NativeValue(info.GetIsolate(), info[2], exception_state);
if (exception_state.HadException())
return;
unions = NativeValueTraits<IDLSequence<IDLNullable<DoubleOrString>>>::NativeValue(info.GetIsolate(), info[3], exception_state);
if (exception_state.HadException())
return;
impl->methodWithNullableSequences(numbers, strings, elements, unions);
}
static void MethodWithNullableRecordsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "methodWithNullableRecords");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 4)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(4, info.Length()));
return;
}
Vector<std::pair<String, base::Optional<double>>> numbers;
Vector<std::pair<String, String>> strings;
HeapVector<std::pair<String, Member<Element>>> elements;
HeapVector<std::pair<String, DoubleOrString>> unions;
numbers = NativeValueTraits<IDLRecord<IDLString, IDLNullable<IDLDouble>>>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
strings = NativeValueTraits<IDLRecord<IDLString, IDLStringOrNull>>::NativeValue(info.GetIsolate(), info[1], exception_state);
if (exception_state.HadException())
return;
elements = NativeValueTraits<IDLRecord<IDLString, IDLNullable<Element>>>::NativeValue(info.GetIsolate(), info[2], exception_state);
if (exception_state.HadException())
return;
unions = NativeValueTraits<IDLRecord<IDLString, IDLNullable<DoubleOrString>>>::NativeValue(info.GetIsolate(), info[3], exception_state);
if (exception_state.HadException())
return;
impl->methodWithNullableRecords(numbers, strings, elements, unions);
}
static void ImplementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
impl->implementsVoidMethod();
}
static void ImplementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "implementsComplexMethod");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 2)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(2, info.Length()));
return;
}
V8StringResource<> str_arg;
TestInterfaceEmpty* test_interface_empty_arg;
str_arg = info[0];
if (!str_arg.Prepare())
return;
test_interface_empty_arg = V8TestInterfaceEmpty::ToImplWithTypeCheck(info.GetIsolate(), info[1]);
if (!test_interface_empty_arg) {
exception_state.ThrowTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
return;
}
ExecutionContext* execution_context = ExecutionContext::ForRelevantRealm(info);
TestInterfaceEmpty* result = impl->implementsComplexMethod(execution_context, str_arg, test_interface_empty_arg, exception_state);
if (exception_state.HadException()) {
return;
}
V8SetReturnValue(info, result);
}
static void ImplementsStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation::implementsStaticVoidMethod();
}
static void Implements2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestImplements2::implements2VoidMethod(*impl);
}
static void Implements3VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestImplements3Implementation::implements3VoidMethod(*impl);
}
static void Implements3StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestImplements3Implementation::implements3StaticVoidMethod();
}
static void PartialVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartial::partialVoidMethod(*impl);
}
static void PartialStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfacePartial::partialStaticVoidMethod();
}
static void PartialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "partialVoidMethodLongArg");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length()));
return;
}
int32_t long_arg;
long_arg = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), info[0], exception_state);
if (exception_state.HadException())
return;
TestInterfacePartial::partialVoidMethodLongArg(*impl, long_arg);
}
static void PartialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "partialCallWithExecutionContextRaisesExceptionVoidMethod");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
ExecutionContext* execution_context = ExecutionContext::ForRelevantRealm(info);
TestInterfacePartial::partialCallWithExecutionContextRaisesExceptionVoidMethod(execution_context, *impl, exception_state);
if (exception_state.HadException()) {
return;
}
}
static void PartialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", ExceptionMessages::NotEnoughArguments(1, info.Length())));
return;
}
ScriptValue partial_callback_type_arg;
if (info[0]->IsFunction()) {
partial_callback_type_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), info[0]);
} else {
V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", "The callback provided as parameter 1 is not a function."));
return;
}
TestInterfacePartial::partialVoidMethodPartialCallbackTypeArg(*impl, partial_callback_type_arg);
}
static void Partial2VoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartial2Implementation::partial2VoidMethod(*impl);
}
static void Partial2StaticVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfacePartial2Implementation::partial2StaticVoidMethod();
}
static void Partial2SecureContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartial2Implementation::partial2SecureContextMethod(*impl);
}
static void PartialSecureContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartialSecureContext::partialSecureContextMethod(*impl);
}
static void PartialSecureContextRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartialSecureContext::partialSecureContextRuntimeEnabledMethod(*impl);
}
static void PartialSecureContextWindowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartialSecureContext::partialSecureContextWindowExposedMethod(*impl);
}
static void PartialSecureContextWorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartialSecureContext::partialSecureContextWorkerExposedMethod(*impl);
}
static void PartialSecureContextWindowExposedRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartialSecureContext::partialSecureContextWindowExposedRuntimeEnabledMethod(*impl);
}
static void PartialSecureContextWorkerExposedRuntimeEnabledMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
TestInterfacePartialSecureContext::partialSecureContextWorkerExposedRuntimeEnabledMethod(*impl);
}
static void VoidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
switch (std::min(1, info.Length())) {
case 0:
if (true) {
VoidMethodPartialOverload1Method(info);
return;
}
break;
case 1:
if (info[0]->IsNumber()) {
VoidMethodPartialOverload2Method(info);
return;
}
if (true) {
VoidMethodPartialOverload2Method(info);
return;
}
break;
}
DCHECK(voidMethodPartialOverloadMethodForPartialInterface);
(voidMethodPartialOverloadMethodForPartialInterface)(info);
}
static void StaticVoidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
switch (std::min(1, info.Length())) {
case 0:
if (true) {
StaticVoidMethodPartialOverload1Method(info);
return;
}
break;
case 1:
break;
}
DCHECK(staticVoidMethodPartialOverloadMethodForPartialInterface);
(staticVoidMethodPartialOverloadMethodForPartialInterface)(info);
}
static void PromiseMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
switch (std::min(1, info.Length())) {
case 0:
if (true) {
PromiseMethodPartialOverload1Method(info);
return;
}
break;
case 1:
if (V8Window::HasInstance(info[0], info.GetIsolate())) {
PromiseMethodPartialOverload2Method(info);
return;
}
break;
}
DCHECK(promiseMethodPartialOverloadMethodForPartialInterface);
(promiseMethodPartialOverloadMethodForPartialInterface)(info);
}
static void StaticPromiseMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
switch (std::min(1, info.Length())) {
case 0:
if (true) {
StaticPromiseMethodPartialOverload1Method(info);
return;
}
break;
case 1:
break;
}
DCHECK(staticPromiseMethodPartialOverloadMethodForPartialInterface);
(staticPromiseMethodPartialOverloadMethodForPartialInterface)(info);
}
static void Partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
switch (std::min(1, info.Length())) {
case 0:
if (true) {
Partial2VoidMethod1Method(info);
return;
}
break;
case 1:
break;
}
DCHECK(partial2VoidMethodMethodForPartialInterface);
(partial2VoidMethodMethodForPartialInterface)(info);
}
static void Partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
switch (std::min(1, info.Length())) {
case 0:
if (true) {
Partial2StaticVoidMethod1Method(info);
return;
}
break;
case 1:
break;
}
DCHECK(partial2StaticVoidMethodMethodForPartialInterface);
(partial2StaticVoidMethodMethodForPartialInterface)(info);
}
static void KeysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "keys");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
ScriptState* script_state = ScriptState::ForRelevantRealm(info);
Iterator* result = impl->keysForBinding(script_state, exception_state);
if (exception_state.HadException()) {
return;
}
V8SetReturnValue(info, result);
}
static void ValuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "values");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
ScriptState* script_state = ScriptState::ForRelevantRealm(info);
Iterator* result = impl->valuesForBinding(script_state, exception_state);
if (exception_state.HadException()) {
return;
}
V8SetReturnValue(info, result);
}
static void ForEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestInterface", "forEach");
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
ScriptState* script_state = ScriptState::ForRelevantRealm(info);
if (UNLIKELY(info.Length() < 1)) {
exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length()));
return;
}
ScriptValue callback;
ScriptValue this_arg;
if (info[0]->IsFunction()) {
callback = ScriptValue(ScriptState::Current(info.GetIsolate()), info[0]);
} else {
exception_state.ThrowTypeError("The callback provided as parameter 1 is not a function.");
return;
}
this_arg = ScriptValue(ScriptState::Current(info.GetIsolate()), info[1]);
impl->forEachForBinding(script_state, ScriptValue(script_state, info.Holder()), callback, this_arg, exception_state);
if (exception_state.HadException()) {
return;
}
}
static void ToStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestInterfaceImplementation* impl = V8TestInterface::ToImpl(info.Holder());
<