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

Unified Diff: Source/bindings/tests/results/core/DoubleOrString.h

Issue 953123003: IDL: Put generated union type containers in separate files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/core/DoubleOrString.h
diff --git a/Source/bindings/tests/results/core/DoubleOrString.h b/Source/bindings/tests/results/core/DoubleOrString.h
new file mode 100644
index 0000000000000000000000000000000000000000..61be89fb4566fce50e3f817072d553f956e7bdfe
--- /dev/null
+++ b/Source/bindings/tests/results/core/DoubleOrString.h
@@ -0,0 +1,77 @@
+// 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!
+
+#ifndef DoubleOrString_h
+#define DoubleOrString_h
+
+#include "bindings/core/v8/Dictionary.h"
+#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class DoubleOrString final {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+public:
+ DoubleOrString();
+ bool isNull() const { return m_type == SpecificTypeNone; }
+
+ bool isDouble() const { return m_type == SpecificTypeDouble; }
+ double getAsDouble() const;
+ void setDouble(double);
+ static DoubleOrString fromDouble(double);
+
+ bool isString() const { return m_type == SpecificTypeString; }
+ String getAsString() const;
+ void setString(String);
+ static DoubleOrString fromString(String);
+
+private:
+ enum SpecificTypes {
+ SpecificTypeNone,
+ SpecificTypeDouble,
+ SpecificTypeString,
+ };
+ SpecificTypes m_type;
+
+ double m_double;
+ String m_string;
+
+ friend v8::Local<v8::Value> toV8(const DoubleOrString&, v8::Local<v8::Object>, v8::Isolate*);
+};
+
+class V8DoubleOrString final {
+public:
+ static void toImpl(v8::Isolate*, v8::Local<v8::Value>, DoubleOrString&, ExceptionState&);
+};
+
+v8::Local<v8::Value> toV8(const DoubleOrString&, v8::Local<v8::Object>, v8::Isolate*);
+
+template <class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, DoubleOrString& impl)
+{
+ v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+template <>
+struct NativeValueTraits<DoubleOrString> {
+ static DoubleOrString nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&);
+};
+
+class V8DoubleOrStringOrNull final {
+public:
+ static void toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, DoubleOrString& impl, ExceptionState& exceptionState)
+ {
+ if (isUndefinedOrNull(v8Value))
+ return;
+ V8DoubleOrString::toImpl(isolate, v8Value, impl, exceptionState);
+ }
+};
+
+} // namespace blink
+
+#endif // DoubleOrString_h

Powered by Google App Engine
This is Rietveld 408576698