Commit 1790f179 authored by tasak@google.com's avatar tasak@google.com

Added core and modules to binding tests results for binding modularization.

Updated main.py to support core/modules results.
Moved all current test results into Source/bindings/tests/results/core.
Added TestInterface5.idl to tests/idls/modules and V8TestInterface5.{h,cpp} to tests/results/modules.

BUG=358074

Review URL: https://codereview.chromium.org/557203002

git-svn-id: svn://svn.chromium.org/blink/trunk@181720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3aa76a7a
/*
* 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.
*/
// Test for interface extended attributes and special operations.
// Also used as a target by TestObject
[
ActiveDOMObject,
Conditional=CONDITION,
Custom=(LegacyCallAsFunction,ToV8),
DoNotCheckConstants,
ImplementedAs=TestInterface5Implementation,
Iterable,
RuntimeEnabled=FeatureName,
SetWrapperReferenceTo(TestInterface5 referencedName),
TypeChecking=(Interface,Unrestricted),
Exposed=(Worker,Window),
] interface TestInterface5 : TestInterfaceEmpty {
// members needed to test [ImplementedAs], as this affect attribute
// configuration and method configuration, and [TypeChecking]
// constants also needed for [DoNotCheckConstants]
const unsigned long UNSIGNED_LONG = 0;
[Reflect=CONST_CPP] const short CONST_JAVASCRIPT = 1;
attribute TestInterface5 testInterfaceAttribute; // Self-referential interface type with [ImplementedAs]
attribute TestInterface5Constructor testInterfaceConstructorAttribute;
attribute double doubleAttribute;
attribute float floatAttribute;
attribute unrestricted double unrestrictedDoubleAttribute;
attribute unrestricted float unrestrictedFloatAttribute;
static attribute DOMString staticStringAttribute;
void voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
void voidMethodDoubleArgFloatArg(double doubleArg, float floatArg);
void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestricted double unrestrictedDoubleArg, unrestricted float unrestrictedFloatArg);
[PerWorldBindings] void voidMethod();
// Anonymous indexed property operations
getter DOMString (unsigned long index);
setter DOMString (unsigned long index, DOMString value);
deleter boolean (unsigned long index);
// Anonymous named property operations
getter DOMString (DOMString name);
setter DOMString (DOMString name, DOMString value);
deleter boolean (DOMString name);
[NotEnumerable] stringifier;
// Per-method [Exposed] annotation support.
void alwaysExposedMethod();
[Exposed=Worker] void workerExposedMethod();
[Exposed=Window] void windowExposedMethod();
static void alwaysExposedStaticMethod();
[Exposed=Worker] static void workerExposedStaticMethod();
[Exposed=Window] static void windowExposedStaticMethod();
attribute long alwaysExposedAttribute;
[Exposed=Worker] attribute long workerExposedAttribute;
[Exposed=Window] attribute long windowExposedAttribute;
[Exposed=(Window,ServiceWorker)] void windowAndServiceWorkerExposedMethod();
};
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
#include "config.h"
#if ENABLE(CONDITION)
#include "V8TestInterface5.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/tests/v8/V8Iterator.h"
#include "bindings/tests/v8/V8TestInterface5.h"
#include "bindings/tests/v8/V8TestInterfaceEmpty.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/TraceEvent.h"
#include "wtf/GetPtr.h"
#include "wtf/RefPtr.h"
namespace blink {
const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::derefObject, V8TestInterface5::createPersistentHandle, V8TestInterface5::toActiveDOMObject, 0, V8TestInterface5::visitDOMWrapper, V8TestInterface5::installConditionallyEnabledMethods, V8TestInterface5::installConditionallyEnabledProperties, &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject };
// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterface5Implementation.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestInterface5::wrapperTypeInfo;
namespace TestInterface5ImplementationV8Internal {
template <typename T> void V8_USE(T) { }
static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl);
}
static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceAttribute", "TestInterface5", holder, info.GetIsolate());
if (!V8TestInterface5::hasInstance(v8Value, info.GetIsolate())) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterface5'.");
exceptionState.throwIfNeeded();
return;
}
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID(TestInterface5Implementation*, cppValue, V8TestInterface5::toImplWithTypeCheck(info.GetIsolate(), v8Value));
impl->setTestInterfaceAttribute(WTF::getPtr(cppValue));
}
static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void doubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValue(info, impl->doubleAttribute());
}
static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue()));
if (!std::isfinite(cppValue)) {
exceptionState.throwTypeError("The provided double value is non-finite.");
exceptionState.throwIfNeeded();
return;
}
impl->setDoubleAttribute(cppValue);
}
static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValue(info, impl->floatAttribute());
}
static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue()));
if (!std::isfinite(cppValue)) {
exceptionState.throwTypeError("The provided float value is non-finite.");
exceptionState.throwIfNeeded();
return;
}
impl->setFloatAttribute(cppValue);
}
static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void unrestrictedDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValue(info, impl->unrestrictedDoubleAttribute());
}
static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue()));
impl->setUnrestrictedDoubleAttribute(cppValue);
}
static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValue(info, impl->unrestrictedFloatAttribute());
}
static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue()));
impl->setUnrestrictedFloatAttribute(cppValue);
}
static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void staticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribute(), info.GetIsolate());
}
static void staticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
TestInterface5Implementation::setStaticStringAttribute(cppValue);
}
static void staticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void alwaysExposedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValueInt(info, impl->alwaysExposedAttribute());
}
static void alwaysExposedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "alwaysExposedAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
impl->setAlwaysExposedAttribute(cppValue);
}
static void alwaysExposedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void workerExposedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValueInt(info, impl->workerExposedAttribute());
}
static void workerExposedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "workerExposedAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
impl->setWorkerExposedAttribute(cppValue);
}
static void workerExposedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void windowExposedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
v8SetReturnValueInt(info, impl->windowExposedAttribute());
}
static void windowExposedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "windowExposedAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
impl->setWindowExposedAttribute(cppValue);
}
static void windowExposedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void TestInterface5ImplementationConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Value> data = info.Data();
ASSERT(data->IsExternal());
V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
if (!perContextData)
return;
v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
}
static void TestInterface5ImplementationForceSetAttributeOnThis(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
if (info.This()->IsObject())
v8::Handle<v8::Object>::Cast(info.This())->ForceSet(name, v8Value);
}
static void TestInterface5ImplementationForceSetAttributeOnThisCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
TestInterface5ImplementationV8Internal::TestInterface5ImplementationForceSetAttributeOnThis(name, v8Value, info);
}
static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestInterface5", 1, info.Length(), info.GetIsolate()), info.GetIsolate());
return;
}
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
TestInterfaceEmpty* testInterfaceEmptyArg;
{
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) {
V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate());
return;
}
TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]));
}
impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
}
static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 2)) {
V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodDoubleArgFloatArg", "TestInterface5", 2, info.Length(), info.GetIsolate()), info.GetIsolate());
return;
}
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
double doubleArg;
float floatArg;
{
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberValue()));
if (!std::isfinite(doubleArg)) {
V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFloatArg", "TestInterface5", "double parameter 1 is non-finite."), info.GetIsolate());
return;
}
TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[1]->NumberValue()));
if (!std::isfinite(floatArg)) {
V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFloatArg", "TestInterface5", "float parameter 2 is non-finite."), info.GetIsolate());
return;
}
}
impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
}
static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 2)) {
V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface5", 2, info.Length(), info.GetIsolate()), info.GetIsolate());
return;
}
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
double unrestrictedDoubleArg;
float unrestrictedFloatArg;
{
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
TONATIVE_VOID_INTERNAL(unrestrictedDoubleArg, static_cast<double>(info[0]->NumberValue()));
TONATIVE_VOID_INTERNAL(unrestrictedFloatArg, static_cast<float>(info[1]->NumberValue()));
}
impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleArg, unrestrictedFloatArg);
}
static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
impl->voidMethod();
}
static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::voidMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
impl->voidMethod();
}
static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
impl->alwaysExposedMethod();
}
static void alwaysExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
impl->workerExposedMethod();
}
static void workerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
impl->windowExposedMethod();
}
static void windowExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation::alwaysExposedStaticMethod();
}
static void alwaysExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation::workerExposedStaticMethod();
}
static void workerExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation::windowExposedStaticMethod();
}
static void windowExposedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
impl->windowAndServiceWorkerExposedMethod();
}
static void windowAndServiceWorkerExposedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
}
static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::toStringMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface5", info.Holder(), info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState);
if (exceptionState.hadException()) {
exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result.release());
}
static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
TestInterface5ImplementationV8Internal::iteratorMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
String result = impl->anonymousIndexedGetter(index);
if (result.isNull())
return;
v8SetReturnValueString(info, result, info.GetIsolate());
}
static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty");
TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
TOSTRING_VOID(V8StringResource<>, propertyValue, v8Value);
bool result = impl->anonymousIndexedSetter(index, propertyValue);
if (!result)
return;
v8SetReturnValue(info, v8Value);
}
static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty");
TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
DeleteResult result = impl->anonymousIndexedDeleter(index);
if (result != DeleteUnknownProperty)
return v8SetReturnValueBool(info, result == DeleteSuccess);
}
static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty");
TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
if (info.Holder()->HasRealNamedProperty(name))
return;
if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
return;
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
String result = impl->anonymousNamedGetter(propertyName);
if (result.isNull())
return;
v8SetReturnValueString(info, result, info.GetIsolate());
}
static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
if (info.Holder()->HasRealNamedProperty(name))
return;
if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
return;
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
TOSTRING_VOID(V8StringResource<>, propertyName, name);
TOSTRING_VOID(V8StringResource<>, propertyValue, v8Value);
bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
if (!result)
return;
v8SetReturnValue(info, v8Value);
}
static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
v8::String::Utf8Value namedProperty(name);
ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface5", info.Holder(), info.GetIsolate());
bool result = impl->namedPropertyQuery(propertyName, exceptionState);
if (exceptionState.throwIfNeeded())
return;
if (!result)
return;
v8SetReturnValueInt(info, v8::None);
}
static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
DeleteResult result = impl->anonymousNamedDeleter(propertyName);
if (result != DeleteUnknownProperty)
return v8SetReturnValueBool(info, result == DeleteSuccess);
}
static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
TestInterface5ImplementationV8Internal::namedPropertyDeleter(name, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
Vector<String> names;
ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface5", info.Holder(), info.GetIsolate());
impl->namedPropertyEnumerator(names, exceptionState);
if (exceptionState.throwIfNeeded())
return;
v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
for (size_t i = 0; i < names.size(); ++i)
v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
v8SetReturnValue(info, v8names);
}
static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
} // namespace TestInterface5ImplementationV8Internal
void V8TestInterface5::visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
{
TestInterface5Implementation* impl = internalPointer->toImpl<TestInterface5Implementation>();
v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper);
V8WrapperInstantiationScope scope(creationContext, isolate);
TestInterface5Implementation* referencedName = impl->referencedName();
if (referencedName) {
if (!DOMDataStore::containsWrapper<V8TestInterface5>(referencedName, isolate))
wrap(referencedName, creationContext, isolate);
DOMDataStore::setWrapperReference<V8TestInterface5>(wrapper, referencedName, isolate);
}
setObjectGroup(internalPointer, wrapper, isolate);
}
static const V8DOMConfiguration::AttributeConfiguration V8TestInterface5Attributes[] = {
{"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
{"testInterfaceConstructorAttribute", TestInterface5ImplementationV8Internal::TestInterface5ImplementationConstructorGetter, TestInterface5ImplementationV8Internal::TestInterface5ImplementationForceSetAttributeOnThisCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
{"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
{"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
{"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
{"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
{"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
};
static const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = {
{"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
{"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts},
{"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts},
{"voidMethod", TestInterface5ImplementationV8Internal::voidMethodMethodCallback, TestInterface5ImplementationV8Internal::voidMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts},
{"alwaysExposedMethod", TestInterface5ImplementationV8Internal::alwaysExposedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
};
static void installV8TestInterface5Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
functionTemplate->ReadOnlyPrototype();
v8::Local<v8::Signature> defaultSignature;
if (!RuntimeEnabledFeatures::featureNameEnabled())
defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface5::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate);
else
defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterface5", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface5::internalFieldCount,
V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attributes),
0, 0,
V8TestInterface5Methods, WTF_ARRAY_LENGTH(V8TestInterface5Methods),
isolate);
v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();
static const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[] = {
{"UNSIGNED_LONG", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong},
{"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort},
};
V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants), isolate);
functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterface5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface5Implementation>);
functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterface5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5ImplementationV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Internal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::namedPropertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEnumeratorCallback);
static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Internal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::DontDelete, symbolKeyedIteratorConfiguration, isolate);
functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom);
static const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMethodMethodConfiguration = {
"alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts,
};
V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>(), v8::None, alwaysExposedStaticMethodMethodConfiguration, isolate);
static const V8DOMConfiguration::MethodConfiguration toStringMethodConfiguration = {
"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts,
};
V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum), toStringMethodConfiguration, isolate);
functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttribute"), TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
// Custom toString template
functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}
v8::Handle<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isolate)
{
return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template);
}
bool V8TestInterface5::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}
v8::Handle<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}
TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
{
return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestInterface5Implementation>() : 0;
}
void V8TestInterface5::installConditionallyEnabledProperties(v8::Handle<v8::Object> instanceObject, v8::Isolate* isolate)
{
v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instanceObject->GetPrototype());
ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
if (context && (context->isWorkerGlobalScope())) {
static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
{"workerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance};
V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attributeConfiguration, isolate);
}
if (context && (context->isDocument())) {
static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
{"windowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance};
V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attributeConfiguration, isolate);
}
}
void V8TestInterface5::installConditionallyEnabledMethods(v8::Handle<v8::Object> prototypeObject, v8::Isolate* isolate)
{
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate));
ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
ASSERT(context);
if (context && (context->isWorkerGlobalScope())) {
prototypeObject->Set(v8AtomicString(isolate, "workerExposedMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::workerExposedMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
}
if (context && (context->isDocument())) {
prototypeObject->Set(v8AtomicString(isolate, "windowExposedMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::windowExposedMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
}
if (context && (context->isWorkerGlobalScope())) {
prototypeObject->Set(v8AtomicString(isolate, "workerExposedStaticMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
}
if (context && (context->isDocument())) {
prototypeObject->Set(v8AtomicString(isolate, "windowExposedStaticMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
}
if (context && (context->isDocument() || context->isServiceWorkerGlobalScope())) {
prototypeObject->Set(v8AtomicString(isolate, "windowAndServiceWorkerExposedMethod"), v8::FunctionTemplate::New(isolate, TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
}
}
ActiveDOMObject* V8TestInterface5::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
{
return toImpl(wrapper);
}
void V8TestInterface5::refObject(ScriptWrappableBase* internalPointer)
{
internalPointer->toImpl<TestInterface5Implementation>()->ref();
}
void V8TestInterface5::derefObject(ScriptWrappableBase* internalPointer)
{
internalPointer->toImpl<TestInterface5Implementation>()->deref();
}
WrapperPersistentNode* V8TestInterface5::createPersistentHandle(ScriptWrappableBase* internalPointer)
{
ASSERT_NOT_REACHED();
return 0;
}
template<>
v8::Handle<v8::Value> toV8NoInline(TestInterface5Implementation* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return toV8(impl, creationContext, isolate);
}
} // namespace blink
#endif // ENABLE(CONDITION)
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
#ifndef V8TestInterface5_h
#define V8TestInterface5_h
#if ENABLE(CONDITION)
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8DOMWrapper.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
#include "bindings/tests/idls/modules/TestInterface5Implementation.h"
#include "bindings/tests/v8/V8TestInterfaceEmpty.h"
#include "platform/heap/Handle.h"
namespace blink {
class V8TestInterface5 {
public:
static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
static TestInterface5Implementation* toImpl(v8::Handle<v8::Object> object)
{
return toImpl(blink::toScriptWrappableBase(object));
}
static TestInterface5Implementation* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
static const WrapperTypeInfo wrapperTypeInfo;
static void refObject(ScriptWrappableBase* internalPointer);
static void derefObject(ScriptWrappableBase* internalPointer);
static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer);
static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>&, v8::Isolate*);
static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static inline ScriptWrappableBase* toScriptWrappableBase(TestInterface5Implementation* impl)
{
return impl->toScriptWrappableBase();
}
static inline TestInterface5Implementation* toImpl(ScriptWrappableBase* internalPointer)
{
return internalPointer->toImpl<TestInterface5Implementation>();
}
static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*);
static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*);
private:
};
class TestInterface5Implementation;
v8::Handle<v8::Value> toV8(TestInterface5Implementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
template<class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterface5Implementation* impl)
{
v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template<class CallbackInfo>
inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterface5Implementation* impl)
{
v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template<class CallbackInfo, class Wrappable>
inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface5Implementation* impl, Wrappable*)
{
v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface5Implementation> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return toV8(impl.get(), creationContext, isolate);
}
template<class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface5Implementation> impl)
{
v8SetReturnValue(callbackInfo, impl.get());
}
template<class CallbackInfo>
inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface5Implementation> impl)
{
v8SetReturnValueForMainWorld(callbackInfo, impl.get());
}
template<class CallbackInfo, class Wrappable>
inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface5Implementation> impl, Wrappable* wrappable)
{
v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
}
} // namespace blink
#endif // ENABLE(CONDITION)
#endif // V8TestInterface5_h
...@@ -72,6 +72,11 @@ COMPONENT_DIRECTORY = frozenset(['core', 'modules']) ...@@ -72,6 +72,11 @@ COMPONENT_DIRECTORY = frozenset(['core', 'modules'])
test_input_directory = os.path.join(source_path, 'bindings', 'tests', 'idls') test_input_directory = os.path.join(source_path, 'bindings', 'tests', 'idls')
reference_directory = os.path.join(source_path, 'bindings', 'tests', 'results') reference_directory = os.path.join(source_path, 'bindings', 'tests', 'results')
PLY_LEX_YACC_FILES = frozenset([
'lextab.py', # PLY lex
'lextab.pyc',
'parsetab.pickle', # PLY yacc
])
@contextmanager @contextmanager
def TemporaryDirectory(): def TemporaryDirectory():
...@@ -125,6 +130,16 @@ def generate_interface_dependencies(): ...@@ -125,6 +130,16 @@ def generate_interface_dependencies():
def bindings_tests(output_directory, verbose): def bindings_tests(output_directory, verbose):
executive = Executive() executive = Executive()
def list_files(directory):
files = []
for component in os.listdir(directory):
if component not in COMPONENT_DIRECTORY:
continue
directory_with_component = os.path.join(directory, component)
for filename in os.listdir(directory_with_component):
files.append(os.path.join(directory_with_component, filename))
return files
def diff(filename1, filename2): def diff(filename1, filename2):
# Python's difflib module is too slow, especially on long output, so # Python's difflib module is too slow, especially on long output, so
# run external diff(1) command # run external diff(1) command
...@@ -137,14 +152,17 @@ def bindings_tests(output_directory, verbose): ...@@ -137,14 +152,17 @@ def bindings_tests(output_directory, verbose):
# non-zero exit if files differ. # non-zero exit if files differ.
return executive.run_command(cmd, error_handler=lambda x: None) return executive.run_command(cmd, error_handler=lambda x: None)
def is_cache_file(filename):
if filename in PLY_LEX_YACC_FILES:
return True
if filename.endswith('.cache'): # Jinja
return True
return False
def delete_cache_files(): def delete_cache_files():
# FIXME: Instead of deleting cache files, don't generate them. # FIXME: Instead of deleting cache files, don't generate them.
cache_files = [os.path.join(output_directory, output_file) cache_files = [path for path in list_files(output_directory)
for output_file in os.listdir(output_directory) if is_cache_file(os.path.basename(path))]
if (output_file in ('lextab.py', # PLY lex
'lextab.pyc',
'parsetab.pickle') or # PLY yacc
output_file.endswith('.cache'))] # Jinja
for cache_file in cache_files: for cache_file in cache_files:
os.remove(cache_file) os.remove(cache_file)
...@@ -169,19 +187,25 @@ def bindings_tests(output_directory, verbose): ...@@ -169,19 +187,25 @@ def bindings_tests(output_directory, verbose):
print 'PASS: %s' % reference_basename print 'PASS: %s' % reference_basename
return True return True
def identical_output_files(): def identical_output_files(output_files):
file_pairs = [(os.path.join(reference_directory, output_file), reference_files = [os.path.join(reference_directory,
os.path.join(output_directory, output_file)) os.path.relpath(path, output_directory))
for output_file in os.listdir(output_directory)] for path in output_files]
return all([identical_file(reference_filename, output_filename) return all([identical_file(reference_filename, output_filename)
for (reference_filename, output_filename) in file_pairs]) for (reference_filename, output_filename) in zip(reference_files, output_files)])
def no_excess_files(): def no_excess_files(output_files):
generated_files = set(os.listdir(output_directory)) generated_files = set([os.path.relpath(path, output_directory)
generated_files.add('.svn') # Subversion working copy directory for path in output_files])
excess_files = [output_file # Add subversion working copy directories in core and modules.
for output_file in os.listdir(reference_directory) for component in COMPONENT_DIRECTORY:
if output_file not in generated_files] generated_files.add(os.path.join(component, '.svn'))
excess_files = []
for path in list_files(reference_directory):
relpath = os.path.relpath(path, reference_directory)
if relpath not in generated_files:
excess_files.append(relpath)
if excess_files: if excess_files:
print ('Excess reference files! ' print ('Excess reference files! '
'(probably cruft from renaming or deleting):\n' + '(probably cruft from renaming or deleting):\n' +
...@@ -191,15 +215,19 @@ def bindings_tests(output_directory, verbose): ...@@ -191,15 +215,19 @@ def bindings_tests(output_directory, verbose):
try: try:
generate_interface_dependencies() generate_interface_dependencies()
idl_compiler = IdlCompilerV8(output_directory,
interfaces_info=interfaces_info,
only_if_changed=True)
dictionary_impl_compiler = IdlCompilerDictionaryImpl(
output_directory, interfaces_info=interfaces_info,
only_if_changed=True)
idl_filenames = []
for component in COMPONENT_DIRECTORY: for component in COMPONENT_DIRECTORY:
output_dir = os.path.join(output_directory, component)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
idl_compiler = IdlCompilerV8(output_dir,
interfaces_info=interfaces_info,
only_if_changed=True)
dictionary_impl_compiler = IdlCompilerDictionaryImpl(
output_dir, interfaces_info=interfaces_info,
only_if_changed=True)
idl_filenames = []
input_directory = os.path.join(test_input_directory, component) input_directory = os.path.join(test_input_directory, component)
for filename in os.listdir(input_directory): for filename in os.listdir(input_directory):
if (filename.endswith('.idl') and if (filename.endswith('.idl') and
...@@ -209,21 +237,21 @@ def bindings_tests(output_directory, verbose): ...@@ -209,21 +237,21 @@ def bindings_tests(output_directory, verbose):
idl_filenames.append( idl_filenames.append(
os.path.realpath( os.path.realpath(
os.path.join(input_directory, filename))) os.path.join(input_directory, filename)))
for idl_path in idl_filenames: for idl_path in idl_filenames:
idl_basename = os.path.basename(idl_path) idl_basename = os.path.basename(idl_path)
idl_compiler.compile_file(idl_path) idl_compiler.compile_file(idl_path)
definition_name, _ = os.path.splitext(idl_basename) definition_name, _ = os.path.splitext(idl_basename)
if (definition_name in interfaces_info and if (definition_name in interfaces_info and interfaces_info[definition_name]['is_dictionary']):
interfaces_info[definition_name]['is_dictionary']): dictionary_impl_compiler.compile_file(idl_path)
dictionary_impl_compiler.compile_file(idl_path) if verbose:
if verbose: print 'Compiled: %s' % idl_path
print 'Compiled: %s' % idl_path
finally: finally:
delete_cache_files() delete_cache_files()
# Detect all changes # Detect all changes
passed = identical_output_files() output_files = list_files(output_directory)
passed &= no_excess_files() passed = identical_output_files(output_files)
passed &= no_excess_files(output_files)
if passed: if passed:
if verbose: if verbose:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment