Index: Source/bindings/tests/results/modules/V8TestInterface5.cpp |
diff --git a/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/Source/bindings/tests/results/modules/V8TestInterface5.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..51bf8e52b7817adcdcadbf1bdf71a258cf68c3a1 |
--- /dev/null |
+++ b/Source/bindings/tests/results/modules/V8TestInterface5.cpp |
@@ -0,0 +1,883 @@ |
+// 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 by code_generator_v8.py. DO NOT MODIFY! |
+ |
+#include "config.h" |
+#if ENABLE(CONDITION) |
+#include "V8TestInterface5.h" |
+ |
+#include "bindings/core/v8/ExceptionState.h" |
+#include "bindings/core/v8/ScriptState.h" |
+#include "bindings/core/v8/V8DOMConfiguration.h" |
+#include "bindings/core/v8/V8HiddenValue.h" |
+#include "bindings/core/v8/V8ObjectConstructor.h" |
+#include "bindings/tests/v8/V8Iterator.h" |
+#include "bindings/tests/v8/V8TestInterface5.h" |
+#include "bindings/tests/v8/V8TestInterfaceEmpty.h" |
+#include "core/dom/ContextFeatures.h" |
+#include "core/dom/Document.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
+#include "platform/TraceEvent.h" |
+#include "wtf/GetPtr.h" |
+#include "wtf/RefPtr.h" |
+ |
+namespace blink { |
+ |
+const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::derefObject, V8TestInterface5::createPersistentHandle, V8TestInterface5::toActiveDOMObject, 0, V8TestInterface5::visitDOMWrapper, V8TestInterface5::installConditionallyEnabledMethods, V8TestInterface5::installConditionallyEnabledProperties, &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject }; |
+ |
+// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterface5Implementation.h. |
+// For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
+// bindings/core/v8/ScriptWrappable.h. |
+const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestInterface5::wrapperTypeInfo; |
+ |
+namespace TestInterface5ImplementationV8Internal { |
+ |
+template <typename T> void V8_USE(T) { } |
+ |
+static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); |
+} |
+ |
+static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceAttribute", "TestInterface5", holder, info.GetIsolate()); |
+ if (!V8TestInterface5::hasInstance(v8Value, info.GetIsolate())) { |
+ exceptionState.throwTypeError("The provided value is not of type 'TestInterface5'."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID(TestInterface5Implementation*, cppValue, V8TestInterface5::toImplWithTypeCheck(info.GetIsolate(), v8Value)); |
+ impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); |
+} |
+ |
+static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void doubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValue(info, impl->doubleAttribute()); |
+} |
+ |
+static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterface5", holder, info.GetIsolate()); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())); |
+ if (!std::isfinite(cppValue)) { |
+ exceptionState.throwTypeError("The provided double value is non-finite."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ impl->setDoubleAttribute(cppValue); |
+} |
+ |
+static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValue(info, impl->floatAttribute()); |
+} |
+ |
+static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestInterface5", holder, info.GetIsolate()); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); |
+ if (!std::isfinite(cppValue)) { |
+ exceptionState.throwTypeError("The provided float value is non-finite."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ impl->setFloatAttribute(cppValue); |
+} |
+ |
+static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void unrestrictedDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); |
+} |
+ |
+static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())); |
+ impl->setUnrestrictedDoubleAttribute(cppValue); |
+} |
+ |
+static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); |
+} |
+ |
+static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); |
+ impl->setUnrestrictedFloatAttribute(cppValue); |
+} |
+ |
+static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void staticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribute(), info.GetIsolate()); |
+} |
+ |
+static void staticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); |
+ TestInterface5Implementation::setStaticStringAttribute(cppValue); |
+} |
+ |
+static void staticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void alwaysExposedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); |
+} |
+ |
+static void alwaysExposedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "alwaysExposedAttribute", "TestInterface5", holder, info.GetIsolate()); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
+ impl->setAlwaysExposedAttribute(cppValue); |
+} |
+ |
+static void alwaysExposedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void workerExposedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->workerExposedAttribute()); |
+} |
+ |
+static void workerExposedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "workerExposedAttribute", "TestInterface5", holder, info.GetIsolate()); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
+ impl->setWorkerExposedAttribute(cppValue); |
+} |
+ |
+static void workerExposedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void windowExposedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->windowExposedAttribute()); |
+} |
+ |
+static void windowExposedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ v8::Handle<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "windowExposedAttribute", "TestInterface5", holder, info.GetIsolate()); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
+ TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
+ impl->setWindowExposedAttribute(cppValue); |
+} |
+ |
+static void windowExposedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void TestInterface5ImplementationConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Value> data = info.Data(); |
+ ASSERT(data->IsExternal()); |
+ V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); |
+ if (!perContextData) |
+ return; |
+ v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data))); |
+} |
+ |
+static void TestInterface5ImplementationForceSetAttributeOnThis(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ if (info.This()->IsObject()) |
+ v8::Handle<v8::Object>::Cast(info.This())->ForceSet(name, v8Value); |
+} |
+ |
+static void TestInterface5ImplementationForceSetAttributeOnThisCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
+{ |
+ TestInterface5ImplementationV8Internal::TestInterface5ImplementationForceSetAttributeOnThis(name, v8Value, info); |
+} |
+ |
+static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ if (UNLIKELY(info.Length() < 1)) { |
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestInterface5", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); |
+ return; |
+ } |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ TestInterfaceEmpty* testInterfaceEmptyArg; |
+ { |
+ v8::TryCatch block; |
+ V8RethrowTryCatchScope rethrow(block); |
+ if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { |
+ V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); |
+ return; |
+ } |
+ TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0])); |
+ } |
+ impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); |
+} |
+ |
+static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ if (UNLIKELY(info.Length() < 2)) { |
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodDoubleArgFloatArg", "TestInterface5", 2, info.Length(), info.GetIsolate()), info.GetIsolate()); |
+ return; |
+ } |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ double doubleArg; |
+ float floatArg; |
+ { |
+ v8::TryCatch block; |
+ V8RethrowTryCatchScope rethrow(block); |
+ TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberValue())); |
+ if (!std::isfinite(doubleArg)) { |
+ V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFloatArg", "TestInterface5", "double parameter 1 is non-finite."), info.GetIsolate()); |
+ return; |
+ } |
+ TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[1]->NumberValue())); |
+ if (!std::isfinite(floatArg)) { |
+ V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFloatArg", "TestInterface5", "float parameter 2 is non-finite."), info.GetIsolate()); |
+ return; |
+ } |
+ } |
+ impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); |
+} |
+ |
+static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ if (UNLIKELY(info.Length() < 2)) { |
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface5", 2, info.Length(), info.GetIsolate()), info.GetIsolate()); |
+ return; |
+ } |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ double unrestrictedDoubleArg; |
+ float unrestrictedFloatArg; |
+ { |
+ v8::TryCatch block; |
+ V8RethrowTryCatchScope rethrow(block); |
+ TONATIVE_VOID_INTERNAL(unrestrictedDoubleArg, static_cast<double>(info[0]->NumberValue())); |
+ TONATIVE_VOID_INTERNAL(unrestrictedFloatArg, static_cast<float>(info[1]->NumberValue())); |
+ } |
+ impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleArg, unrestrictedFloatArg); |
+} |
+ |
+static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ impl->voidMethod(); |
+} |
+ |
+static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::voidMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ impl->voidMethod(); |
+} |
+ |
+static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ impl->alwaysExposedMethod(); |
+} |
+ |
+static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ impl->workerExposedMethod(); |
+} |
+ |
+static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ impl->windowExposedMethod(); |
+} |
+ |
+static void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation::alwaysExposedStaticMethod(); |
+} |
+ |
+static void alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation::workerExposedStaticMethod(); |
+} |
+ |
+static void workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation::windowExposedStaticMethod(); |
+} |
+ |
+static void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ impl->windowAndServiceWorkerExposedMethod(); |
+} |
+ |
+static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); |
+} |
+ |
+static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::toStringMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface5", info.Holder(), info.GetIsolate()); |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
+ RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState); |
+ if (exceptionState.hadException()) { |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ v8SetReturnValue(info, result.release()); |
+} |
+ |
+static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface5ImplementationV8Internal::iteratorMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ String result = impl->anonymousIndexedGetter(index); |
+ if (result.isNull()) |
+ return; |
+ v8SetReturnValueString(info, result, info.GetIsolate()); |
+} |
+ |
+static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
+ TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ TOSTRING_VOID(V8StringResource<>, propertyValue, v8Value); |
+ bool result = impl->anonymousIndexedSetter(index, propertyValue); |
+ if (!result) |
+ return; |
+ v8SetReturnValue(info, v8Value); |
+} |
+ |
+static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
+ TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ DeleteResult result = impl->anonymousIndexedDeleter(index); |
+ if (result != DeleteUnknownProperty) |
+ return v8SetReturnValueBool(info, result == DeleteSuccess); |
+} |
+ |
+static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
+ TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ if (info.Holder()->HasRealNamedProperty(name)) |
+ return; |
+ if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
+ return; |
+ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ AtomicString propertyName = toCoreAtomicString(name); |
+ String result = impl->anonymousNamedGetter(propertyName); |
+ if (result.isNull()) |
+ return; |
+ v8SetReturnValueString(info, result, info.GetIsolate()); |
+} |
+ |
+static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ if (info.Holder()->HasRealNamedProperty(name)) |
+ return; |
+ if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
+ return; |
+ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ TOSTRING_VOID(V8StringResource<>, propertyName, name); |
+ TOSTRING_VOID(V8StringResource<>, propertyValue, v8Value); |
+ bool result = impl->anonymousNamedSetter(propertyName, propertyValue); |
+ if (!result) |
+ return; |
+ v8SetReturnValue(info, v8Value); |
+} |
+ |
+static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ AtomicString propertyName = toCoreAtomicString(name); |
+ v8::String::Utf8Value namedProperty(name); |
+ ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface5", info.Holder(), info.GetIsolate()); |
+ bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ if (!result) |
+ return; |
+ v8SetReturnValueInt(info, v8::None); |
+} |
+ |
+static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ AtomicString propertyName = toCoreAtomicString(name); |
+ DeleteResult result = impl->anonymousNamedDeleter(propertyName); |
+ if (result != DeleteUnknownProperty) |
+ return v8SetReturnValueBool(info, result == DeleteSuccess); |
+} |
+ |
+static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ TestInterface5ImplementationV8Internal::namedPropertyDeleter(name, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) |
+{ |
+ TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
+ Vector<String> names; |
+ ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface5", info.Holder(), info.GetIsolate()); |
+ impl->namedPropertyEnumerator(names, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size()); |
+ for (size_t i = 0; i < names.size(); ++i) |
+ v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i])); |
+ v8SetReturnValue(info, v8names); |
+} |
+ |
+static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+} // namespace TestInterface5ImplementationV8Internal |
+ |
+void V8TestInterface5::visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate) |
+{ |
+ TestInterface5Implementation* impl = internalPointer->toImpl<TestInterface5Implementation>(); |
+ v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper); |
+ V8WrapperInstantiationScope scope(creationContext, isolate); |
+ TestInterface5Implementation* referencedName = impl->referencedName(); |
+ if (referencedName) { |
+ if (!DOMDataStore::containsWrapper<V8TestInterface5>(referencedName, isolate)) |
+ wrap(referencedName, creationContext, isolate); |
+ DOMDataStore::setWrapperReference<V8TestInterface5>(wrapper, referencedName, isolate); |
+ } |
+ setObjectGroup(internalPointer, wrapper, isolate); |
+} |
+ |
+static const V8DOMConfiguration::AttributeConfiguration V8TestInterface5Attributes[] = { |
+ {"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+ {"testInterfaceConstructorAttribute", TestInterface5ImplementationV8Internal::TestInterface5ImplementationConstructorGetter, TestInterface5ImplementationV8Internal::TestInterface5ImplementationForceSetAttributeOnThisCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+ {"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+ {"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+ {"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+ {"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+ {"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+}; |
+ |
+static const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { |
+ {"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, |
+ {"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, |
+ {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, |
+ {"voidMethod", TestInterface5ImplementationV8Internal::voidMethodMethodCallback, TestInterface5ImplementationV8Internal::voidMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts}, |
+ {"alwaysExposedMethod", TestInterface5ImplementationV8Internal::alwaysExposedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, |
+}; |
+ |
+static void installV8TestInterface5Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) |
+{ |
+ functionTemplate->ReadOnlyPrototype(); |
+ |
+ v8::Local<v8::Signature> defaultSignature; |
+ if (!RuntimeEnabledFeatures::featureNameEnabled()) |
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface5::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate); |
+ else |
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterface5", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface5::internalFieldCount, |
+ V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attributes), |
+ 0, 0, |
+ V8TestInterface5Methods, WTF_ARRAY_LENGTH(V8TestInterface5Methods), |
+ isolate); |
+ v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate(); |
+ v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate(); |
+ static const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[] = { |
+ {"UNSIGNED_LONG", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}, |
+ {"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort}, |
+ }; |
+ V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants), isolate); |
+ functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterface5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface5Implementation>); |
+ functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterface5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5ImplementationV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Internal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::namedPropertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEnumeratorCallback); |
+ static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Internal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; |
+ V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::DontDelete, symbolKeyedIteratorConfiguration, isolate); |
+ functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom); |
+ static const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMethodMethodConfiguration = { |
+ "alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, |
+ }; |
+ V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>(), v8::None, alwaysExposedStaticMethodMethodConfiguration, isolate); |
+ static const V8DOMConfiguration::MethodConfiguration toStringMethodConfiguration = { |
+ "toString", TestInterface5ImplementationV8Internal::toStringMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, |
+ }; |
+ V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum), toStringMethodConfiguration, isolate); |
+ functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttribute"), TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
+ |
+ // Custom toString template |
+ functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); |
+} |
+ |
+v8::Handle<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isolate) |
+{ |
+ return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template); |
+} |
+ |
+bool V8TestInterface5::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); |
+} |
+ |
+v8::Handle<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); |
+} |
+ |
+TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
+{ |
+ return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestInterface5Implementation>() : 0; |
+} |
+ |
+void V8TestInterface5::installConditionallyEnabledProperties(v8::Handle<v8::Object> instanceObject, v8::Isolate* isolate) |
+{ |
+ v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instanceObject->GetPrototype()); |
+ ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext()); |
+ |
+ if (context && (context->isWorkerGlobalScope())) { |
+ static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ |
+ {"workerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; |
+ V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attributeConfiguration, isolate); |
+ } |
+ if (context && (context->isDocument())) { |
+ static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ |
+ {"windowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; |
+ V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attributeConfiguration, isolate); |
+ } |
+} |
+ |
+void V8TestInterface5::installConditionallyEnabledMethods(v8::Handle<v8::Object> prototypeObject, v8::Isolate* isolate) |
+{ |
+ v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate)); |
+ ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext()); |
+ ASSERT(context); |
+ |
+ if (context && (context->isWorkerGlobalScope())) { |
+ prototypeObject->Set(v8AtomicString(isolate, "workerExposedMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::workerExposedMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
+ } |
+ if (context && (context->isDocument())) { |
+ prototypeObject->Set(v8AtomicString(isolate, "windowExposedMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::windowExposedMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
+ } |
+ if (context && (context->isWorkerGlobalScope())) { |
+ prototypeObject->Set(v8AtomicString(isolate, "workerExposedStaticMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
+ } |
+ if (context && (context->isDocument())) { |
+ prototypeObject->Set(v8AtomicString(isolate, "windowExposedStaticMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
+ } |
+ if (context && (context->isDocument() || context->isServiceWorkerGlobalScope())) { |
+ prototypeObject->Set(v8AtomicString(isolate, "windowAndServiceWorkerExposedMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); |
+ } |
+} |
+ |
+ActiveDOMObject* V8TestInterface5::toActiveDOMObject(v8::Handle<v8::Object> wrapper) |
+{ |
+ return toImpl(wrapper); |
+} |
+ |
+ |
+void V8TestInterface5::refObject(ScriptWrappableBase* internalPointer) |
+{ |
+ internalPointer->toImpl<TestInterface5Implementation>()->ref(); |
+} |
+ |
+void V8TestInterface5::derefObject(ScriptWrappableBase* internalPointer) |
+{ |
+ internalPointer->toImpl<TestInterface5Implementation>()->deref(); |
+} |
+ |
+WrapperPersistentNode* V8TestInterface5::createPersistentHandle(ScriptWrappableBase* internalPointer) |
+{ |
+ ASSERT_NOT_REACHED(); |
+ return 0; |
+} |
+ |
+template<> |
+v8::Handle<v8::Value> toV8NoInline(TestInterface5Implementation* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
+{ |
+ return toV8(impl, creationContext, isolate); |
+} |
+ |
+} // namespace blink |
+#endif // ENABLE(CONDITION) |