| Index: third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d12b9b0c06dbf33e9c09563fdaba526f68cf02cb
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
|
| @@ -0,0 +1,80 @@
|
| +// 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 UnrestrictedDoubleOrString_h
|
| +#define UnrestrictedDoubleOrString_h
|
| +
|
| +#include "bindings/core/v8/Dictionary.h"
|
| +#include "bindings/core/v8/ExceptionState.h"
|
| +#include "bindings/core/v8/V8Binding.h"
|
| +#include "core/CoreExport.h"
|
| +#include "platform/heap/Handle.h"
|
| +
|
| +namespace blink {
|
| +
|
| +
|
| +class CORE_EXPORT UnrestrictedDoubleOrString final {
|
| + DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| +public:
|
| + UnrestrictedDoubleOrString();
|
| + bool isNull() const { return m_type == SpecificTypeNone; }
|
| +
|
| + bool isUnrestrictedDouble() const { return m_type == SpecificTypeUnrestrictedDouble; }
|
| + double getAsUnrestrictedDouble() const;
|
| + void setUnrestrictedDouble(double);
|
| + static UnrestrictedDoubleOrString fromUnrestrictedDouble(double);
|
| +
|
| + bool isString() const { return m_type == SpecificTypeString; }
|
| + String getAsString() const;
|
| + void setString(String);
|
| + static UnrestrictedDoubleOrString fromString(String);
|
| +
|
| + UnrestrictedDoubleOrString(const UnrestrictedDoubleOrString&);
|
| + ~UnrestrictedDoubleOrString();
|
| + UnrestrictedDoubleOrString& operator=(const UnrestrictedDoubleOrString&);
|
| + DECLARE_TRACE();
|
| +
|
| +private:
|
| + enum SpecificTypes {
|
| + SpecificTypeNone,
|
| + SpecificTypeUnrestrictedDouble,
|
| + SpecificTypeString,
|
| + };
|
| + SpecificTypes m_type;
|
| +
|
| + double m_unrestrictedDouble;
|
| + String m_string;
|
| +
|
| + friend CORE_EXPORT v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString&, v8::Local<v8::Object>, v8::Isolate*);
|
| +};
|
| +
|
| +class V8UnrestrictedDoubleOrString final {
|
| +public:
|
| + CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, UnrestrictedDoubleOrString&, UnionTypeConversionMode, ExceptionState&);
|
| +};
|
| +
|
| +CORE_EXPORT v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString&, v8::Local<v8::Object>, v8::Isolate*);
|
| +
|
| +template <class CallbackInfo>
|
| +inline void v8SetReturnValue(const CallbackInfo& callbackInfo, UnrestrictedDoubleOrString& impl)
|
| +{
|
| + v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
|
| +}
|
| +
|
| +template <>
|
| +struct NativeValueTraits<UnrestrictedDoubleOrString> {
|
| + CORE_EXPORT static UnrestrictedDoubleOrString nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +// We need to set canInitializeWithMemset=true because HeapVector supports
|
| +// items that can initialize with memset or have a vtable. It is safe to
|
| +// set canInitializeWithMemset=true for a union type object in practice.
|
| +// See https://codereview.chromium.org/1118993002/#msg5 for more details.
|
| +WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::UnrestrictedDoubleOrString);
|
| +
|
| +#endif // UnrestrictedDoubleOrString_h
|
|
|