| Index: Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
|
| diff --git a/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp b/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9a2e67be3520b5191a4d3883623927ae6e8fdb17
|
| --- /dev/null
|
| +++ b/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
|
| @@ -0,0 +1,105 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
|
| +
|
| +#include "config.h"
|
| +#include "TestInterfaceOrLong.h"
|
| +
|
| +
|
| +namespace blink {
|
| +
|
| +TestInterfaceOrLong::TestInterfaceOrLong()
|
| + : m_type(SpecificTypeNone)
|
| +{
|
| +}
|
| +
|
| +PassRefPtr<TestInterfaceImplementation> TestInterfaceOrLong::getAsTestInterface() const
|
| +{
|
| + ASSERT(isTestInterface());
|
| + return m_testInterface;
|
| +}
|
| +
|
| +void TestInterfaceOrLong::setTestInterface(PassRefPtr<TestInterfaceImplementation> value)
|
| +{
|
| + ASSERT(isNull());
|
| + m_testInterface = value;
|
| + m_type = SpecificTypeTestInterface;
|
| +}
|
| +
|
| +TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(PassRefPtr<TestInterfaceImplementation> value)
|
| +{
|
| + TestInterfaceOrLong container;
|
| + container.setTestInterface(value);
|
| + return container;
|
| +}
|
| +
|
| +int TestInterfaceOrLong::getAsLong() const
|
| +{
|
| + ASSERT(isLong());
|
| + return m_long;
|
| +}
|
| +
|
| +void TestInterfaceOrLong::setLong(int value)
|
| +{
|
| + ASSERT(isNull());
|
| + m_long = value;
|
| + m_type = SpecificTypeLong;
|
| +}
|
| +
|
| +TestInterfaceOrLong TestInterfaceOrLong::fromLong(int value)
|
| +{
|
| + TestInterfaceOrLong container;
|
| + container.setLong(value);
|
| + return container;
|
| +}
|
| +
|
| +void V8TestInterfaceOrLong::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, TestInterfaceOrLong& impl, ExceptionState& exceptionState)
|
| +{
|
| + if (v8Value.IsEmpty())
|
| + return;
|
| +
|
| + if (V8TestInterface::hasInstance(v8Value, isolate)) {
|
| + RefPtr<TestInterfaceImplementation> cppValue = V8TestInterface::toImpl(v8::Local<v8::Object>::Cast(v8Value));
|
| + impl.setTestInterface(cppValue);
|
| + return;
|
| + }
|
| +
|
| + if (v8Value->IsNumber()) {
|
| + TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
|
| + impl.setLong(cppValue);
|
| + return;
|
| + }
|
| +
|
| + {
|
| + TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
|
| + impl.setLong(cppValue);
|
| + return;
|
| + }
|
| +
|
| +}
|
| +
|
| +v8::Local<v8::Value> toV8(const TestInterfaceOrLong& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
|
| +{
|
| + switch (impl.m_type) {
|
| + case TestInterfaceOrLong::SpecificTypeNone:
|
| + return v8::Null(isolate);
|
| + case TestInterfaceOrLong::SpecificTypeTestInterface:
|
| + return toV8(impl.getAsTestInterface(), creationContext, isolate);
|
| + case TestInterfaceOrLong::SpecificTypeLong:
|
| + return v8::Integer::New(isolate, impl.getAsLong());
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + }
|
| + return v8::Local<v8::Value>();
|
| +}
|
| +
|
| +TestInterfaceOrLong NativeValueTraits<TestInterfaceOrLong>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
|
| +{
|
| + TestInterfaceOrLong impl;
|
| + V8TestInterfaceOrLong::toImpl(isolate, value, impl, exceptionState);
|
| + return impl;
|
| +}
|
| +
|
| +} // namespace blink
|
|
|