| // 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" |
| #include "V8TestObject.h" |
| |
| #include "HTMLNames.h" |
| #include "RuntimeEnabledFeatures.h" |
| #include "V8DOMStringList.h" |
| #include "V8Document.h" |
| #include "V8MessagePort.h" |
| #include "V8Node.h" |
| #include "V8TestCallbackInterface.h" |
| #include "V8TestInterface.h" |
| #include "V8TestNode.h" |
| #include "V8TestObjectectA.h" |
| #include "V8TestObjectectB.h" |
| #include "V8TestObjectectC.h" |
| #include "V8TestSubObj.h" |
| #include "bindings/v8/BindingSecurity.h" |
| #include "bindings/v8/Dictionary.h" |
| #include "bindings/v8/ExceptionState.h" |
| #include "bindings/v8/ScriptState.h" |
| #include "bindings/v8/ScriptValue.h" |
| #include "bindings/v8/SerializedScriptValue.h" |
| #include "bindings/v8/V8AbstractEventListener.h" |
| #include "bindings/v8/V8DOMActivityLogger.h" |
| #include "bindings/v8/V8DOMConfiguration.h" |
| #include "bindings/v8/V8EventListenerList.h" |
| #include "bindings/v8/V8HiddenValue.h" |
| #include "bindings/v8/V8ObjectConstructor.h" |
| #include "bindings/v8/custom/V8Float32ArrayCustom.h" |
| #include "core/css/MediaQueryListListener.h" |
| #include "core/dom/ContextFeatures.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
| #include "core/frame/UseCounter.h" |
| #include "platform/TraceEvent.h" |
| #include "wtf/GetPtr.h" |
| #include "wtf/RefPtr.h" |
| |
| namespace WebCore { |
| |
| static void initializeScriptWrappableForInterface(TestObject* object) |
| { |
| if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeInfo); |
| else |
| ASSERT_NOT_REACHED(); |
| } |
| |
| } // namespace WebCore |
| |
| void webCoreInitializeScriptWrappableForInterface(WebCore::TestObject* object) |
| { |
| WebCore::initializeScriptWrappableForInterface(object); |
| } |
| |
| namespace WebCore { |
| const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype, false }; |
| |
| namespace TestObjectV8Internal { |
| |
| template <typename T> void V8_USE(T) { } |
| |
| static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->readOnlyLongAttr()); |
| } |
| |
| static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::readOnlyLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->readOnlyStringAttr(), info.GetIsolate()); |
| } |
| |
| static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::readOnlyStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| RefPtr<TestObject> result(impl->readOnlyTestObjectAttr()); |
| if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get())) |
| return; |
| v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); |
| if (!wrapper.IsEmpty()) { |
| V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "readOnlyTestObjectAttr"), wrapper); |
| v8SetReturnValue(info, wrapper); |
| } |
| } |
| |
| static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::readOnlyTestObjectAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueInt(info, TestObject::staticReadOnlyLongAttr()); |
| } |
| |
| static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::staticReadOnlyLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueString(info, TestObject::staticStringAttr(), info.GetIsolate()); |
| } |
| |
| static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::staticStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void staticStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| TestObject::setStaticStringAttr(cppValue); |
| } |
| |
| static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::staticStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->enumAttr(), info.GetIsolate()); |
| } |
| |
| static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enumAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enumAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| String string = cppValue; |
| if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) |
| return; |
| impl->setEnumAttr(cppValue); |
| } |
| |
| static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enumAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->readOnlyEnumAttr(), info.GetIsolate()); |
| } |
| |
| static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::readOnlyEnumAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->byteAttr()); |
| } |
| |
| static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::byteAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void byteAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(v8Value, exceptionState), exceptionState); |
| impl->setByteAttr(cppValue); |
| } |
| |
| static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::byteAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueUnsigned(info, impl->octetAttr()); |
| } |
| |
| static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::octetAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void octetAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(v8Value, exceptionState), exceptionState); |
| impl->setOctetAttr(cppValue); |
| } |
| |
| static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::octetAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->shortAttr()); |
| } |
| |
| static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::shortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void shortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(v8Value, exceptionState), exceptionState); |
| impl->setShortAttr(cppValue); |
| } |
| |
| static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::shortAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueUnsigned(info, impl->unsignedShortAttr()); |
| } |
| |
| static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::unsignedShortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(v8Value, exceptionState), exceptionState); |
| impl->setUnsignedShortAttr(cppValue); |
| } |
| |
| static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::unsignedShortAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->longAttr()); |
| } |
| |
| static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::longAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void longAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "longAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setLongAttr(cppValue); |
| } |
| |
| static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::longAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, static_cast<double>(impl->longLongAttr())); |
| } |
| |
| static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::longLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void longLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(v8Value, exceptionState), exceptionState); |
| impl->setLongLongAttr(cppValue); |
| } |
| |
| static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::longLongAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttr())); |
| } |
| |
| static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::unsignedLongLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLongAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState); |
| impl->setUnsignedLongLongAttr(cppValue); |
| } |
| |
| static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::unsignedLongLongAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->stringAttr(), info.GetIsolate()); |
| } |
| |
| static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::stringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| impl->setStringAttr(cppValue); |
| } |
| |
| static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::stringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void treatNullAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->treatNullAsNullStringStringAttr(), info.GetIsolate()); |
| } |
| |
| static void treatNullAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void treatNullAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value); |
| impl->setTreatNullAsNullStringStringAttr(cppValue); |
| } |
| |
| static void treatNullAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->treatNullAsNullStringTreatUndefinedAsNullStringStringAttr(), info.GetIsolate()); |
| } |
| |
| static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value); |
| impl->setTreatNullAsNullStringTreatUndefinedAsNullStringStringAttr(cppValue); |
| } |
| |
| static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| EventListener* v8Value = impl->eventHandlerAttr(); |
| v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); |
| } |
| |
| static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::eventHandlerAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| moveEventListenerToNewWrapper(holder, impl->eventHandlerAttr(), v8Value, V8TestObject::eventListenerCacheIndex, info.GetIsolate()); |
| impl->setEventHandlerAttr(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate)); |
| } |
| |
| static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::eventHandlerAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->testObjAttr()), impl); |
| } |
| |
| static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); |
| TestObjectV8Internal::testObjAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void testObjAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| impl->setTestObjAttr(WTF::getPtr(cppValue)); |
| } |
| |
| static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); |
| TestObjectV8Internal::testObjAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->attrWithJSGetterAndSetter(), info.GetIsolate()); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::attrWithJSGetterAndSetterAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| impl->setAttrWithJSGetterAndSetter(cppValue); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| v8::Local<v8::Value> v8Value = info[0]; |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::attrWithJSGetterAndSetterAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->xmlObjAttr()), impl); |
| } |
| |
| static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::XMLObjAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| impl->setXMLObjAttr(WTF::getPtr(cppValue)); |
| } |
| |
| static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::XMLObjAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedstringattrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue); |
| } |
| |
| static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringstringattrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringstringattrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::reflectedintegralattrAttr)); |
| } |
| |
| static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedIntegralAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedIntegralAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue); |
| } |
| |
| static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedIntegralAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueUnsigned(info, std::max(0, impl->getIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr))); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedUnsignedIntegralAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(v8Value, exceptionState), exceptionState); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr, cppValue); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::reflectedbooleanattrAttr)); |
| } |
| |
| static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedBooleanAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(bool, cppValue, v8Value->BooleanValue()); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue); |
| } |
| |
| static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedBooleanAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedurlattrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue); |
| } |
| |
| static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedURLAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedtreatnullasnullstringurlattrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringurlattrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringurlattrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringurlattrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedCustomStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedCustomStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::customContentIntegralAttrAttr)); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedCustomIntegralAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedCustomIntegralAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedCustomIntegralAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr)); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedCustomBooleanAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(bool, cppValue, v8Value->BooleanValue()); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedCustomBooleanAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedCustomURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedCustomURLAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue); |
| } |
| |
| static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::limitedtoonlyoneattributeAttr); |
| if (v8Value.isEmpty()) { |
| ; |
| } else if (equalIgnoringCase(v8Value, "unique")) { |
| v8Value = "unique"; |
| } else { |
| v8Value = ""; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); |
| } |
| |
| static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::limitedtoonlyattributeAttr); |
| if (v8Value.isEmpty()) { |
| ; |
| } else if (equalIgnoringCase(v8Value, "Per")) { |
| v8Value = "Per"; |
| } else if (equalIgnoringCase(v8Value, "Paal")) { |
| v8Value = "Paal"; |
| } else if (equalIgnoringCase(v8Value, "Espen")) { |
| v8Value = "Espen"; |
| } else { |
| v8Value = ""; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedToOnlyAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue); |
| } |
| |
| static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::limitedToOnlyAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::OtherAttr); |
| if (v8Value.isEmpty()) { |
| ; |
| } else if (equalIgnoringCase(v8Value, "Value1")) { |
| v8Value = "Value1"; |
| } else if (equalIgnoringCase(v8Value, "Value2")) { |
| v8Value = "Value2"; |
| } else { |
| v8Value = ""; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::OtherAttr, cppValue); |
| } |
| |
| static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr); |
| if (v8Value.isEmpty()) { |
| v8Value = "rsa"; |
| } else if (equalIgnoringCase(v8Value, "rsa")) { |
| v8Value = "rsa"; |
| } else if (equalIgnoringCase(v8Value, "dsa")) { |
| v8Value = "dsa"; |
| } else { |
| v8Value = ""; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValue); |
| } |
| |
| static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr); |
| if (v8Value.isEmpty()) { |
| v8Value = "auto"; |
| } else if (equalIgnoringCase(v8Value, "ltr")) { |
| v8Value = "ltr"; |
| } else if (equalIgnoringCase(v8Value, "rtl")) { |
| v8Value = "rtl"; |
| } else if (equalIgnoringCase(v8Value, "auto")) { |
| v8Value = "auto"; |
| } else { |
| v8Value = "ltr"; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr, cppValue); |
| } |
| |
| static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithinvalidandmissingdefaultattributeAttr); |
| if (v8Value.isEmpty()) { |
| v8Value = "left"; |
| } else if (equalIgnoringCase(v8Value, "left")) { |
| v8Value = "left"; |
| } else if (equalIgnoringCase(v8Value, "right")) { |
| v8Value = "right"; |
| } else { |
| v8Value = "left"; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| impl->setAttribute(HTMLNames::limitedwithinvalidandmissingdefaultattributeAttr, cppValue); |
| } |
| |
| static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::corssettingattributeAttr); |
| if (v8Value.isNull()) { |
| ; |
| } else if (v8Value.isEmpty()) { |
| v8Value = "anonymous"; |
| } else if (equalIgnoringCase(v8Value, "anonymous")) { |
| v8Value = "anonymous"; |
| } else if (equalIgnoringCase(v8Value, "use-credentials")) { |
| v8Value = "use-credentials"; |
| } else { |
| v8Value = "anonymous"; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::corsSettingAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithemptymissinginvalidattributeAttr); |
| if (v8Value.isNull()) { |
| v8Value = "missing"; |
| } else if (v8Value.isEmpty()) { |
| v8Value = "empty"; |
| } else if (equalIgnoringCase(v8Value, "empty")) { |
| v8Value = "empty"; |
| } else if (equalIgnoringCase(v8Value, "missing")) { |
| v8Value = "missing"; |
| } else if (equalIgnoringCase(v8Value, "invalid")) { |
| v8Value = "invalid"; |
| } else if (equalIgnoringCase(v8Value, "a-normal")) { |
| v8Value = "a-normal"; |
| } else { |
| v8Value = "invalid"; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->typedArrayAttr()), impl); |
| } |
| |
| static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::typedArrayAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(Float32Array*, cppValue, v8Value->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(v8Value)) : 0); |
| impl->setTypedArrayAttr(WTF::getPtr(cppValue)); |
| } |
| |
| static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::typedArrayAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetterException", "TestObject", holder, info.GetIsolate()); |
| int v8Value = impl->attrWithGetterException(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueInt(info, v8Value); |
| } |
| |
| static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::attrWithGetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetterException", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setAttrWithGetterException(cppValue); |
| } |
| |
| static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::attrWithGetterExceptionAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->attrWithSetterException()); |
| } |
| |
| static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::attrWithSetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetterException", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setAttrWithSetterException(cppValue, exceptionState); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::attrWithSetterExceptionAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWithGetterException", "TestObject", holder, info.GetIsolate()); |
| String v8Value = impl->stringAttrWithGetterException(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| impl->setStringAttrWithGetterException(cppValue); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::stringAttrWithGetterExceptionAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueString(info, impl->stringAttrWithSetterException(), info.GetIsolate()); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWithSetterException", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| impl->setStringAttrWithSetterException(cppValue, exceptionState); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::stringAttrWithSetterExceptionAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8TestObject::customAttrAttributeGetterCustom(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8TestObject::customAttrAttributeSetterCustom(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->withExecutionContextAttribute(scriptContext)), impl); |
| } |
| |
| static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::withExecutionContextAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); |
| impl->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue)); |
| } |
| |
| static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::withExecutionContextAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->withActiveWindowAndFirstWindowAttribute()), impl); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| impl->setWithActiveWindowAndFirstWindowAttribute(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), WTF::getPtr(cppValue)); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStateAttributeRaises", "TestObject", holder, info.GetIsolate()); |
| RefPtr<TestObject> v8Value = impl->withScriptStateAttributeRaises(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::withScriptStateAttributeRaisesAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| impl->setWithScriptStateAttributeRaises(WTF::getPtr(cppValue)); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::withScriptStateAttributeRaisesAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->enforcedRangeByteAttr()); |
| } |
| |
| static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeByteAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeByteAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeByteAttr(cppValue); |
| } |
| |
| static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeByteAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueUnsigned(info, impl->enforcedRangeOctetAttr()); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeOctetAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeOctetAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeOctetAttr(cppValue); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeOctetAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->enforcedRangeShortAttr()); |
| } |
| |
| static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeShortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeShortAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeShortAttr(cppValue); |
| } |
| |
| static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeShortAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueUnsigned(info, impl->enforcedRangeUnsignedShortAttr()); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeUnsignedShortAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeUnsignedShortAttr(cppValue); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->enforcedRangeLongAttr()); |
| } |
| |
| static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeLongAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeLongAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueUnsigned(info, impl->enforcedRangeUnsignedLongAttr()); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeUnsignedLongAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeUnsignedLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, static_cast<double>(impl->enforcedRangeLongLongAttr())); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeLongLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeLongLongAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeLongLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeLongLongAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, static_cast<double>(impl->enforcedRangeUnsignedLongLongAttr())); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeUnsignedLongLongAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(v8Value, EnforceRange, exceptionState), exceptionState); |
| impl->setEnforcedRangeUnsignedLongLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->conditionalAttr1()); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::conditionalAttr1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAttr1", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setConditionalAttr1(cppValue); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::conditionalAttr1AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->conditionalAttr2()); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::conditionalAttr2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAttr2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setConditionalAttr2(cppValue); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::conditionalAttr2AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->conditionalAttr3()); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::conditionalAttr3AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAttr3", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setConditionalAttr3(cppValue); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::conditionalAttr3AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| |
| static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, impl->cachedAttribute1().v8Value()); |
| } |
| |
| static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::cachedAttribute1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, impl->cachedAttribute2().v8Value()); |
| } |
| |
| static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::cachedAttribute2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedDirtyableAttribute"); |
| TestObject* impl = V8TestObject::toNative(holder); |
| if (!impl->isValueDirty()) { |
| v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); |
| if (!v8Value.IsEmpty()) { |
| v8SetReturnValue(info, v8Value); |
| return; |
| } |
| } |
| ScriptValue v8Value = impl->cachedDirtyableAttribute(); |
| V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value()); |
| v8SetReturnValue(info, v8Value.v8Value()); |
| } |
| |
| static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::cachedDirtyableAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedDirtyableAttributeRaises"); |
| TestObject* impl = V8TestObject::toNative(holder); |
| if (!impl->isValueDirty()) { |
| v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); |
| if (!v8Value.IsEmpty()) { |
| v8SetReturnValue(info, v8Value); |
| return; |
| } |
| } |
| ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyableAttributeRaises", "TestObject", holder, info.GetIsolate()); |
| ScriptValue v8Value = impl->cachedDirtyableAttributeRaises(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value()); |
| v8SetReturnValue(info, v8Value.v8Value()); |
| } |
| |
| static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, impl->anyAttribute().v8Value()); |
| } |
| |
| static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::anyAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void anyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(v8Value, info.GetIsolate())); |
| impl->setAnyAttribute(cppValue); |
| } |
| |
| static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::anyAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, impl->callbackFunctionAttribute().v8Value()); |
| } |
| |
| static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::callbackFunctionAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(v8Value, info.GetIsolate())); |
| impl->setCallbackFunctionAttribute(cppValue); |
| } |
| |
| static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::callbackFunctionAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->enabledAtRuntimeAttr()); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enabledAtRuntimeAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enabledAtRuntimeAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setEnabledAtRuntimeAttr(cppValue); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enabledAtRuntimeAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->enabledPerContextAttr()); |
| } |
| |
| static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::enabledPerContextAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "enabledPerContextAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setEnabledPerContextAttr(cppValue); |
| } |
| |
| static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::enabledPerContextAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, v8Array(impl->floatArray(), info.GetIsolate())); |
| } |
| |
| static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::floatArrayAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void floatArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(v8Value, 0, info.GetIsolate())); |
| impl->setFloatArray(cppValue); |
| } |
| |
| static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::floatArrayAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, v8Array(impl->doubleArray(), info.GetIsolate())); |
| } |
| |
| static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::doubleArrayAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void doubleArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(v8Value, 0, info.GetIsolate())); |
| impl->setDoubleArray(cppValue); |
| } |
| |
| static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::doubleArrayAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, v8Array(impl->messagePortArray(), info.GetIsolate())); |
| } |
| |
| static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::messagePortArrayAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void messagePortArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray<MessagePort, V8MessagePort>(v8Value, 0, info.GetIsolate()))); |
| impl->setMessagePortArray(cppValue); |
| } |
| |
| static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::messagePortArrayAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocument", "TestObject", holder, info.GetIsolate()); |
| if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->contentDocument(), exceptionState)) { |
| v8SetReturnValueNull(info); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| v8SetReturnValueFast(info, WTF::getPtr(impl->contentDocument()), impl); |
| } |
| |
| static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::contentDocumentAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->blueberry()); |
| } |
| |
| static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::strawberryAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void strawberryAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "strawberry", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setBlueberry(cppValue); |
| } |
| |
| static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::strawberryAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValue(info, impl->strictFloat()); |
| } |
| |
| static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::strictFloatAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void strictFloatAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); |
| impl->setStrictFloat(cppValue); |
| } |
| |
| static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::strictFloatAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->replaceableAttribute()); |
| } |
| |
| static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::replaceableAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| bool isNull = false; |
| double v8Value = impl->nullableDoubleAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValue(info, v8Value); |
| } |
| |
| static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::nullableDoubleAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| bool isNull = false; |
| int v8Value = impl->nullableLongAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueInt(info, v8Value); |
| } |
| |
| static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::nullableLongAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| bool isNull = false; |
| bool v8Value = impl->nullableBooleanAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueBool(info, v8Value); |
| } |
| |
| static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::nullableBooleanAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| bool isNull = false; |
| String v8Value = impl->nullableStringAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueString(info, v8Value, info.GetIsolate()); |
| } |
| |
| static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::nullableStringAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| bool isNull = false; |
| int v8Value = impl->nullableLongSettableAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueInt(info, v8Value); |
| } |
| |
| static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::nullableLongSettableAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "nullableLongSettableAttribute", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setNullableLongSettableAttribute(cppValue); |
| } |
| |
| static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::nullableLongSettableAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| RefPtr<TestObject> result(impl->perWorldReadOnlyAttribute()); |
| if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get())) |
| return; |
| v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); |
| if (!wrapper.IsEmpty()) { |
| V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldReadOnlyAttribute"), wrapper); |
| v8SetReturnValue(info, wrapper); |
| } |
| } |
| |
| static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| RefPtr<TestObject> result(impl->perWorldReadOnlyAttribute()); |
| if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(info.GetReturnValue(), result.get())) |
| return; |
| v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); |
| if (!wrapper.IsEmpty()) { |
| V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldReadOnlyAttribute"), wrapper); |
| v8SetReturnValue(info, wrapper); |
| } |
| } |
| |
| static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldAttribute()), impl); |
| } |
| |
| static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::perWorldAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| impl->setPerWorldAttribute(WTF::getPtr(cppValue)); |
| } |
| |
| static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::perWorldAttributeAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldAttribute())); |
| } |
| |
| static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::perWorldAttributeAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); |
| impl->setPerWorldAttribute(WTF::getPtr(cppValue)); |
| } |
| |
| static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::perWorldAttributeAttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttr1()); |
| } |
| |
| static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedAttr1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttr1", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttr1(cppValue); |
| } |
| |
| static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedAttr1AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttr2()); |
| } |
| |
| static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedAttr2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttr2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttr2(cppValue); |
| } |
| |
| static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedAttr2AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttr2()); |
| } |
| |
| static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttr2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttr2(cppValue); |
| } |
| |
| static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttr()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedInIsolatedWorldsAttr(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttr()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedInIsolatedWorldsAttr(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttrSetter1()); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedAttrSetter1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrSetter1", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttrSetter1(cppValue); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedAttrSetter1AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttrSetter2()); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrSetter2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttrSetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttrSetter2()); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrSetter2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttrSetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrSetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrSetter", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| v8::Handle<v8::Value> loggerArg[] = { v8Value }; |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrSetter", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrSetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrSetter", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttrGetter1()); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedAttrGetter1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrGetter1", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttrGetter1(cppValue); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedAttrGetter1AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttrGetter2()); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrGetter2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttrGetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedAttrGetter2()); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrGetter2", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedAttrGetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrGetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrGetter", 0, 0, "Getter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrGetter", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrGetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrGetter", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueInt(info, TestObject::deprecatedStaticReadOnlyAttr()); |
| } |
| |
| static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticReadonlyAttribute); |
| TestObjectV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueInt(info, TestObject::deprecatedStaticAttr()); |
| } |
| |
| static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticAttribute); |
| TestObjectV8Internal::deprecatedStaticAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedStaticAttr", "TestObject", holder, info.GetIsolate()); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| TestObject::setDeprecatedStaticAttr(cppValue); |
| } |
| |
| static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticAttribute); |
| TestObjectV8Internal::deprecatedStaticAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->deprecatedReadonlyAttr()); |
| } |
| |
| static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::ReadonlyAttribute); |
| TestObjectV8Internal::deprecatedReadonlyAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueInt(info, impl->deprecatedAttr()); |
| } |
| |
| static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Attribute); |
| TestObjectV8Internal::deprecatedAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedAttr", "TestObject", holder, info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(holder); |
| V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); |
| impl->setDeprecatedAttr(cppValue); |
| } |
| |
| static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Attribute); |
| TestObjectV8Internal::deprecatedAttrAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->location()), impl); |
| } |
| |
| static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::locationAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* proxyImpl = V8TestObject::toNative(holder); |
| RefPtr<TestNode> impl = WTF::getPtr(proxyImpl->location()); |
| if (!impl) |
| return; |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| impl->setHref(cppValue); |
| } |
| |
| static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::locationAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* impl = V8TestObject::toNative(holder); |
| v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithException()), impl); |
| } |
| |
| static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjectV8Internal::locationWithExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| v8::Handle<v8::Object> holder = info.Holder(); |
| TestObject* proxyImpl = V8TestObject::toNative(holder); |
| RefPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithException()); |
| if (!impl) |
| return; |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
| impl->setHrefThrows(cppValue); |
| } |
| |
| static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjectV8Internal::locationWithExceptionAttributeSetter(v8Value, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void TestObjectConstructorGetter(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 TestSubObjMeasuredConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); |
| TestObjectV8Internal::TestObjectConstructorGetter(property, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedConstructorConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::ConstructorAttribute); |
| TestObjectV8Internal::TestObjectConstructorGetter(property, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void TestObjectReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| info.This()->ForceSet(name, v8Value); |
| } |
| |
| static void TestObjectReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObjectV8Internal::TestObjectReplaceableAttributeSetter(name, v8Value, info); |
| } |
| |
| static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->voidMethod(); |
| } |
| |
| static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::voidMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodWithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 3)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[2])); |
| impl->voidMethodWithArgs(longArg, strArg, objArg); |
| } |
| |
| static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::voidMethodWithArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, impl->longMethod()); |
| } |
| |
| static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::longMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodWithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 3)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[2])); |
| v8SetReturnValueInt(info, impl->longMethodWithArgs(longArg, strArg, objArg)); |
| } |
| |
| static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::longMethodWithArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, impl->objMethod()); |
| } |
| |
| static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); |
| TestObjectV8Internal::objMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 3)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[2])); |
| v8SetReturnValue(info, impl->objMethodWithArgs(longArg, strArg, objArg)); |
| } |
| |
| static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::objMethodWithArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNativeArray<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); |
| impl->methodWithSequenceArg(sequenceArg); |
| } |
| |
| static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithSequenceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodReturningSequence", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| v8SetReturnValue(info, v8Array(impl->methodReturningSequence(longArg), info.GetIsolate())); |
| } |
| |
| static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodReturningSequenceMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); |
| String string = enumArg; |
| if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.GetIsolate()); |
| return; |
| } |
| impl->methodWithEnumArg(enumArg); |
| } |
| |
| static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnumArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatRequiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[1])); |
| RefPtr<TestObject> result = impl->methodThatRequiresAllArgsAndThrows(strArg, objArg, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListener", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(RefPtrWillBeRawPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(ScriptValue(info[0], info.GetIsolate()))); |
| impl->methodQueryListListener(listener); |
| } |
| |
| static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodQueryListListenerMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "serializedValue", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate()); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| impl->serializedValue(serializedArg); |
| } |
| |
| static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::serializedValueMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); |
| if (!oo.isUndefinedOrNull() && !oo.isObject()) { |
| throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 1 ('oo') is not an object."), info.GetIsolate()); |
| return; |
| } |
| V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); |
| if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { |
| throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); |
| return; |
| } |
| impl->optionsObject(oo, ooo); |
| } |
| |
| static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::optionsObjectMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate())); |
| impl->optionsObjectList(list); |
| } |
| |
| static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::optionsObjectListMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->methodWithException(exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| } |
| |
| static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::CustomTestFeature); |
| V8TestObject::customMethodMethodCustom(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8TestObject::customMethodWithArgsMethodCustom(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| impl->withScriptStateVoid(&state); |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| } |
| |
| static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withScriptStateVoidMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| RefPtr<TestObject> result = impl->withScriptStateObj(&state); |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withScriptStateObjMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateVoidException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| impl->withScriptStateVoidException(&state, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| } |
| |
| static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withScriptStateVoidExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| RefPtr<TestObject> result = impl->withScriptStateObjException(&state, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withScriptStateObjExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); |
| impl->withExecutionContext(scriptContext); |
| } |
| |
| static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withExecutionContextMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); |
| impl->withExecutionContextAndScriptState(&state, scriptContext); |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| } |
| |
| static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withExecutionContextAndScriptStateMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecutionContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); |
| RefPtr<TestObject> result = impl->withExecutionContextAndScriptStateObjException(&state, scriptContext, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate()); |
| RefPtr<TestObject> result = impl->withExecutionContextAndScriptStateWithSpaces(&state, scriptContext); |
| if (state.hadException()) { |
| v8::Local<v8::Value> exception = state.exception(); |
| state.clearException(); |
| throwError(exception, info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->withActiveWindowAndFirstWindow(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate())); |
| } |
| |
| static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::withActiveWindowAndFirstWindowMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| if (UNLIKELY(info.Length() <= 0)) { |
| impl->methodWithOptionalArg(); |
| return; |
| } |
| V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[0], exceptionState), exceptionState); |
| impl->methodWithOptionalArg(opt); |
| } |
| |
| static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithNonOptionalArgAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exceptionState); |
| if (UNLIKELY(info.Length() <= 1)) { |
| impl->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
| return; |
| } |
| V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[1], exceptionState), exceptionState); |
| impl->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
| } |
| |
| static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithNonOptionalArgAndTwoOptionalArgs", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exceptionState); |
| if (UNLIKELY(info.Length() <= 1)) { |
| impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
| return; |
| } |
| V8TRYCATCH_EXCEPTION_VOID(int, opt1, toInt32(info[1], exceptionState), exceptionState); |
| if (UNLIKELY(info.Length() <= 2)) { |
| impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); |
| return; |
| } |
| V8TRYCATCH_EXCEPTION_VOID(int, opt2, toInt32(info[2], exceptionState), exceptionState); |
| impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); |
| } |
| |
| static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| if (UNLIKELY(info.Length() <= 0)) { |
| impl->methodWithOptionalString(); |
| return; |
| } |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| impl->methodWithOptionalString(str); |
| } |
| |
| static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithOptionalStringMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| impl->methodWithOptionalStringIsUndefined(str); |
| } |
| |
| static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithOptionalStringIsUndefinedMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull(info, 0)); |
| impl->methodWithOptionalStringIsNullString(str); |
| } |
| |
| static void methodWithOptionalStringIsNullStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithOptionalStringIsNullStringMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); |
| impl->methodWithCallbackInterfaceArg(callbackInterface.release()); |
| } |
| |
| static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithCallbackInterfaceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithNonCallbackArgAndCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, nonCallback, toInt32(info[0], exceptionState), exceptionState); |
| if (info.Length() <= 1 || !info[1]->IsFunction()) { |
| exceptionState.throwTypeError("The callback provided as parameter 2 is not a function."); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[1]), currentExecutionContext(info.GetIsolate())); |
| impl->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackInterface.release()); |
| } |
| |
| static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| OwnPtr<TestCallbackInterface> callbackInterface; |
| if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { |
| if (!info[0]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); |
| } |
| impl->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release()); |
| } |
| |
| static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullptr : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); |
| impl->methodWithNullableCallbackInterfaceArg(callbackInterface.release()); |
| } |
| |
| static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithNullableCallbackInterfaceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| OwnPtr<TestCallbackInterface> callbackInterface; |
| if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { |
| if (!info[0]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); |
| } |
| TestObject::staticMethodWithCallbackAndOptionalArg(callbackInterface.release()); |
| } |
| |
| static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); |
| TestObject::staticMethodWithCallbackArg(callbackInterface.release()); |
| } |
| |
| static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::staticMethodWithCallbackArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt8", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, value, toInt8(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeInt8(value); |
| } |
| |
| static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeInt8Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt8", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt8(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeUInt8(value); |
| } |
| |
| static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeUInt8Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt16", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, value, toInt16(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeInt16(value); |
| } |
| |
| static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeInt16Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt16", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt16(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeUInt16(value); |
| } |
| |
| static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeUInt16Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt32", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, value, toInt32(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeInt32(value); |
| } |
| |
| static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeInt32Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt32", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt32(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeUInt32(value); |
| } |
| |
| static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeUInt32Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt64", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(long long, value, toInt64(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeInt64(value); |
| } |
| |
| static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeInt64Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt64", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(unsigned long long, value, toUInt64(info[0], EnforceRange, exceptionState), exceptionState); |
| impl->methodWithEnforceRangeUInt64(value); |
| } |
| |
| static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithEnforceRangeUInt64Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| #if ENABLE(Condition1) |
| static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, impl->conditionalMethod1(), info.GetIsolate()); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) |
| static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::conditionalMethod1Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->conditionalMethod2(); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::conditionalMethod2Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->conditionalMethod3(); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::conditionalMethod3Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, impl->callbackFunctionReturnValue().v8Value()); |
| } |
| |
| static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::callbackFunctionReturnValueMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgument", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate())); |
| impl->callbackFunctionArgument(function); |
| } |
| |
| static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::callbackFunctionArgumentMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->overloadedMethod(longArg); |
| } |
| |
| static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> callbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); |
| impl->overloadedMethod(callbackInterfaceArg.release()); |
| } |
| |
| static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| impl->overloadedMethod(objArg); |
| } |
| |
| static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate())); |
| impl->overloadedMethod(arrayArg); |
| } |
| |
| static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[0], 1, info.GetIsolate())); |
| impl->overloadedMethod(sequenceArg); |
| } |
| |
| static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedMethod1Method(info); |
| return; |
| } |
| if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction()))) { |
| overloadedMethod2Method(info); |
| return; |
| } |
| if (((info.Length() == 1) && (V8TestObject::hasInstance(info[0], info.GetIsolate())))) { |
| overloadedMethod3Method(info); |
| return; |
| } |
| if (((info.Length() == 1) && (info[0]->IsArray()))) { |
| overloadedMethod4Method(info); |
| return; |
| } |
| if (((info.Length() == 1) && (info[0]->IsArray()))) { |
| overloadedMethod5Method(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::overloadedMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| if (UNLIKELY(info.Length() <= 1)) { |
| impl->overloadedMethodA(objArg); |
| return; |
| } |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState); |
| impl->overloadedMethodA(objArg, longArg); |
| } |
| |
| static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| impl->overloadedMethodA(objArg, strArg); |
| } |
| |
| static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate()))) || ((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate())))) { |
| overloadedMethodA1Method(info); |
| return; |
| } |
| if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate())))) { |
| overloadedMethodA2Method(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::overloadedMethodAMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| impl->overloadedMethodB(strArg); |
| } |
| |
| static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| impl->overloadedMethodB(strArg); |
| } |
| |
| static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedMethodB1Method(info); |
| return; |
| } |
| if (((info.Length() == 1) && (isUndefinedOrNull(info[0]) || info[0]->IsString() || info[0]->IsObject()))) { |
| overloadedMethodB2Method(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::overloadedMethodBMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[0], info.GetIsolate())); |
| if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate()); |
| return; |
| } |
| impl->overloadedMethodC(dictionaryArg); |
| } |
| |
| static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue())); |
| impl->overloadedMethodC(doubleArg); |
| } |
| |
| static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1) && (info[0]->IsObject()))) { |
| overloadedMethodC1Method(info); |
| return; |
| } |
| if (((info.Length() == 1))) { |
| overloadedMethodC2Method(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::overloadedMethodCMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject::classMethod(); |
| } |
| |
| static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::classMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethodWithOptional", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() <= 0)) { |
| v8SetReturnValueInt(info, TestObject::classMethodWithOptional()); |
| return; |
| } |
| V8TRYCATCH_EXCEPTION_VOID(int, arg, toInt32(info[0], exceptionState), exceptionState); |
| v8SetReturnValueInt(info, TestObject::classMethodWithOptional(arg)); |
| } |
| |
| static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::classMethodWithOptionalMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8TestObject::classMethod2MethodCustom(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethodWithClamp", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| unsigned objArgsShort = 0; |
| V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); |
| if (!std::isnan(objArgsShortNativeValue)) |
| objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); |
| unsigned objArgsLong = 0; |
| V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); |
| if (!std::isnan(objArgsLongNativeValue)) |
| objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); |
| impl->classMethodWithClamp(objArgsShort, objArgsLong); |
| } |
| |
| static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::classMethodWithClampMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledAtRuntimeMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->enabledAtRuntimeMethod(longArg); |
| } |
| |
| static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::enabledAtRuntimeMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledPerContextMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->enabledPerContextMethod(longArg); |
| } |
| |
| static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::enabledPerContextMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLongSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(info[0], 1, info.GetIsolate())); |
| impl->methodWithUnsignedLongSequence(unsignedLongSequence); |
| } |
| |
| static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::methodWithUnsignedLongSequenceMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArrayFunction", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate())); |
| Vector<String> result = impl->stringArrayFunction(values, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
| } |
| |
| static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::stringArrayFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringListFunction", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| RefPtr<DOMStringList> result = impl->domStringListFunction(values, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::domStringListFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestNode*, value, V8TestNode::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| impl->convert1(value); |
| } |
| |
| static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::convert1Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestNode*, value, V8TestNode::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| impl->convert2(value); |
| } |
| |
| static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::convert2Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->banana(); |
| } |
| |
| static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::orangeMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunction", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 3)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); |
| V8TRYCATCH_EXCEPTION_VOID(int, b, toInt32(info[2], exceptionState), exceptionState); |
| bool result = impl->strictFunction(str, a, b, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8SetReturnValueBool(info, result); |
| } |
| |
| static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::strictFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); |
| V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); |
| impl->variadicStringMethod(head, tail); |
| } |
| |
| static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::variadicStringMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); |
| V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); |
| impl->variadicDoubleMethod(head, tail); |
| } |
| |
| static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::variadicDoubleMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Node*, head, V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0])); |
| Vector<RefPtr<Node> > tail; |
| for (int i = 1; i < info.Length(); ++i) { |
| if (!V8Node::hasInstance(info[i], info.GetIsolate())) { |
| throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); |
| return; |
| } |
| tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); |
| } |
| impl->variadicNodeMethod(head, tail); |
| } |
| |
| static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::variadicNodeMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->perWorldMethod(); |
| } |
| |
| static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::perWorldMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->perWorldMethod(); |
| } |
| |
| static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::perWorldMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->overloadedPerWorldMethod(longArg); |
| } |
| |
| static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->overloadedPerWorldMethod(longArg); |
| } |
| |
| static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState); |
| impl->overloadedPerWorldMethod(strArg, longArg); |
| } |
| |
| static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedPerWorldMethod1Method(info); |
| return; |
| } |
| if (((info.Length() == 2))) { |
| overloadedPerWorldMethod2Method(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::overloadedPerWorldMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState); |
| impl->overloadedPerWorldMethod(strArg, longArg); |
| } |
| |
| static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedPerWorldMethod1MethodForMainWorld(info); |
| return; |
| } |
| if (((info.Length() == 2))) { |
| overloadedPerWorldMethod2MethodForMainWorld(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedMethod1", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->activityLoggedMethod1(longArg); |
| } |
| |
| static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); |
| contextData->activityLogger()->log("TestObject.activityLoggedMethod1", info.Length(), loggerArgs.data(), "Method"); |
| } |
| TestObjectV8Internal::activityLoggedMethod1Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedMethod2", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->activityLoggedMethod2(longArg); |
| } |
| |
| static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); |
| contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method"); |
| } |
| TestObjectV8Internal::activityLoggedMethod2Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedMethod2", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->activityLoggedMethod2(longArg); |
| } |
| |
| static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); |
| contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method"); |
| } |
| TestObjectV8Internal::activityLoggedMethod2MethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->activityLoggedInIsolatedWorldMethod(longArg); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldMethod", info.Length(), loggerArgs.data(), "Method"); |
| } |
| TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->activityLoggedInIsolatedWorldMethod(longArg); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->overloadedActivityLoggedMethod(longArg); |
| } |
| |
| static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState); |
| impl->overloadedActivityLoggedMethod(longArg); |
| } |
| |
| static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState); |
| impl->overloadedActivityLoggedMethod(strArg, longArg); |
| } |
| |
| static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedActivityLoggedMethod1Method(info); |
| return; |
| } |
| if (((info.Length() == 2))) { |
| overloadedActivityLoggedMethod2Method(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); |
| contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method"); |
| } |
| TestObjectV8Internal::overloadedActivityLoggedMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState); |
| impl->overloadedActivityLoggedMethod(strArg, longArg); |
| } |
| |
| static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedActivityLoggedMethod1MethodForMainWorld(info); |
| return; |
| } |
| if (((info.Length() == 2))) { |
| overloadedActivityLoggedMethod2MethodForMainWorld(info); |
| return; |
| } |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| exceptionState.throwTypeError("No function was found that matched the signature provided."); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext()); |
| if (contextData && contextData->activityLogger()) { |
| Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); |
| contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method"); |
| } |
| TestObjectV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| impl->deprecatedMethod(); |
| } |
| |
| static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Method); |
| TestObjectV8Internal::deprecatedMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObject::deprecatedStaticMethod(); |
| } |
| |
| static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticMethod); |
| TestObjectV8Internal::deprecatedStaticMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| RefPtr<Node> result = impl->anonymousIndexedGetter(index); |
| if (!result) |
| return; |
| v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); |
| } |
| |
| static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| TestObjectV8Internal::indexedPropertyGetter(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; |
| |
| TestObject* impl = V8TestObject::toNative(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"); |
| TestObjectV8Internal::namedPropertyGetter(name, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| AtomicString propertyName = toCoreAtomicString(name); |
| v8::String::Utf8Value namedProperty(name); |
| ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestObject", 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"); |
| TestObjectV8Internal::namedPropertyQuery(name, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) |
| { |
| TestObject* impl = V8TestObject::toNative(info.Holder()); |
| v8::Isolate* isolate = info.GetIsolate(); |
| Vector<String> names; |
| ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestObject", info.Holder(), isolate); |
| impl->namedPropertyEnumerator(names, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size()); |
| for (size_t i = 0; i < names.size(); ++i) |
| v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i])); |
| v8SetReturnValue(info, v8names); |
| } |
| |
| static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| TestObjectV8Internal::namedPropertyEnumerator(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| } |
| |
| } // namespace TestObjectV8Internal |
| |
| static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = { |
| {"readOnlyLongAttr", TestObjectV8Internal::readOnlyLongAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"readOnlyStringAttr", TestObjectV8Internal::readOnlyStringAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"readOnlyTestObjectAttr", TestObjectV8Internal::readOnlyTestObjectAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"TestSubObj", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| {"enumAttr", TestObjectV8Internal::enumAttrAttributeGetterCallback, TestObjectV8Internal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"readOnlyEnumAttr", TestObjectV8Internal::readOnlyEnumAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"byteAttr", TestObjectV8Internal::byteAttrAttributeGetterCallback, TestObjectV8Internal::byteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"octetAttr", TestObjectV8Internal::octetAttrAttributeGetterCallback, TestObjectV8Internal::octetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"shortAttr", TestObjectV8Internal::shortAttrAttributeGetterCallback, TestObjectV8Internal::shortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"unsignedShortAttr", TestObjectV8Internal::unsignedShortAttrAttributeGetterCallback, TestObjectV8Internal::unsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"longAttr", TestObjectV8Internal::longAttrAttributeGetterCallback, TestObjectV8Internal::longAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"longLongAttr", TestObjectV8Internal::longLongAttrAttributeGetterCallback, TestObjectV8Internal::longLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"unsignedLongLongAttr", TestObjectV8Internal::unsignedLongLongAttrAttributeGetterCallback, TestObjectV8Internal::unsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"stringAttr", TestObjectV8Internal::stringAttrAttributeGetterCallback, TestObjectV8Internal::stringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"treatNullAsNullStringStringAttr", TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"treatNullAsNullStringTreatUndefinedAsNullStringStringAttr", TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"eventHandlerAttr", TestObjectV8Internal::eventHandlerAttrAttributeGetterCallback, TestObjectV8Internal::eventHandlerAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"testObjAttr", TestObjectV8Internal::testObjAttrAttributeGetterCallback, TestObjectV8Internal::testObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"TestSubObjMeasured", TestObjectV8Internal::TestSubObjMeasuredConstructorGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| {"XMLObjAttr", TestObjectV8Internal::XMLObjAttrAttributeGetterCallback, TestObjectV8Internal::XMLObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedStringAttr", TestObjectV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedIntegralAttr", TestObjectV8Internal::reflectedIntegralAttrAttributeGetterCallback, TestObjectV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedUnsignedIntegralAttr", TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeGetterCallback, TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedBooleanAttr", TestObjectV8Internal::reflectedBooleanAttrAttributeGetterCallback, TestObjectV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedURLAttr", TestObjectV8Internal::reflectedURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomStringAttr", TestObjectV8Internal::reflectedCustomStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringCustomStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomIntegralAttr", TestObjectV8Internal::reflectedCustomIntegralAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomBooleanAttr", TestObjectV8Internal::reflectedCustomBooleanAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomURLAttr", TestObjectV8Internal::reflectedCustomURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringCustomURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedToOnlyOneAttribute", TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedToOnlyAttribute", TestObjectV8Internal::limitedToOnlyAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedToOnlyOtherAttribute", TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedWithMissingDefaultAttribute", TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedWithInvalidMissingDefaultAttribute", TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedWithInvalidAndMissingDefaultAttribute", TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"corsSettingAttribute", TestObjectV8Internal::corsSettingAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"limitedWithEmptyMissingInvalidAttribute", TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"typedArrayAttr", TestObjectV8Internal::typedArrayAttrAttributeGetterCallback, TestObjectV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"attrWithGetterException", TestObjectV8Internal::attrWithGetterExceptionAttributeGetterCallback, TestObjectV8Internal::attrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"attrWithSetterException", TestObjectV8Internal::attrWithSetterExceptionAttributeGetterCallback, TestObjectV8Internal::attrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"stringAttrWithGetterException", TestObjectV8Internal::stringAttrWithGetterExceptionAttributeGetterCallback, TestObjectV8Internal::stringAttrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"stringAttrWithSetterException", TestObjectV8Internal::stringAttrWithSetterExceptionAttributeGetterCallback, TestObjectV8Internal::stringAttrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"customAttr", TestObjectV8Internal::customAttrAttributeGetterCallback, TestObjectV8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withExecutionContextAttribute", TestObjectV8Internal::withExecutionContextAttributeAttributeGetterCallback, TestObjectV8Internal::withExecutionContextAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withActiveWindowAndFirstWindowAttribute", TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetterCallback, TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withScriptStateAttributeRaises", TestObjectV8Internal::withScriptStateAttributeRaisesAttributeGetterCallback, TestObjectV8Internal::withScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeByteAttr", TestObjectV8Internal::enforcedRangeByteAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeByteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeOctetAttr", TestObjectV8Internal::enforcedRangeOctetAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeOctetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeShortAttr", TestObjectV8Internal::enforcedRangeShortAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeUnsignedShortAttr", TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeLongAttr", TestObjectV8Internal::enforcedRangeLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeUnsignedLongAttr", TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeLongLongAttr", TestObjectV8Internal::enforcedRangeLongLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeUnsignedLongLongAttr", TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| #if ENABLE(Condition1) |
| {"conditionalAttr1", TestObjectV8Internal::conditionalAttr1AttributeGetterCallback, TestObjectV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| #endif // ENABLE(Condition1) |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| {"conditionalAttr2", TestObjectV8Internal::conditionalAttr2AttributeGetterCallback, TestObjectV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| {"conditionalAttr3", TestObjectV8Internal::conditionalAttr3AttributeGetterCallback, TestObjectV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3) |
| #if ENABLE(Condition1) |
| {"conditionalAttr4", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectA::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| #endif // ENABLE(Condition1) |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| {"conditionalAttr5", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectB::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| {"conditionalAttr6", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectC::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| {"cachedAttribute1", TestObjectV8Internal::cachedAttribute1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"cachedAttribute2", TestObjectV8Internal::cachedAttribute2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"cachedDirtyableAttribute", TestObjectV8Internal::cachedDirtyableAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"cachedDirtyableAttributeRaises", TestObjectV8Internal::cachedDirtyableAttributeRaisesAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"anyAttribute", TestObjectV8Internal::anyAttributeAttributeGetterCallback, TestObjectV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"callbackFunctionAttribute", TestObjectV8Internal::callbackFunctionAttributeAttributeGetterCallback, TestObjectV8Internal::callbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"floatArray", TestObjectV8Internal::floatArrayAttributeGetterCallback, TestObjectV8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"doubleArray", TestObjectV8Internal::doubleArrayAttributeGetterCallback, TestObjectV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"messagePortArray", TestObjectV8Internal::messagePortArrayAttributeGetterCallback, TestObjectV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"contentDocument", TestObjectV8Internal::contentDocumentAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"strawberry", TestObjectV8Internal::strawberryAttributeGetterCallback, TestObjectV8Internal::strawberryAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"strictFloat", TestObjectV8Internal::strictFloatAttributeGetterCallback, TestObjectV8Internal::strictFloatAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"replaceableAttribute", TestObjectV8Internal::replaceableAttributeAttributeGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableDoubleAttribute", TestObjectV8Internal::nullableDoubleAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableLongAttribute", TestObjectV8Internal::nullableLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableBooleanAttribute", TestObjectV8Internal::nullableBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableStringAttribute", TestObjectV8Internal::nullableStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableLongSettableAttribute", TestObjectV8Internal::nullableLongSettableAttributeAttributeGetterCallback, TestObjectV8Internal::nullableLongSettableAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"perWorldReadOnlyAttribute", TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterCallback, 0, TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"perWorldAttribute", TestObjectV8Internal::perWorldAttributeAttributeGetterCallback, TestObjectV8Internal::perWorldAttributeAttributeSetterCallback, TestObjectV8Internal::perWorldAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::perWorldAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttr1", TestObjectV8Internal::activityLoggedAttr1AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttr2", TestObjectV8Internal::activityLoggedAttr2AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttr2AttributeSetterCallback, TestObjectV8Internal::activityLoggedAttr2AttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedAttr2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedInIsolatedWorldsAttr", TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrSetter1", TestObjectV8Internal::activityLoggedAttrSetter1AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrSetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrSetter2", TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterCallback, TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedInIsolatedWorldsAttrSetter", TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrGetter1", TestObjectV8Internal::activityLoggedAttrGetter1AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrGetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrGetter2", TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterCallback, TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedInIsolatedWorldsAttrGetter", TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"deprecatedReadonlyAttr", TestObjectV8Internal::deprecatedReadonlyAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"deprecatedAttr", TestObjectV8Internal::deprecatedAttrAttributeGetterCallback, TestObjectV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"deprecatedConstructor", TestObjectV8Internal::deprecatedConstructorConstructorGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, |
| {"location", TestObjectV8Internal::locationAttributeGetterCallback, TestObjectV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"locationWithException", TestObjectV8Internal::locationWithExceptionAttributeGetterCallback, TestObjectV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| }; |
| |
| static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { |
| {"attrWithJSGetterAndSetter", TestObjectV8Internal::attrWithJSGetterAndSetterAttributeGetterCallback, TestObjectV8Internal::attrWithJSGetterAndSetterAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)}, |
| }; |
| |
| static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { |
| {"voidMethod", TestObjectV8Internal::voidMethodMethodCallback, 0, 0}, |
| {"voidMethodWithArgs", TestObjectV8Internal::voidMethodWithArgsMethodCallback, 0, 3}, |
| {"longMethod", TestObjectV8Internal::longMethodMethodCallback, 0, 0}, |
| {"longMethodWithArgs", TestObjectV8Internal::longMethodWithArgsMethodCallback, 0, 3}, |
| {"objMethod", TestObjectV8Internal::objMethodMethodCallback, 0, 0}, |
| {"objMethodWithArgs", TestObjectV8Internal::objMethodWithArgsMethodCallback, 0, 3}, |
| {"methodWithSequenceArg", TestObjectV8Internal::methodWithSequenceArgMethodCallback, 0, 1}, |
| {"methodReturningSequence", TestObjectV8Internal::methodReturningSequenceMethodCallback, 0, 1}, |
| {"methodWithEnumArg", TestObjectV8Internal::methodWithEnumArgMethodCallback, 0, 1}, |
| {"methodThatRequiresAllArgsAndThrows", TestObjectV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, 0, 2}, |
| {"methodQueryListListener", TestObjectV8Internal::methodQueryListListenerMethodCallback, 0, 1}, |
| {"serializedValue", TestObjectV8Internal::serializedValueMethodCallback, 0, 1}, |
| {"optionsObject", TestObjectV8Internal::optionsObjectMethodCallback, 0, 1}, |
| {"optionsObjectList", TestObjectV8Internal::optionsObjectListMethodCallback, 0, 1}, |
| {"methodWithException", TestObjectV8Internal::methodWithExceptionMethodCallback, 0, 0}, |
| {"customMethod", TestObjectV8Internal::customMethodMethodCallback, 0, 0}, |
| {"customMethodWithArgs", TestObjectV8Internal::customMethodWithArgsMethodCallback, 0, 3}, |
| {"withScriptStateVoid", TestObjectV8Internal::withScriptStateVoidMethodCallback, 0, 0}, |
| {"withScriptStateObj", TestObjectV8Internal::withScriptStateObjMethodCallback, 0, 0}, |
| {"withScriptStateVoidException", TestObjectV8Internal::withScriptStateVoidExceptionMethodCallback, 0, 0}, |
| {"withScriptStateObjException", TestObjectV8Internal::withScriptStateObjExceptionMethodCallback, 0, 0}, |
| {"withExecutionContext", TestObjectV8Internal::withExecutionContextMethodCallback, 0, 0}, |
| {"withExecutionContextAndScriptState", TestObjectV8Internal::withExecutionContextAndScriptStateMethodCallback, 0, 0}, |
| {"withExecutionContextAndScriptStateObjException", TestObjectV8Internal::withExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0}, |
| {"withExecutionContextAndScriptStateWithSpaces", TestObjectV8Internal::withExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0}, |
| {"withActiveWindowAndFirstWindow", TestObjectV8Internal::withActiveWindowAndFirstWindowMethodCallback, 0, 0}, |
| {"methodWithOptionalArg", TestObjectV8Internal::methodWithOptionalArgMethodCallback, 0, 0}, |
| {"methodWithNonOptionalArgAndOptionalArg", TestObjectV8Internal::methodWithNonOptionalArgAndOptionalArgMethodCallback, 0, 1}, |
| {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjectV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1}, |
| {"methodWithOptionalString", TestObjectV8Internal::methodWithOptionalStringMethodCallback, 0, 0}, |
| {"methodWithOptionalStringIsUndefined", TestObjectV8Internal::methodWithOptionalStringIsUndefinedMethodCallback, 0, 0}, |
| {"methodWithOptionalStringIsNullString", TestObjectV8Internal::methodWithOptionalStringIsNullStringMethodCallback, 0, 0}, |
| {"methodWithCallbackInterfaceArg", TestObjectV8Internal::methodWithCallbackInterfaceArgMethodCallback, 0, 1}, |
| {"methodWithNonCallbackArgAndCallbackInterfaceArg", TestObjectV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback, 0, 2}, |
| {"methodWithCallbackInterfaceAndOptionalArg", TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethodCallback, 0, 0}, |
| {"methodWithNullableCallbackInterfaceArg", TestObjectV8Internal::methodWithNullableCallbackInterfaceArgMethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt8", TestObjectV8Internal::methodWithEnforceRangeInt8MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt8", TestObjectV8Internal::methodWithEnforceRangeUInt8MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt16", TestObjectV8Internal::methodWithEnforceRangeInt16MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt16", TestObjectV8Internal::methodWithEnforceRangeUInt16MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt32", TestObjectV8Internal::methodWithEnforceRangeInt32MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt32", TestObjectV8Internal::methodWithEnforceRangeUInt32MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt64", TestObjectV8Internal::methodWithEnforceRangeInt64MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt64", TestObjectV8Internal::methodWithEnforceRangeUInt64MethodCallback, 0, 1}, |
| #if ENABLE(Condition1) |
| {"conditionalMethod1", TestObjectV8Internal::conditionalMethod1MethodCallback, 0, 0}, |
| #endif // ENABLE(Condition1) |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| {"conditionalMethod2", TestObjectV8Internal::conditionalMethod2MethodCallback, 0, 0}, |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| {"conditionalMethod3", TestObjectV8Internal::conditionalMethod3MethodCallback, 0, 0}, |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| {"callbackFunctionReturnValue", TestObjectV8Internal::callbackFunctionReturnValueMethodCallback, 0, 0}, |
| {"callbackFunctionArgument", TestObjectV8Internal::callbackFunctionArgumentMethodCallback, 0, 1}, |
| {"overloadedMethod", TestObjectV8Internal::overloadedMethodMethodCallback, 0, 1}, |
| {"overloadedMethodA", TestObjectV8Internal::overloadedMethodAMethodCallback, 0, 1}, |
| {"overloadedMethodB", TestObjectV8Internal::overloadedMethodBMethodCallback, 0, 1}, |
| {"overloadedMethodC", TestObjectV8Internal::overloadedMethodCMethodCallback, 0, 1}, |
| {"classMethodWithClamp", TestObjectV8Internal::classMethodWithClampMethodCallback, 0, 2}, |
| {"methodWithUnsignedLongSequence", TestObjectV8Internal::methodWithUnsignedLongSequenceMethodCallback, 0, 1}, |
| {"stringArrayFunction", TestObjectV8Internal::stringArrayFunctionMethodCallback, 0, 1}, |
| {"domStringListFunction", TestObjectV8Internal::domStringListFunctionMethodCallback, 0, 1}, |
| {"convert1", TestObjectV8Internal::convert1MethodCallback, 0, 1}, |
| {"convert2", TestObjectV8Internal::convert2MethodCallback, 0, 1}, |
| {"orange", TestObjectV8Internal::orangeMethodCallback, 0, 0}, |
| {"strictFunction", TestObjectV8Internal::strictFunctionMethodCallback, 0, 3}, |
| {"variadicStringMethod", TestObjectV8Internal::variadicStringMethodMethodCallback, 0, 2}, |
| {"variadicDoubleMethod", TestObjectV8Internal::variadicDoubleMethodMethodCallback, 0, 2}, |
| {"variadicNodeMethod", TestObjectV8Internal::variadicNodeMethodMethodCallback, 0, 2}, |
| {"perWorldMethod", TestObjectV8Internal::perWorldMethodMethodCallback, TestObjectV8Internal::perWorldMethodMethodCallbackForMainWorld, 0}, |
| {"overloadedPerWorldMethod", TestObjectV8Internal::overloadedPerWorldMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld, 1}, |
| {"activityLoggedMethod1", TestObjectV8Internal::activityLoggedMethod1MethodCallback, 0, 1}, |
| {"activityLoggedMethod2", TestObjectV8Internal::activityLoggedMethod2MethodCallback, TestObjectV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1}, |
| {"activityLoggedInIsolatedWorldMethod", TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld, 1}, |
| {"overloadedActivityLoggedMethod", TestObjectV8Internal::overloadedActivityLoggedMethodMethodCallback, TestObjectV8Internal::overloadedActivityLoggedMethodMethodCallbackForMainWorld, 1}, |
| {"deprecatedMethod", TestObjectV8Internal::deprecatedMethodMethodCallback, 0, 0}, |
| }; |
| |
| static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) |
| { |
| functionTemplate->ReadOnlyPrototype(); |
| |
| v8::Local<v8::Signature> defaultSignature; |
| defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", V8EventTarget::domTemplate(isolate), V8TestObject::internalFieldCount, |
| V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), |
| V8TestObjectAccessors, WTF_ARRAY_LENGTH(V8TestObjectAccessors), |
| V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), |
| isolate); |
| v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate(); |
| v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate(); |
| if (RuntimeEnabledFeatures::featureNameEnabled()) { |
| static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ |
| {"enabledAtRuntimeAttr", TestObjectV8Internal::enabledAtRuntimeAttrAttributeGetterCallback, TestObjectV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; |
| V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); |
| } |
| static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = { |
| {"DEPRECATED_CONSTANT", 1}, |
| }; |
| V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate); |
| COMPILE_ASSERT(1 == TestObject::DEPRECATED_CONSTANT, TheValueOfTestObject_DEPRECATED_CONSTANTDoesntMatchWithImplementation); |
| functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestObjectV8Internal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObject>); |
| functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestObjectV8Internal::namedPropertyGetterCallback, 0, TestObjectV8Internal::namedPropertyQueryCallback, 0, TestObjectV8Internal::namedPropertyEnumeratorCallback); |
| functionTemplate->Set(v8AtomicString(isolate, "staticMethodWithCallbackAndOptionalArg"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->Set(v8AtomicString(isolate, "staticMethodWithCallbackArg"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1)); |
| functionTemplate->Set(v8AtomicString(isolate, "classMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->Set(v8AtomicString(isolate, "classMethodWithOptional"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->Set(v8AtomicString(isolate, "classMethod2"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1)); |
| if (RuntimeEnabledFeatures::featureNameEnabled()) |
| prototypeTemplate->Set(v8AtomicString(isolate, "enabledAtRuntimeMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1)); |
| functionTemplate->Set(v8AtomicString(isolate, "deprecatedStaticMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticReadOnlyLongAttr"), TestObjectV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttr"), TestObjectV8Internal::staticStringAttrAttributeGetterCallback, TestObjectV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "deprecatedStaticReadOnlyAttr"), TestObjectV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "deprecatedStaticAttr"), TestObjectV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjectV8Internal::deprecatedStaticAttrAttributeSetterCallback, 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::current()->toStringTemplate()); |
| } |
| |
| v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate) |
| { |
| V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo)); |
| if (!result.IsEmpty()) |
| return result; |
| |
| TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode); |
| configureV8TestObjectTemplate(result, isolate); |
| data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result); |
| return result; |
| } |
| |
| bool V8TestObject::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
| { |
| return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); |
| } |
| |
| v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
| { |
| return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); |
| } |
| |
| TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
| { |
| return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; |
| } |
| |
| void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestObject* impl, v8::Isolate* isolate) |
| { |
| v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype()); |
| if (ContextFeatures::featureNameEnabled(impl->document())) { |
| static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ |
| {"enabledPerContextAttr", TestObjectV8Internal::enabledPerContextAttrAttributeGetterCallback, TestObjectV8Internal::enabledPerContextAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; |
| V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); |
| } |
| } |
| |
| void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate) |
| { |
| v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate)); |
| |
| ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext()); |
| if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) |
| prototypeTemplate->Set(v8AtomicString(isolate, "enabledPerContextMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction()); |
| } |
| |
| EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object) |
| { |
| return toNative(object); |
| } |
| |
| v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| { |
| ASSERT(impl); |
| ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); |
| if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get()); |
| // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have |
| // the same object de-ref functions, though, so use that as the basis of the check. |
| RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); |
| } |
| |
| v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| if (UNLIKELY(wrapper.IsEmpty())) |
| return wrapper; |
| |
| installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
| return wrapper; |
| } |
| |
| void V8TestObject::derefObject(void* object) |
| { |
| fromInternalPointer(object)->deref(); |
| } |
| |
| template<> |
| v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| { |
| return toV8(impl, creationContext, isolate); |
| } |
| |
| } // namespace WebCore |