| /* |
| * Copyright (C) 2013 Google Inc. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| * met: |
| * |
| * * Redistributions of source code must retain the above copyright |
| * notice, this list of conditions and the following disclaimer. |
| * * Redistributions in binary form must reproduce the above |
| * copyright notice, this list of conditions and the following disclaimer |
| * in the documentation and/or other materials provided with the |
| * distribution. |
| * * Neither the name of Google Inc. nor the names of its |
| * contributors may be used to endorse or promote products derived from |
| * this software without specific prior written permission. |
| * |
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| |
| // This file has been auto-generated by code_generator_v8.pm. 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 "V8SVGAnimatedString.h" |
| #include "V8SVGDocument.h" |
| #include "V8SVGPoint.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/V8HiddenPropertyName.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/DOMWindow.h" |
| #include "core/frame/UseCounter.h" |
| #include "core/svg/properties/SVGPropertyTearOff.h" |
| #include "core/svg/properties/SVGStaticPropertyTearOff.h" |
| #include "platform/TraceEvent.h" |
| #include "wtf/GetPtr.h" |
| #include "wtf/RefPtr.h" |
| |
| namespace WebCore { |
| |
| static void initializeScriptWrappableForInterface(TestObj* object) |
| { |
| if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeInfo); |
| else |
| ASSERT_NOT_REACHED(); |
| } |
| |
| } // namespace WebCore |
| |
| // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows: |
| // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function |
| // in the global namespace. |
| // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c) |
| void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* 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 }; |
| |
| namespace TestObjV8Internal { |
| |
| template <typename T> void V8_USE(T) { } |
| |
| static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->readOnlyLongAttr()); |
| } |
| |
| static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::readOnlyLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->readOnlyStringAttr(), info.GetIsolate()); |
| } |
| |
| static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::readOnlyStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| RefPtr<TestObj> result = imp->readOnlyTestObjectAttr(); |
| if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get())) |
| return; |
| v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); |
| if (!wrapper.IsEmpty()) { |
| V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "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"); |
| TestObjV8Internal::readOnlyTestObjectAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueInt(info, TestObj::staticReadOnlyLongAttr()); |
| } |
| |
| static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::staticReadOnlyLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueString(info, TestObj::staticStringAttr(), info.GetIsolate()); |
| } |
| |
| static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::staticStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void staticStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| TestObj::setStaticStringAttr(cppValue); |
| } |
| |
| static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::staticStringAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->enumAttr(), info.GetIsolate()); |
| } |
| |
| static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enumAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enumAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| String string = cppValue; |
| if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) |
| return; |
| imp->setEnumAttr(cppValue); |
| } |
| |
| static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enumAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->readOnlyEnumAttr(), info.GetIsolate()); |
| } |
| |
| static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::readOnlyEnumAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->byteAttr()); |
| } |
| |
| static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::byteAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void byteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt8(jsValue)); |
| imp->setByteAttr(cppValue); |
| } |
| |
| static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::byteAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueUnsigned(info, imp->octetAttr()); |
| } |
| |
| static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::octetAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void octetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(unsigned, cppValue, toUInt8(jsValue)); |
| imp->setOctetAttr(cppValue); |
| } |
| |
| static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::octetAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->shortAttr()); |
| } |
| |
| static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::shortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void shortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt16(jsValue)); |
| imp->setShortAttr(cppValue); |
| } |
| |
| static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::shortAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueUnsigned(info, imp->unsignedShortAttr()); |
| } |
| |
| static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::unsignedShortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(unsigned, cppValue, toUInt16(jsValue)); |
| imp->setUnsignedShortAttr(cppValue); |
| } |
| |
| static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::unsignedShortAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->longAttr()); |
| } |
| |
| static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::longAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void longAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setLongAttr(cppValue); |
| } |
| |
| static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::longAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, static_cast<double>(imp->longLongAttr())); |
| } |
| |
| static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::longLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void longLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(long long, cppValue, toInt64(jsValue)); |
| imp->setLongLongAttr(cppValue); |
| } |
| |
| static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::longLongAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr())); |
| } |
| |
| static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::unsignedLongLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(unsigned long long, cppValue, toUInt64(jsValue)); |
| imp->setUnsignedLongLongAttr(cppValue); |
| } |
| |
| static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->stringAttr(), info.GetIsolate()); |
| } |
| |
| static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::stringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void stringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| imp->setStringAttr(cppValue); |
| } |
| |
| static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::stringAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| EventListener* jsValue = imp->eventHandlerAttr(isolatedWorldForIsolate(info.GetIsolate())); |
| v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(jsValue)->getListenerObject(imp->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"); |
| TestObjV8Internal::eventHandlerAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| transferHiddenDependency(info.Holder(), imp->eventHandlerAttr(isolatedWorldForIsolate(info.GetIsolate())), jsValue, V8TestObject::eventListenerCacheIndex, info.GetIsolate()); |
| imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIsolate())); |
| } |
| |
| static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->testObjAttr(), imp); |
| } |
| |
| static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); |
| TestObjV8Internal::testObjAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| imp->setTestObjAttr(WTF::getPtr(cppValue)); |
| } |
| |
| static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); |
| TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->attrWithJSGetterAndSetter(), info.GetIsolate()); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::attrWithJSGetterAndSetterAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| imp->setAttrWithJSGetterAndSetter(cppValue); |
| } |
| |
| static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| v8::Local<v8::Value> jsValue = info[0]; |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::attrWithJSGetterAndSetterAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->xmlObjAttr(), imp); |
| } |
| |
| static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::XMLObjAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| imp->setXMLObjAttr(WTF::getPtr(cppValue)); |
| } |
| |
| static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void createAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueBool(info, imp->isCreate()); |
| } |
| |
| static void createAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::createAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void createAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); |
| imp->setCreate(cppValue); |
| } |
| |
| static void createAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::createAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->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"); |
| TestObjV8Internal::reflectedStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue); |
| } |
| |
| static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::reflectedintegralattrAttr)); |
| } |
| |
| static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::reflectedIntegralAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue); |
| } |
| |
| static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedIntegralAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueUnsigned(info, std::max(0, imp->getIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr))); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(unsigned, cppValue, toUInt32(jsValue)); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr, cppValue); |
| } |
| |
| static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::reflectedbooleanattrAttr)); |
| } |
| |
| static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::reflectedBooleanAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue); |
| } |
| |
| static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedBooleanAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->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"); |
| TestObjV8Internal::reflectedURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue); |
| } |
| |
| static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedURLAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate()); |
| } |
| |
| static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::reflectedStringAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue); |
| } |
| |
| static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::customContentIntegralAttrAttr)); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr)); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue()); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->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"); |
| TestObjV8Internal::reflectedCustomURLAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue); |
| } |
| |
| static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void animatedReflectedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->getAttribute(HTMLNames::animatedreflectedattributeAttr), imp); |
| } |
| |
| static void animatedReflectedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::animatedReflectedAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void animatedReflectedAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(SVGAnimatedString*, cppValue, V8SVGAnimatedString::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGAnimatedString::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| imp->setAttribute(HTMLNames::animatedreflectedattributeAttr, WTF::getPtr(cppValue)); |
| } |
| |
| static void animatedReflectedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| TestObjV8Internal::animatedReflectedAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->typedArrayAttr(), imp); |
| } |
| |
| static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::typedArrayAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Float32Array*, cppValue, jsValue->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(jsValue)) : 0); |
| imp->setTypedArrayAttr(WTF::getPtr(cppValue)); |
| } |
| |
| static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetterException", "TestObject", info.Holder(), info.GetIsolate()); |
| int jsValue = imp->attrWithGetterException(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueInt(info, jsValue); |
| } |
| |
| static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setAttrWithGetterException(cppValue); |
| } |
| |
| static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->attrWithSetterException()); |
| } |
| |
| static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetterException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setAttrWithSetterException(cppValue, exceptionState); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWithGetterException", "TestObject", info.Holder(), info.GetIsolate()); |
| String jsValue = imp->stringAttrWithGetterException(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueString(info, jsValue, info.GetIsolate()); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| imp->setStringAttrWithGetterException(cppValue); |
| } |
| |
| static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->stringAttrWithSetterException(), info.GetIsolate()); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWithSetterException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| imp->setStringAttrWithSetterException(cppValue, exceptionState); |
| exceptionState.throwIfNeeded(); |
| } |
| |
| static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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", "Execution"); |
| } |
| |
| static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| V8TestObject::customAttrAttributeSetterCustom(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return v8Undefined(); |
| ScriptState& state = *currentState; |
| v8SetReturnValueInt(info, imp->withScriptStateAttribute(&state)); |
| } |
| |
| static void withScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withScriptStateAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| imp->setWithScriptStateAttribute(&state, cppValue); |
| if (state.hadException()) |
| throwError(state.exception(), info.GetIsolate()); |
| } |
| |
| static void withScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withScriptStateAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExecutionContext* scriptContext = getExecutionContext(); |
| v8SetReturnValueFast(info, imp->withExecutionContextAttribute(scriptContext), imp); |
| } |
| |
| static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue)); |
| } |
| |
| static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), imp); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMWindow(), WTF::getPtr(cppValue)); |
| } |
| |
| static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStateAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return v8Undefined(); |
| ScriptState& state = *currentState; |
| RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| if (state.hadException()) { |
| throwError(state.exception(), info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValueFast(info, jsValue.release(), imp); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue)); |
| if (state.hadException()) |
| throwError(state.exception(), info.GetIsolate()); |
| } |
| |
| static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionContextAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
| ExecutionContext* scriptContext = getExecutionContext(); |
| RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptContext, exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueFast(info, jsValue.release(), imp); |
| } |
| |
| static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppValue)); |
| } |
| |
| static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return v8Undefined(); |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateAttribute(&state, scriptContext), imp); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, WTF::getPtr(cppValue)); |
| if (state.hadException()) |
| throwError(state.exception(), info.GetIsolate()); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionContextAndScriptStateAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return v8Undefined(); |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRaises(&state, scriptContext, exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| if (state.hadException()) { |
| throwError(state.exception(), info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValueFast(info, jsValue.release(), imp); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptContext, WTF::getPtr(cppValue)); |
| if (state.hadException()) |
| throwError(state.exception(), info.GetIsolate()); |
| } |
| |
| static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return v8Undefined(); |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateWithSpacesAttribute(&state, scriptContext), imp); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, scriptContext, WTF::getPtr(cppValue)); |
| if (state.hadException()) |
| throwError(state.exception(), info.GetIsolate()); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->enforcedRangeByteAttr()); |
| } |
| |
| static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeByteAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt8(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeByteAttr(cppValue); |
| } |
| |
| static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeByteAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueUnsigned(info, imp->enforcedRangeOctetAttr()); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeOctetAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt8(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeOctetAttr(cppValue); |
| } |
| |
| static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeOctetAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->enforcedRangeShortAttr()); |
| } |
| |
| static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeShortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt16(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeShortAttr(cppValue); |
| } |
| |
| static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeShortAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedShortAttr()); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt16(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeUnsignedShortAttr(cppValue); |
| } |
| |
| static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->enforcedRangeLongAttr()); |
| } |
| |
| static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt32(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeLongAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedLongAttr()); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt32(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeUnsignedLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeLongLongAttr())); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(long long, cppValue, toInt64(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeLongLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeUnsignedLongLongAttr())); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, cppValue, toUInt64(jsValue, EnforceRange, ok), info.GetIsolate()); |
| imp->setEnforcedRangeUnsignedLongLongAttr(cppValue); |
| } |
| |
| static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::conditionalAttr1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setConditionalAttr1(cppValue); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) |
| static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::conditionalAttr1AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::conditionalAttr2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setConditionalAttr2(cppValue); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->conditionalAttr3()); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::conditionalAttr3AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setConditionalAttr3(cppValue); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->cachedAttribute1().v8Value()); |
| } |
| |
| static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::cachedAttribute1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->cachedAttribute2().v8Value()); |
| } |
| |
| static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::cachedAttribute2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "cachedDirtyableAttribute", v8::String::kInternalizedString); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (!imp->isValueDirty()) { |
| v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName); |
| if (!jsValue.IsEmpty()) { |
| v8SetReturnValue(info, jsValue); |
| return; |
| } |
| } |
| ScriptValue jsValue = imp->cachedDirtyableAttribute(); |
| info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); |
| v8SetReturnValue(info, jsValue.v8Value()); |
| } |
| |
| static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::cachedDirtyableAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "cachedDirtyableAttributeRaises", v8::String::kInternalizedString); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (!imp->isValueDirty()) { |
| v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName); |
| if (!jsValue.IsEmpty()) { |
| v8SetReturnValue(info, jsValue); |
| return; |
| } |
| } |
| ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyableAttributeRaises", "TestObject", info.Holder(), info.GetIsolate()); |
| ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState); |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); |
| v8SetReturnValue(info, jsValue.v8Value()); |
| } |
| |
| static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->anyAttribute().v8Value()); |
| } |
| |
| static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::anyAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void anyAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate())); |
| imp->setAnyAttribute(cppValue); |
| } |
| |
| static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::anyAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->callbackFunctionAttribute().v8Value()); |
| } |
| |
| static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::callbackFunctionAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate())); |
| imp->setCallbackFunctionAttribute(cppValue); |
| } |
| |
| static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::callbackFunctionAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr()); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enabledAtRuntimeAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setEnabledAtRuntimeAttr(cppValue); |
| } |
| |
| static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enabledAtRuntimeAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->enabledPerContextAttr()); |
| } |
| |
| static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::enabledPerContextAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setEnabledPerContextAttr(cppValue); |
| } |
| |
| static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::enabledPerContextAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, v8Array(imp->floatArray(), info.GetIsolate())); |
| } |
| |
| static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::floatArrayAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void floatArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(jsValue, 0, info.GetIsolate())); |
| imp->setFloatArray(cppValue); |
| } |
| |
| static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::floatArrayAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, v8Array(imp->doubleArray(), info.GetIsolate())); |
| } |
| |
| static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::doubleArrayAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void doubleArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(jsValue, 0, info.GetIsolate())); |
| imp->setDoubleArray(cppValue); |
| } |
| |
| static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::doubleArrayAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, v8Array(imp->messagePortArray(), info.GetIsolate())); |
| } |
| |
| static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::messagePortArrayAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void messagePortArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray<MessagePort, V8MessagePort>(jsValue, 0, info.GetIsolate()))); |
| imp->setMessagePortArray(cppValue); |
| } |
| |
| static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocument", "TestObject", info.Holder(), info.GetIsolate()); |
| if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), exceptionState)) { |
| v8SetReturnValueNull(info); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| v8SetReturnValueFast(info, imp->contentDocument(), imp); |
| } |
| |
| static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::contentDocumentAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void mutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), imp); |
| } |
| |
| static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::mutablePointAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::SetterContext, "mutablePoint", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| if (!WTF::getPtr(cppValue)) { |
| exceptionState.throwTypeError("The provided value is not of type 'SVGPoint'."); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); |
| } |
| |
| static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::mutablePointAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->immutablePoint())), imp); |
| } |
| |
| static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::immutablePointAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::SetterContext, "immutablePoint", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| if (!WTF::getPtr(cppValue)) { |
| exceptionState.throwTypeError("The provided value is not of type 'SVGPoint'."); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); |
| } |
| |
| static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::immutablePointAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->blueberry()); |
| } |
| |
| static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::strawberryAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void strawberryAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setBlueberry(cppValue); |
| } |
| |
| static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::strawberryAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->strictFloat()); |
| } |
| |
| static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::strictFloatAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue())); |
| imp->setStrictFloat(cppValue); |
| } |
| |
| static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::strictFloatAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->replaceableAttribute()); |
| } |
| |
| static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::replaceableAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool isNull = false; |
| double jsValue = imp->nullableDoubleAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValue(info, jsValue); |
| } |
| |
| static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::nullableDoubleAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool isNull = false; |
| int jsValue = imp->nullableLongAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueInt(info, jsValue); |
| } |
| |
| static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::nullableLongAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool isNull = false; |
| bool jsValue = imp->nullableBooleanAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueBool(info, jsValue); |
| } |
| |
| static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::nullableBooleanAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool isNull = false; |
| String jsValue = imp->nullableStringAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueString(info, jsValue, info.GetIsolate()); |
| } |
| |
| static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::nullableStringAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool isNull = false; |
| int jsValue = imp->nullableLongSettableAttribute(isNull); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| v8SetReturnValueInt(info, jsValue); |
| } |
| |
| static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::nullableLongSettableAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setNullableLongSettableAttribute(cppValue); |
| } |
| |
| static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExceptionState exceptionState(ExceptionState::GetterContext, "nullableStringValue", "TestObject", info.Holder(), info.GetIsolate()); |
| bool isNull = false; |
| int jsValue = imp->nullableStringValue(isNull, exceptionState); |
| if (isNull) { |
| v8SetReturnValueNull(info); |
| return; |
| } |
| if (UNLIKELY(exceptionState.throwIfNeeded())) |
| return; |
| v8SetReturnValueInt(info, jsValue); |
| } |
| |
| static void nullableStringValueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::nullableStringValueAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void nullableStringValueAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setNullableStringValue(cppValue); |
| } |
| |
| static void nullableStringValueAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::nullableStringValueAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); |
| if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get())) |
| return; |
| v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); |
| if (!wrapper.IsEmpty()) { |
| V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "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"); |
| TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute(); |
| if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(info.GetReturnValue(), result.get())) |
| return; |
| v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); |
| if (!wrapper.IsEmpty()) { |
| V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "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"); |
| TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->perWorldAttribute(), imp); |
| } |
| |
| static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::perWorldAttributeAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| imp->setPerWorldAttribute(WTF::getPtr(cppValue)); |
| } |
| |
| static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueForMainWorld(info, imp->perWorldAttribute()); |
| } |
| |
| static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| imp->setPerWorldAttribute(WTF::getPtr(cppValue)); |
| } |
| |
| static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedAttr1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttr1(cppValue); |
| } |
| |
| static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedAttr1AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedAttr2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttr2(cppValue); |
| } |
| |
| static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedAttr2AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttr2(cppValue); |
| } |
| |
| static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedInIsolatedWorldsAttr(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedInIsolatedWorldsAttr(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedAttrSetter1()); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedAttrSetter1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttrSetter1(cppValue); |
| } |
| |
| static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedAttrSetter1AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2()); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedAttrSetter2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttrSetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedAttrSetter2AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2()); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttrSetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, 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[] = { jsValue }; |
| contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrSetter", 1, &loggerArg[0], "Setter"); |
| } |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedAttrGetter1AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttrGetter1(cppValue); |
| } |
| |
| static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedAttrGetter1AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedAttrGetter2AttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttrGetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedAttrGetter2AttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedAttrGetter2(cppValue); |
| } |
| |
| static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->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"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter()); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue); |
| } |
| |
| static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueInt(info, TestObj::deprecatedStaticReadOnlyAttr()); |
| } |
| |
| static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticReadonlyAttribute); |
| TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| v8SetReturnValueInt(info, TestObj::deprecatedStaticAttr()); |
| } |
| |
| static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAttribute); |
| TestObjV8Internal::deprecatedStaticAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| TestObj::setDeprecatedStaticAttr(cppValue); |
| } |
| |
| static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAttribute); |
| TestObjV8Internal::deprecatedStaticAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->deprecatedReadonlyAttr()); |
| } |
| |
| static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::ReadonlyAttribute); |
| TestObjV8Internal::deprecatedReadonlyAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->deprecatedAttr()); |
| } |
| |
| static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute); |
| TestObjV8Internal::deprecatedAttrAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
| imp->setDeprecatedAttr(cppValue); |
| } |
| |
| static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute); |
| TestObjV8Internal::deprecatedAttrAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->location(), imp); |
| } |
| |
| static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::locationAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* proxyImp = V8TestObject::toNative(info.Holder()); |
| TestNode* imp = proxyImp->location(); |
| if (!imp) |
| return; |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| imp->setHref(cppValue); |
| } |
| |
| static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::locationAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueFast(info, imp->locationWithException(), imp); |
| } |
| |
| static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| TestObjV8Internal::locationWithExceptionAttributeGetter(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObj* proxyImp = V8TestObject::toNative(info.Holder()); |
| TestNode* imp = proxyImp->locationWithException(); |
| if (!imp) |
| return; |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| imp->setHrefThrows(cppValue); |
| } |
| |
| static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void TestObjConstructorGetter(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 TestObjReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| info.This()->ForceSet(name, jsValue); |
| } |
| |
| static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info); |
| } |
| |
| static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->voidMethod(); |
| } |
| |
| static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::voidMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 3)) { |
| throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| if (info.Length() <= 2 || !info[2]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", "The callback provided as parameter 3 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::Cast(info[2]), getExecutionContext()); |
| imp->voidMethodWithArgs(longArg, strArg, objArg.release()); |
| } |
| |
| static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::voidMethodWithArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueInt(info, imp->longMethod()); |
| } |
| |
| static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::longMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 3)) { |
| throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| if (info.Length() <= 2 || !info[2]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", "The callback provided as parameter 3 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::Cast(info[2]), getExecutionContext()); |
| v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg.release())); |
| } |
| |
| static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::longMethodWithArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->objMethod()); |
| } |
| |
| static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); |
| TestObjV8Internal::objMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 3)) { |
| throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| if (info.Length() <= 2 || !info[2]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "TestObject", "The callback provided as parameter 3 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::Cast(info[2]), getExecutionContext()); |
| v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg.release())); |
| } |
| |
| static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::objMethodWithArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNativeArray<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); |
| imp->methodWithSequenceArg(sequenceArg); |
| } |
| |
| static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithSequenceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.GetIsolate())); |
| } |
| |
| static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodReturningSequenceMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = 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; |
| } |
| imp->methodWithEnumArg(enumArg); |
| } |
| |
| static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnumArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| if (info.Length() <= 1 || !info[1]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAllArgsAndThrows", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext()); |
| RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg.release(), 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"); |
| TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(ScriptValue(info[0], info.GetIsolate()))); |
| imp->methodQueryListListener(listener); |
| } |
| |
| static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodQueryListListenerMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool serializedArgDidThrow = false; |
| RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(info[0], 0, 0, serializedArgDidThrow, info.GetIsolate()); |
| if (serializedArgDidThrow) |
| return; |
| imp->serializedValue(serializedArg); |
| } |
| |
| static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::serializedValueMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = 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; |
| } |
| imp->optionsObject(oo, ooo); |
| } |
| |
| static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::optionsObjectMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate())); |
| imp->optionsObjectList(list); |
| } |
| |
| static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::optionsObjectListMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->methodWithException(exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| } |
| |
| static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); |
| V8TestObject::customMethodMethodCustom(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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", "Execution"); |
| } |
| |
| static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventListener", "TestObject", info.Holder(), info.GetIsolate()); |
| EventTarget* impl = V8TestObject::toNative(info.Holder()); |
| if (DOMWindow* window = impl->toDOMWindow()) { |
| if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) { |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| if (!window->document()) |
| return; |
| } |
| RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[1], false, ListenerFindOrCreate); |
| if (listener) { |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, eventName, info[0]); |
| impl->addEventListener(eventName, listener, info[2]->BooleanValue()); |
| if (!impl->toNode()) |
| createHiddenDependency(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate()); |
| } |
| } |
| |
| static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::addEventListenerMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEventListener", "TestObject", info.Holder(), info.GetIsolate()); |
| EventTarget* impl = V8TestObject::toNative(info.Holder()); |
| if (DOMWindow* window = impl->toDOMWindow()) { |
| if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) { |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| if (!window->document()) |
| return; |
| } |
| RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[1], false, ListenerFindOnly); |
| if (listener) { |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, eventName, info[0]); |
| impl->removeEventListener(eventName, listener.get(), info[2]->BooleanValue()); |
| if (!impl->toNode()) |
| removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate()); |
| } |
| } |
| |
| static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::removeEventListenerMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| imp->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"); |
| TestObjV8Internal::withScriptStateVoidMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| RefPtr<TestObj> result = imp->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"); |
| TestObjV8Internal::withScriptStateObjMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateVoidException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| imp->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"); |
| TestObjV8Internal::withScriptStateVoidExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| RefPtr<TestObj> result = imp->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"); |
| TestObjV8Internal::withScriptStateObjExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->withExecutionContext(scriptContext); |
| } |
| |
| static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::withExecutionContextMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| imp->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"); |
| TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecutionContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| RefPtr<TestObj> result = imp->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"); |
| TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| ScriptState* currentState = ScriptState::current(); |
| if (!currentState) |
| return; |
| ScriptState& state = *currentState; |
| ExecutionContext* scriptContext = getExecutionContext(); |
| RefPtr<TestObj> result = imp->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"); |
| TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); |
| } |
| |
| static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (UNLIKELY(info.Length() <= 0)) { |
| imp->methodWithOptionalArg(); |
| return; |
| } |
| V8TRYCATCH_VOID(int, opt, toInt32(info[0])); |
| imp->methodWithOptionalArg(opt); |
| } |
| |
| static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptionalArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
| if (UNLIKELY(info.Length() <= 1)) { |
| imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
| return; |
| } |
| V8TRYCATCH_VOID(int, opt, toInt32(info[1])); |
| imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
| } |
| |
| static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptionalArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
| if (UNLIKELY(info.Length() <= 1)) { |
| imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
| return; |
| } |
| V8TRYCATCH_VOID(int, opt1, toInt32(info[1])); |
| if (UNLIKELY(info.Length() <= 2)) { |
| imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); |
| return; |
| } |
| V8TRYCATCH_VOID(int, opt2, toInt32(info[2])); |
| imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); |
| } |
| |
| static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (UNLIKELY(info.Length() <= 0)) { |
| imp->methodWithOptionalString(); |
| return; |
| } |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| imp->methodWithOptionalString(str); |
| } |
| |
| static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithOptionalStringMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| imp->methodWithOptionalStringIsUndefined(str); |
| } |
| |
| static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull(info, 0)); |
| imp->methodWithOptionalStringIsNullString(str); |
| } |
| |
| static void methodWithOptionalStringIsNullStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = 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]), getExecutionContext()); |
| imp->methodWithCallbackInterfaceArg(callbackInterface.release()); |
| } |
| |
| static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithCallbackInterfaceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); |
| if (info.Length() <= 1 || !info[1]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackInterfaceArg", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext()); |
| imp->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackInterface.release()); |
| } |
| |
| static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| OwnPtr<TestCallbackInterface> callbackInterface; |
| if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { |
| 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]), getExecutionContext()); |
| } |
| imp->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release()); |
| } |
| |
| static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = 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]), getExecutionContext()); |
| imp->methodWithNullableCallbackInterfaceArg(callbackInterface.release()); |
| } |
| |
| static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithNullableCallbackInterfaceArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| OwnPtr<TestCallbackInterface> callbackInterface; |
| if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { |
| 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]), getExecutionContext()); |
| } |
| TestObj::staticMethodWithCallbackAndOptionalArg(callbackInterface.release()); |
| } |
| |
| static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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]), getExecutionContext()); |
| TestObj::staticMethodWithCallbackArg(callbackInterface.release()); |
| } |
| |
| static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::staticMethodWithCallbackArgMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeInt8(value); |
| } |
| |
| static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeInt8Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeUInt8(value); |
| } |
| |
| static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeInt16(value); |
| } |
| |
| static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeInt16Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeUInt16(value); |
| } |
| |
| static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeInt32(value); |
| } |
| |
| static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeInt32Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeUInt32(value); |
| } |
| |
| static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeInt64(value); |
| } |
| |
| static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeInt64Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0], EnforceRange, ok), info.GetIsolate()); |
| imp->methodWithEnforceRangeUInt64(value); |
| } |
| |
| static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithEnforceRangeUInt64Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| #if ENABLE(Condition1) |
| static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValueString(info, imp->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"); |
| TestObjV8Internal::conditionalMethod1Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->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"); |
| TestObjV8Internal::conditionalMethod2Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->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"); |
| TestObjV8Internal::conditionalMethod3Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| |
| static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value()); |
| } |
| |
| static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::callbackFunctionReturnValueMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate())); |
| imp->callbackFunctionArgument(function); |
| } |
| |
| static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::callbackFunctionArgumentMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->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; |
| } |
| TestObj* imp = 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]), getExecutionContext()); |
| imp->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; |
| } |
| TestObj* imp = 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<TestObject> objArg = V8TestObject::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
| imp->overloadedMethod(objArg.release()); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate())); |
| imp->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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[0], 1, info.GetIsolate())); |
| imp->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) && (info[0]->IsNull() || info[0]->IsFunction()))) { |
| 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"); |
| TestObjV8Internal::overloadedMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
| if (UNLIKELY(info.Length() <= 1)) { |
| imp->overloadedMethodA(objArg.release()); |
| return; |
| } |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| imp->overloadedMethodA(objArg.release(), 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> objArg = info[0]->IsNull() ? nullptr : V8TestObject::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
| imp->overloadedMethodA(objArg.release(), strArg); |
| } |
| |
| static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction())) || ((info.Length() == 2) && (info[0]->IsNull() || info[0]->IsFunction()))) { |
| overloadedMethodA1Method(info); |
| return; |
| } |
| if (((info.Length() == 2) && (info[0]->IsNull() || info[0]->IsFunction()))) { |
| 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"); |
| TestObjV8Internal::overloadedMethodAMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| imp->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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| imp->overloadedMethodB(strArg); |
| } |
| |
| static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (((info.Length() == 1))) { |
| overloadedMethodB1Method(info); |
| return; |
| } |
| if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsUndefined() || 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"); |
| TestObjV8Internal::overloadedMethodBMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj::classMethod(); |
| } |
| |
| static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::classMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() <= 0)) { |
| v8SetReturnValueInt(info, TestObj::classMethodWithOptional()); |
| return; |
| } |
| V8TRYCATCH_VOID(int, arg, toInt32(info[0])); |
| v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg)); |
| } |
| |
| static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::classMethodWithOptionalMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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", "Execution"); |
| } |
| |
| static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = 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); |
| imp->classMethodWithClamp(objArgsShort, objArgsLong); |
| } |
| |
| static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::classMethodWithClampMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->enabledAtRuntimeMethod(longArg); |
| } |
| |
| static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::enabledAtRuntimeMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->enabledPerContextMethod(longArg); |
| } |
| |
| static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::enabledPerContextMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(info[0], 1, info.GetIsolate())); |
| imp->methodWithUnsignedLongSequence(unsignedLongSequence); |
| } |
| |
| static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate())); |
| Vector<String> result = imp->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"); |
| TestObjV8Internal::stringArrayFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| RefPtr<DOMStringList> result = imp->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"); |
| TestObjV8Internal::domStringListFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "getSVGDocument", "TestObject", info.Holder(), info.GetIsolate()); |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionState), exceptionState)) { |
| v8SetReturnValueNull(info); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8SetReturnValue(info, result.release()); |
| } |
| |
| static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::getSVGDocumentMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| imp->convert1(value); |
| } |
| |
| static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::convert1Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| imp->convert2(value); |
| } |
| |
| static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::convert2Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->mutablePointFunction()))); |
| } |
| |
| static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::mutablePointFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->immutablePointFunction()))); |
| } |
| |
| static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::immutablePointFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
| if (!item) { |
| throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
| return; |
| } |
| v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->svgPointMethod(item->propertyReference(), index)))); |
| } |
| |
| static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::svgPointMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPointMethod", "TestObject", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 2)) { |
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length())); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { |
| throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
| return; |
| } |
| V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
| if (!item) { |
| throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
| return; |
| } |
| SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(result))); |
| } |
| |
| static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::strictSVGPointMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->banana(); |
| } |
| |
| static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::orangeMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
| V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); |
| V8TRYCATCH_VOID(int, b, toInt32(info[2])); |
| bool result = imp->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"); |
| TestObjV8Internal::strictFunctionMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); |
| V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); |
| imp->variadicStringMethod(head, tail); |
| } |
| |
| static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::variadicStringMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); |
| V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); |
| imp->variadicDoubleMethod(head, tail); |
| } |
| |
| static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::variadicDoubleMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| 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; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| Vector<RefPtr<Node> > tail; |
| for (int i = 1; i < info.Length(); ++i) { |
| if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(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]))); |
| } |
| imp->variadicNodeMethod(head, tail); |
| } |
| |
| static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::variadicNodeMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 3)) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArguments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| bool strIsNull = info[0]->IsNull(); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource, info[0]); |
| String str = strStringResource; |
| bool lIsNull = info[1]->IsNull(); |
| V8TRYCATCH_VOID(int, l, toInt32(info[1])); |
| if (info.Length() <= 2 || !(info[2]->IsFunction() || info[2]->IsNull())) { |
| throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArguments", "TestObject", "The callback provided as parameter 3 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestObject> obj = info[2]->IsNull() ? nullptr : V8TestObject::create(v8::Handle<v8::Function>::Cast(info[2]), getExecutionContext()); |
| if (UNLIKELY(info.Length() <= 3)) { |
| imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj.release()); |
| return; |
| } |
| bool dIsNull = info[3]->IsNull(); |
| V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); |
| imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj.release(), dIsNull ? 0 : &d); |
| } |
| |
| static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::methodWithNullableArgumentsMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->perWorldMethod(); |
| } |
| |
| static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::perWorldMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->perWorldMethod(); |
| } |
| |
| static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::perWorldMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->overloadedPerWorldMethod(longArg); |
| } |
| |
| static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->overloadedPerWorldMethod(longArg); |
| } |
| |
| static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| imp->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"); |
| TestObjV8Internal::overloadedPerWorldMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| imp->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"); |
| TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->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"); |
| } |
| TestObjV8Internal::activityLoggedMethod1Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->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"); |
| } |
| TestObjV8Internal::activityLoggedMethod2Method(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->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"); |
| } |
| TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsolatedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->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"); |
| } |
| TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsolatedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->activityLoggedInIsolatedWorldMethod(longArg); |
| } |
| |
| static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->overloadedActivityLoggedMethod(longArg); |
| } |
| |
| static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
| imp->overloadedActivityLoggedMethod(longArg); |
| } |
| |
| static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| imp->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"); |
| } |
| TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 2)) { |
| throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate()); |
| return; |
| } |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
| imp->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"); |
| } |
| TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj* imp = V8TestObject::toNative(info.Holder()); |
| imp->deprecatedMethod(); |
| } |
| |
| static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); |
| TestObjV8Internal::deprecatedMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TestObj::deprecatedStaticMethod(); |
| } |
| |
| static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMethod); |
| TestObjV8Internal::deprecatedStaticMethodMethod(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| if (UNLIKELY(info.Length() < 1)) { |
| throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); |
| return; |
| } |
| if (info.Length() <= 0 || !info[0]->IsFunction()) { |
| throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); |
| return; |
| } |
| OwnPtr<TestCallbackInterface> testCallbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext()); |
| RefPtr<TestObj> impl = TestObj::create(testCallbackInterface); |
| v8::Handle<v8::Object> wrapper = info.Holder(); |
| |
| V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8TestObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent); |
| v8SetReturnValue(info, wrapper); |
| } |
| |
| static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
| TestObj* collection = V8TestObject::toNative(info.Holder()); |
| RefPtr<Node> element = collection->item(index); |
| if (!element) |
| return; |
| v8SetReturnValueFast(info, element.release(), collection); |
| } |
| |
| static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| TestObjV8Internal::indexedPropertyGetter(index, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| return; |
| if (info.Holder()->HasRealNamedCallbackProperty(name)) |
| return; |
| if (info.Holder()->HasRealNamedProperty(name)) |
| return; |
| |
| ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
| TestObj* collection = V8TestObject::toNative(info.Holder()); |
| AtomicString propertyName = toCoreAtomicString(name); |
| String element = collection->namedItem(propertyName); |
| if (element.isNull()) |
| return; |
| v8SetReturnValueString(info, element, info.GetIsolate()); |
| } |
| |
| static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| TestObjV8Internal::namedPropertyGetter(name, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) |
| { |
| ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
| TestObj* collection = V8TestObject::toNative(info.Holder()); |
| Vector<String> names; |
| collection->namedPropertyEnumerator(names, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size()); |
| for (size_t i = 0; i < names.size(); ++i) |
| v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i])); |
| v8SetReturnValue(info, v8names); |
| } |
| |
| static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
| { |
| TestObj* collection = V8TestObject::toNative(info.Holder()); |
| AtomicString propertyName = toCoreAtomicString(name); |
| ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
| bool result = collection->namedPropertyQuery(propertyName, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| if (!result) |
| return; |
| v8SetReturnValueInt(info, v8::None); |
| } |
| |
| static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| TestObjV8Internal::namedPropertyEnumerator(info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
| { |
| TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| TestObjV8Internal::namedPropertyQuery(name, info); |
| TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| } |
| |
| } // namespace TestObjV8Internal |
| |
| static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = { |
| {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"readOnlyTestObjectAttr", TestObjV8Internal::readOnlyTestObjectAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enumAttr", TestObjV8Internal::enumAttrAttributeGetterCallback, TestObjV8Internal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"readOnlyEnumAttr", TestObjV8Internal::readOnlyEnumAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"byteAttr", TestObjV8Internal::byteAttrAttributeGetterCallback, TestObjV8Internal::byteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"octetAttr", TestObjV8Internal::octetAttrAttributeGetterCallback, TestObjV8Internal::octetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"shortAttr", TestObjV8Internal::shortAttrAttributeGetterCallback, TestObjV8Internal::shortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"unsignedShortAttr", TestObjV8Internal::unsignedShortAttrAttributeGetterCallback, TestObjV8Internal::unsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"longAttr", TestObjV8Internal::longAttrAttributeGetterCallback, TestObjV8Internal::longAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"longLongAttr", TestObjV8Internal::longLongAttrAttributeGetterCallback, TestObjV8Internal::longLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"unsignedLongLongAttr", TestObjV8Internal::unsignedLongLongAttrAttributeGetterCallback, TestObjV8Internal::unsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"stringAttr", TestObjV8Internal::stringAttrAttributeGetterCallback, TestObjV8Internal::stringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"eventHandlerAttr", TestObjV8Internal::eventHandlerAttrAttributeGetterCallback, TestObjV8Internal::eventHandlerAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"testObjAttr", TestObjV8Internal::testObjAttrAttributeGetterCallback, TestObjV8Internal::testObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"XMLObjAttr", TestObjV8Internal::XMLObjAttrAttributeGetterCallback, TestObjV8Internal::XMLObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"create", TestObjV8Internal::createAttributeGetterCallback, TestObjV8Internal::createAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttributeGetterCallback, TestObjV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttributeGetterCallback, TestObjV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"animatedReflectedAttribute", TestObjV8Internal::animatedReflectedAttributeAttributeGetterCallback, TestObjV8Internal::animatedReflectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttributeGetterCallback, TestObjV8Internal::attrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttributeGetterCallback, TestObjV8Internal::attrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"customAttr", TestObjV8Internal::customAttrAttributeGetterCallback, TestObjV8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withExecutionContextAttribute", TestObjV8Internal::withExecutionContextAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withActiveWindowAndFirstWindowAttribute", TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetterCallback, TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withExecutionContextAttributeRaises", TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withExecutionContextAndScriptStateAttribute", TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withExecutionContextAndScriptStateAttributeRaises", TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"withExecutionContextAndScriptStateWithSpacesAttribute", TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeByteAttr", TestObjV8Internal::enforcedRangeByteAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeByteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeOctetAttr", TestObjV8Internal::enforcedRangeOctetAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeOctetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeShortAttr", TestObjV8Internal::enforcedRangeShortAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeUnsignedShortAttr", TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| #if ENABLE(Condition1) |
| {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallback, TestObjV8Internal::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", TestObjV8Internal::conditionalAttr2AttributeGetterCallback, TestObjV8Internal::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) |
| {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallback, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 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) |
| {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 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", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 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", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 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", TestObjV8Internal::cachedAttribute1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"cachedDirtyableAttribute", TestObjV8Internal::cachedDirtyableAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"cachedDirtyableAttributeRaises", TestObjV8Internal::cachedDirtyableAttributeRaisesAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"anyAttribute", TestObjV8Internal::anyAttributeAttributeGetterCallback, TestObjV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAttributeGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"floatArray", TestObjV8Internal::floatArrayAttributeGetterCallback, TestObjV8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"doubleArray", TestObjV8Internal::doubleArrayAttributeGetterCallback, TestObjV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"messagePortArray", TestObjV8Internal::messagePortArrayAttributeGetterCallback, TestObjV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"contentDocument", TestObjV8Internal::contentDocumentAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"mutablePoint", TestObjV8Internal::mutablePointAttributeGetterCallback, TestObjV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"immutablePoint", TestObjV8Internal::immutablePointAttributeGetterCallback, TestObjV8Internal::immutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"strawberry", TestObjV8Internal::strawberryAttributeGetterCallback, TestObjV8Internal::strawberryAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"strictFloat", TestObjV8Internal::strictFloatAttributeGetterCallback, TestObjV8Internal::strictFloatAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"replaceableAttribute", TestObjV8Internal::replaceableAttributeAttributeGetterCallback, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableDoubleAttribute", TestObjV8Internal::nullableDoubleAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableLongAttribute", TestObjV8Internal::nullableLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableBooleanAttribute", TestObjV8Internal::nullableBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableStringAttribute", TestObjV8Internal::nullableStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableLongSettableAttribute", TestObjV8Internal::nullableLongSettableAttributeAttributeGetterCallback, TestObjV8Internal::nullableLongSettableAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"nullableStringValue", TestObjV8Internal::nullableStringValueAttributeGetterCallback, TestObjV8Internal::nullableStringValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"perWorldReadOnlyAttribute", TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterCallback, 0, TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"perWorldAttribute", TestObjV8Internal::perWorldAttributeAttributeGetterCallback, TestObjV8Internal::perWorldAttributeAttributeSetterCallback, TestObjV8Internal::perWorldAttributeAttributeGetterCallbackForMainWorld, TestObjV8Internal::perWorldAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttr1", TestObjV8Internal::activityLoggedAttr1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttr2", TestObjV8Internal::activityLoggedAttr2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttr2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttr2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttr2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedInIsolatedWorldsAttr", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttributeGetterCallback, TestObjV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeGetterCallback, TestObjV8Internal::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", TestObjV8Internal::attrWithJSGetterAndSetterAttributeGetterCallback, TestObjV8Internal::attrWithJSGetterAndSetterAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)}, |
| }; |
| |
| static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { |
| {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, |
| {"voidMethodWithArgs", TestObjV8Internal::voidMethodWithArgsMethodCallback, 0, 3}, |
| {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, |
| {"longMethodWithArgs", TestObjV8Internal::longMethodWithArgsMethodCallback, 0, 3}, |
| {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0}, |
| {"objMethodWithArgs", TestObjV8Internal::objMethodWithArgsMethodCallback, 0, 3}, |
| {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCallback, 0, 1}, |
| {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethodCallback, 0, 1}, |
| {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0, 1}, |
| {"methodThatRequiresAllArgsAndThrows", TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, 0, 2}, |
| {"methodQueryListListener", TestObjV8Internal::methodQueryListListenerMethodCallback, 0, 1}, |
| {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1}, |
| {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1}, |
| {"optionsObjectList", TestObjV8Internal::optionsObjectListMethodCallback, 0, 1}, |
| {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback, 0, 0}, |
| {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0}, |
| {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallback, 0, 3}, |
| {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2}, |
| {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback, 0, 2}, |
| {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback, 0, 0}, |
| {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback, 0, 0}, |
| {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExceptionMethodCallback, 0, 0}, |
| {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExceptionMethodCallback, 0, 0}, |
| {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallback, 0, 0}, |
| {"withExecutionContextAndScriptState", TestObjV8Internal::withExecutionContextAndScriptStateMethodCallback, 0, 0}, |
| {"withExecutionContextAndScriptStateObjException", TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0}, |
| {"withExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0}, |
| {"withActiveWindowAndFirstWindow", TestObjV8Internal::withActiveWindowAndFirstWindowMethodCallback, 0, 0}, |
| {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCallback, 0, 0}, |
| {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethodCallback, 0, 1}, |
| {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1}, |
| {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMethodCallback, 0, 0}, |
| {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptionalStringIsUndefinedMethodCallback, 0, 0}, |
| {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOptionalStringIsNullStringMethodCallback, 0, 0}, |
| {"methodWithCallbackInterfaceArg", TestObjV8Internal::methodWithCallbackInterfaceArgMethodCallback, 0, 1}, |
| {"methodWithNonCallbackArgAndCallbackInterfaceArg", TestObjV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback, 0, 2}, |
| {"methodWithCallbackInterfaceAndOptionalArg", TestObjV8Internal::methodWithCallbackInterfaceAndOptionalArgMethodCallback, 0, 0}, |
| {"methodWithNullableCallbackInterfaceArg", TestObjV8Internal::methodWithNullableCallbackInterfaceArgMethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt8", TestObjV8Internal::methodWithEnforceRangeInt8MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt8", TestObjV8Internal::methodWithEnforceRangeUInt8MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt16", TestObjV8Internal::methodWithEnforceRangeInt16MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt16", TestObjV8Internal::methodWithEnforceRangeUInt16MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt32MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUInt32MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt64MethodCallback, 0, 1}, |
| {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUInt64MethodCallback, 0, 1}, |
| #if ENABLE(Condition1) |
| {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0}, |
| #endif // ENABLE(Condition1) |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback, 0, 0}, |
| #endif // ENABLE(Condition1) && ENABLE(Condition2) |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback, 0, 0}, |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |
| {"callbackFunctionReturnValue", TestObjV8Internal::callbackFunctionReturnValueMethodCallback, 0, 0}, |
| {"callbackFunctionArgument", TestObjV8Internal::callbackFunctionArgumentMethodCallback, 0, 1}, |
| {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 1}, |
| {"overloadedMethodA", TestObjV8Internal::overloadedMethodAMethodCallback, 0, 1}, |
| {"overloadedMethodB", TestObjV8Internal::overloadedMethodBMethodCallback, 0, 1}, |
| {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallback, 0, 2}, |
| {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLongSequenceMethodCallback, 0, 1}, |
| {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback, 0, 1}, |
| {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0}, |
| {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallback, 0, 0}, |
| {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCallback, 0, 0}, |
| {"strictSVGPointMethod", TestObjV8Internal::strictSVGPointMethodMethodCallback, 0, 2}, |
| {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0}, |
| {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3}, |
| {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallback, 0, 2}, |
| {"variadicDoubleMethod", TestObjV8Internal::variadicDoubleMethodMethodCallback, 0, 2}, |
| {"methodWithNullableArguments", TestObjV8Internal::methodWithNullableArgumentsMethodCallback, 0, 3}, |
| {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV8Internal::perWorldMethodMethodCallbackForMainWorld, 0}, |
| {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMethodCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld, 1}, |
| {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCallback, 0, 1}, |
| {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCallback, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1}, |
| {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld, 1}, |
| {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLoggedMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodCallbackForMainWorld, 1}, |
| {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0}, |
| }; |
| |
| void V8TestObject::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); |
| if (!info.IsConstructCall()) { |
| throwTypeError(ExceptionMessages::failedToConstruct("TestObject", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate()); |
| return; |
| } |
| |
| if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
| v8SetReturnValue(info, info.Holder()); |
| return; |
| } |
| |
| TestObjV8Internal::constructor(info); |
| } |
| |
| static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| { |
| functionTemplate->ReadOnlyPrototype(); |
| |
| v8::Local<v8::Signature> defaultSignature; |
| defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", V8EventTarget::domTemplate(isolate, currentWorldType), V8TestObject::internalFieldCount, |
| V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), |
| V8TestObjectAccessors, WTF_ARRAY_LENGTH(V8TestObjectAccessors), |
| V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), |
| isolate, currentWorldType); |
| functionTemplate->SetCallHandler(V8TestObject::constructorCallback); |
| functionTemplate->SetLength(1); |
| 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", TestObjV8Internal::enabledAtRuntimeAttrAttributeGetterCallback, TestObjV8Internal::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, currentWorldType); |
| } |
| static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = { |
| {"DEPRECATED_CONSTANT", 1}, |
| }; |
| V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate); |
| COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECATED_CONSTANTDoesntMatchWithImplementation); |
| functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Internal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj>); |
| functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Internal::namedPropertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallback, 0, TestObjV8Internal::namedPropertyEnumeratorCallback); |
| functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCallbackAndOptionalArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCallbackArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1)); |
| functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethodWithOptional", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1)); |
| if (RuntimeEnabledFeatures::featureNameEnabled()) |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "enabledAtRuntimeMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1)); |
| |
| // Custom Signature 'domStringListFunction' |
| const int domStringListFunctionArgc = 1; |
| v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8DOMStringList::wrapperTypeInfo, currentWorldType) }; |
| v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::New(isolate, functionTemplate, domStringListFunctionArgc, domStringListFunctionArgv); |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "domStringListFunction", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(), domStringListFunctionSignature, 1)); |
| |
| // Custom Signature 'convert1' |
| const int convert1Argc = 1; |
| v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) }; |
| v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(isolate, functionTemplate, convert1Argc, convert1Argv); |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "convert1", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1)); |
| |
| // Custom Signature 'convert2' |
| const int convert2Argc = 1; |
| v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) }; |
| v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(isolate, functionTemplate, convert2Argc, convert2Argv); |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "convert2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1)); |
| |
| // Custom Signature 'svgPointMethod' |
| const int svgPointMethodArgc = 2; |
| v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8SVGPoint::wrapperTypeInfo, currentWorldType), v8::Handle<v8::FunctionTemplate>() }; |
| v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(isolate, functionTemplate, svgPointMethodArgc, svgPointMethodArgv); |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "svgPointMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethodSignature, 2)); |
| |
| // Custom Signature 'variadicNodeMethod' |
| const int variadicNodeMethodArgc = 2; |
| v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Node::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Node::wrapperTypeInfo, currentWorldType) }; |
| v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(isolate, functionTemplate, variadicNodeMethodArgc, variadicNodeMethodArgv); |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "variadicNodeMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variadicNodeMethodSignature, 2)); |
| functionTemplate->Set(v8::String::NewFromUtf8(isolate, "deprecatedStaticMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
| functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "staticReadOnlyLongAttr", v8::String::kInternalizedString), TestObjV8Internal::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(v8::String::NewFromUtf8(isolate, "staticStringAttr", v8::String::kInternalizedString), TestObjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "TestSubObj", v8::String::kInternalizedString), TestObjV8Internal::TestObjConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
| functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "deprecatedStaticReadOnlyAttr", v8::String::kInternalizedString), TestObjV8Internal::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(v8::String::NewFromUtf8(isolate, "deprecatedStaticAttr", v8::String::kInternalizedString), TestObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal::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(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| return functionTemplate; |
| } |
| |
| v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| { |
| V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo); |
| if (result != data->templateMap(currentWorldType).end()) |
| return result->value.newLocal(isolate); |
| |
| TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| v8::EscapableHandleScope handleScope(isolate); |
| v8::Local<v8::FunctionTemplate> templ = |
| ConfigureV8TestObjectTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType); |
| data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ)); |
| return handleScope.Escape(templ); |
| } |
| |
| bool V8TestObject::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| { |
| return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType); |
| } |
| |
| bool V8TestObject::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) |
| { |
| return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld) |
| || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld) |
| || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld); |
| } |
| |
| void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestObj* 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", TestObjV8Internal::enabledPerContextAttrAttributeGetterCallback, TestObjV8Internal::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, worldType(isolate))); |
| |
| ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext()); |
| if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) |
| prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "enabledPerContextMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction()); |
| } |
| |
| EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object) |
| { |
| return toNative(object); |
| } |
| |
| v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> 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(TestObj* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| { |
| return toV8(impl, creationContext, isolate); |
| } |
| |
| } // namespace WebCore |