Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: Source/bindings/tests/results/V8TestSupportTestInterface.cpp

Issue 24053003: Support partial interface for test support idls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove hardcoding Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/V8TestSupportTestInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestSupportTestInterface.cpp b/Source/bindings/tests/results/V8TestSupportTestInterface.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..618b3eab8e8447c177fa970599a389ea63e30f2f
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestSupportTestInterface.cpp
@@ -0,0 +1,641 @@
+/*
+ This file is part of the Blink open source project.
+ This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestSupportTestInterface.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "V8Node.h"
+#include "V8TestObject.h"
+#include "bindings/tests/idls/testing/TestSupportTestPartialInterface.h"
+#include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/ScriptController.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "core/platform/chromium/TraceEvent.h"
+#include "wtf/GetPtr.h"
+#include "wtf/RefPtr.h"
+#include "wtf/UnusedParam.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestSupportTestInterface* object)
+{
+ if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+ ScriptWrappable::setTypeInfoInObject(object, &V8TestSupportTestInterface::info);
+ 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::TestSupportTestInterface* object)
+{
+ WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+WrapperTypeInfo V8TestSupportTestInterface::info = { V8TestSupportTestInterface::GetTemplate, V8TestSupportTestInterface::derefObject, 0, 0, 0, V8TestSupportTestInterface::installPerContextPrototypeProperties, 0, WrapperTypeObjectPrototype };
+
+namespace TestSupportTestInterfaceV8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStaticReadOnlyAttrAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ v8SetReturnValueInt(info, TestSupportTestPartialInterface::supplementalStaticReadOnlyAttr());
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStaticAttrAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ v8SetReturnValueString(info, TestSupportTestPartialInterface::supplementalStaticAttr(), info.GetIsolate());
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStaticAttrAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::supplementalStaticAttrAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStaticAttrAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
+ TestSupportTestPartialInterface::setSupplementalStaticAttr(v);
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStaticAttrAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestSupportTestInterfaceV8Internal::supplementalStaticAttrAttributeSetter(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr1AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ v8SetReturnValueString(info, TestSupportTestPartialInterface::supplementalStr1(imp), info.GetIsolate());
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr1AttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::supplementalStr1AttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr2AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ v8SetReturnValueString(info, TestSupportTestPartialInterface::supplementalStr2(imp), info.GetIsolate());
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr2AttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::supplementalStr2AttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr2AttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
+ TestSupportTestPartialInterface::setSupplementalStr2(imp, v);
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr2AttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestSupportTestInterfaceV8Internal::supplementalStr2AttributeSetter(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr3AttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ V8TestSupportTestInterface::supplementalStr3AttributeGetterCustom(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalStr3AttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ V8TestSupportTestInterface::supplementalStr3AttributeSetterCustom(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalNodeAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ v8SetReturnValueFast(info, TestSupportTestPartialInterface::supplementalNode(imp), imp);
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalNodeAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::supplementalNodeAttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalNodeAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ V8TRYCATCH_VOID(Node*, v, V8Node::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0);
+ TestSupportTestPartialInterface::setSupplementalNode(imp, WTF::getPtr(v));
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalNodeAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestSupportTestInterfaceV8Internal::supplementalNodeAttributeSetter(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node13AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ v8SetReturnValueFast(info, TestSupportTestPartialInterface::node13(imp), imp);
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node13AttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::Node13AttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node13AttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ V8TRYCATCH_VOID(Node*, v, V8Node::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0);
+ TestSupportTestPartialInterface::setNode13(imp, WTF::getPtr(v));
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node13AttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestSupportTestInterfaceV8Internal::Node13AttributeSetter(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node14AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ v8SetReturnValueFast(info, TestSupportTestPartialInterface::node14(imp), imp);
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node14AttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::Node14AttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node14AttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ V8TRYCATCH_VOID(Node*, v, V8Node::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0);
+ TestSupportTestPartialInterface::setNode14(imp, WTF::getPtr(v));
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node14AttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestSupportTestInterfaceV8Internal::Node14AttributeSetter(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node15AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ v8SetReturnValueFast(info, TestSupportTestPartialInterface::node15(imp), imp);
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node15AttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+ TestSupportTestInterfaceV8Internal::Node15AttributeGetter(name, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node15AttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(info.Holder());
+ V8TRYCATCH_VOID(Node*, v, V8Node::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0);
+ TestSupportTestPartialInterface::setNode15(imp, WTF::getPtr(v));
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void Node15AttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+ TestSupportTestInterfaceV8Internal::Node15AttributeSetter(name, value, info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(args.Holder());
+ TestSupportTestPartialInterface::supplementalMethod1(imp);
+
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ TestSupportTestInterfaceV8Internal::supplementalMethod1Method(args);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ if (UNLIKELY(args.Length() < 2)) {
+ throwNotEnoughArgumentsError(args.GetIsolate());
+ return;
+ }
+ TestSupportTestInterface* imp = V8TestSupportTestInterface::toNative(args.Holder());
+ ExceptionState es(args.GetIsolate());
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, args[0]);
+ V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+ ScriptExecutionContext* scriptContext = getScriptExecutionContext();
+ RefPtr<TestObj> result = TestSupportTestPartialInterface::supplementalMethod2(scriptContext, imp, strArg, objArg, es);
+ if (es.throwIfNeeded())
+ return;
+ v8SetReturnValue(args, result.release(), args.Holder());
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ TestSupportTestInterfaceV8Internal::supplementalMethod2Method(args);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ V8TestSupportTestInterface::supplementalMethod3MethodCustom(args);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TestSupportTestPartialInterface::supplementalMethod4();
+
+ return;
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ TestSupportTestInterfaceV8Internal::supplementalMethod4Method(args);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+} // namespace TestSupportTestInterfaceV8Internal
+
+static const V8DOMConfiguration::AttributeConfiguration V8TestSupportTestInterfaceAttributes[] = {
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalStaticReadOnlyAttr", TestSupportTestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalStaticAttr", TestSupportTestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback, TestSupportTestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalStr1", TestSupportTestInterfaceV8Internal::supplementalStr1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalStr2", TestSupportTestInterfaceV8Internal::supplementalStr2AttributeGetterCallback, TestSupportTestInterfaceV8Internal::supplementalStr2AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalStr3", TestSupportTestInterfaceV8Internal::supplementalStr3AttributeGetterCallback, TestSupportTestInterfaceV8Internal::supplementalStr3AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalNode", TestSupportTestInterfaceV8Internal::supplementalNodeAttributeGetterCallback, TestSupportTestInterfaceV8Internal::supplementalNodeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+};
+
+static const V8DOMConfiguration::MethodConfiguration V8TestSupportTestInterfaceMethods[] = {
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalMethod1", TestSupportTestInterfaceV8Internal::supplementalMethod1MethodCallback, 0, 0},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalMethod3", TestSupportTestInterfaceV8Internal::supplementalMethod3MethodCallback, 0, 0},
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+};
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestSupportTestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+ desc->ReadOnlyPrototype();
+
+ v8::Local<v8::Signature> defaultSignature;
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestSupportTestInterface", v8::Local<v8::FunctionTemplate>(), V8TestSupportTestInterface::internalFieldCount,
+ V8TestSupportTestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestSupportTestInterfaceAttributes),
+ V8TestSupportTestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestSupportTestInterfaceMethods), isolate, currentWorldType);
+ UNUSED_PARAM(defaultSignature);
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ UNUSED_PARAM(instance);
+ UNUSED_PARAM(proto);
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ if (RuntimeEnabledFeatures::condition13Enabled()) {
+ static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
+ {"Node13", TestSupportTestInterfaceV8Internal::Node13AttributeGetterCallback, TestSupportTestInterfaceV8Internal::Node13AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate, currentWorldType);
+ }
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+ static const V8DOMConfiguration::ConstantConfiguration V8TestSupportTestInterfaceConstants[] = {
+ {"SUPPLEMENTALCONSTANT1", 1},
+ {"SUPPLEMENTALCONSTANT2", 2},
+ };
+ V8DOMConfiguration::installConstants(desc, proto, V8TestSupportTestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestSupportTestInterfaceConstants), isolate);
+ COMPILE_ASSERT(1 == TestSupportTestPartialInterface::SUPPLEMENTALCONSTANT1, TheValueOfTestSupportTestInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation);
+ COMPILE_ASSERT(2 == TestSupportTestPartialInterface::CONST_IMPL, TheValueOfTestSupportTestInterface_CONST_IMPLDoesntMatchWithImplementation);
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+ // Custom Signature 'supplementalMethod2'
+ const int supplementalMethod2Argc = 2;
+ v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::info, currentWorldType) };
+ v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv);
+ proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(TestSupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined(), supplementalMethod2Signature, 2));
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(TestSupportTestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+ // Custom toString template
+ desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+ return desc;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestSupportTestInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+ V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+ V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&info);
+ if (result != data->templateMap(currentWorldType).end())
+ return result->value.newLocal(isolate);
+
+ TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+ v8::HandleScope handleScope(isolate);
+ v8::Handle<v8::FunctionTemplate> templ =
+ ConfigureV8TestSupportTestInterfaceTemplate(data->rawTemplate(&info, currentWorldType), isolate, currentWorldType);
+ data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+ return handleScope.Close(templ);
+}
+
+bool V8TestSupportTestInterface::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+ return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWorldType);
+}
+
+bool V8TestSupportTestInterface::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate* isolate)
+{
+ return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld)
+ || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWorld)
+ || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorld);
+}
+
+void V8TestSupportTestInterface::installPerContextProperties(v8::Handle<v8::Object> instance, TestSupportTestInterface* impl, v8::Isolate* isolate)
+{
+ v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype());
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ if (ContextFeatures::condition14Enabled(impl->document())) {
+ static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
+ {"Node14", TestSupportTestInterfaceV8Internal::Node14AttributeGetterCallback, TestSupportTestInterfaceV8Internal::Node14AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate);
+ }
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ if (ContextFeatures::condition16Enabled(impl->document()) && RuntimeEnabledFeatures::condition15Enabled()) {
+ static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
+ {"Node15", TestSupportTestInterfaceV8Internal::Node15AttributeGetterCallback, TestSupportTestInterfaceV8Internal::Node15AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate);
+ }
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+}
+
+v8::Handle<v8::Object> V8TestSupportTestInterface::createWrapper(PassRefPtr<TestSupportTestInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ ASSERT(impl.get());
+ ASSERT(!DOMDataStore::containsWrapper<V8TestSupportTestInterface>(impl.get(), isolate));
+ if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
+ const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
+ // Might be a XXXConstructor::info instead of an XXX::info. 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 == info.derefObjectFunction);
+ }
+
+ v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &info, toInternalPointer(impl.get()), isolate);
+ if (UNLIKELY(wrapper.IsEmpty()))
+ return wrapper;
+
+ installPerContextProperties(wrapper, impl.get(), isolate);
+ V8DOMWrapper::associateObjectWithWrapper<V8TestSupportTestInterface>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent);
+ return wrapper;
+}
+
+void V8TestSupportTestInterface::derefObject(void* object)
+{
+ fromInternalPointer(object)->deref();
+}
+
+} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698