| Index: Source/bindings/tests/results/core/StringOrStringSequence.cpp
|
| diff --git a/Source/bindings/tests/results/core/StringOrStringSequence.cpp b/Source/bindings/tests/results/core/StringOrStringSequence.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d05bceb8e59191a0b1f6498cef8d82045ac4183d
|
| --- /dev/null
|
| +++ b/Source/bindings/tests/results/core/StringOrStringSequence.cpp
|
| @@ -0,0 +1,99 @@
|
| +// 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 "StringOrStringSequence.h"
|
| +
|
| +
|
| +namespace blink {
|
| +
|
| +StringOrStringSequence::StringOrStringSequence()
|
| + : m_type(SpecificTypeNone)
|
| +{
|
| +}
|
| +
|
| +String StringOrStringSequence::getAsString() const
|
| +{
|
| + ASSERT(isString());
|
| + return m_string;
|
| +}
|
| +
|
| +void StringOrStringSequence::setString(String value)
|
| +{
|
| + ASSERT(isNull());
|
| + m_string = value;
|
| + m_type = SpecificTypeString;
|
| +}
|
| +
|
| +StringOrStringSequence StringOrStringSequence::fromString(String value)
|
| +{
|
| + StringOrStringSequence container;
|
| + container.setString(value);
|
| + return container;
|
| +}
|
| +
|
| +const Vector<String>& StringOrStringSequence::getAsStringSequence() const
|
| +{
|
| + ASSERT(isStringSequence());
|
| + return m_stringSequence;
|
| +}
|
| +
|
| +void StringOrStringSequence::setStringSequence(const Vector<String>& value)
|
| +{
|
| + ASSERT(isNull());
|
| + m_stringSequence = value;
|
| + m_type = SpecificTypeStringSequence;
|
| +}
|
| +
|
| +StringOrStringSequence StringOrStringSequence::fromStringSequence(const Vector<String>& value)
|
| +{
|
| + StringOrStringSequence container;
|
| + container.setStringSequence(value);
|
| + return container;
|
| +}
|
| +
|
| +void V8StringOrStringSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, StringOrStringSequence& impl, ExceptionState& exceptionState)
|
| +{
|
| + if (v8Value.IsEmpty())
|
| + return;
|
| +
|
| + if (v8Value->IsArray()) {
|
| + TONATIVE_VOID_EXCEPTIONSTATE(Vector<String>, cppValue, toImplArray<String>(v8Value, 0, isolate, exceptionState), exceptionState);
|
| + impl.setStringSequence(cppValue);
|
| + return;
|
| + }
|
| +
|
| + {
|
| + TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, v8Value, exceptionState);
|
| + impl.setString(cppValue);
|
| + return;
|
| + }
|
| +
|
| +}
|
| +
|
| +v8::Local<v8::Value> toV8(const StringOrStringSequence& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
|
| +{
|
| + switch (impl.m_type) {
|
| + case StringOrStringSequence::SpecificTypeNone:
|
| + return v8::Null(isolate);
|
| + case StringOrStringSequence::SpecificTypeString:
|
| + return v8String(isolate, impl.getAsString());
|
| + case StringOrStringSequence::SpecificTypeStringSequence:
|
| + return toV8(impl.getAsStringSequence(), creationContext, isolate);
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + }
|
| + return v8::Local<v8::Value>();
|
| +}
|
| +
|
| +StringOrStringSequence NativeValueTraits<StringOrStringSequence>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState)
|
| +{
|
| + StringOrStringSequence impl;
|
| + V8StringOrStringSequence::toImpl(isolate, value, impl, exceptionState);
|
| + return impl;
|
| +}
|
| +
|
| +} // namespace blink
|
|
|