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

Unified Diff: Source/bindings/tests/results/core/StringOrDouble.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/StringOrDouble.h
diff --git a/Source/bindings/tests/results/core/StringOrDouble.h b/Source/bindings/tests/results/core/StringOrDouble.h
new file mode 100644
index 0000000000000000000000000000000000000000..347c8b456cb84cfa6408941ca5de0744c06f57d2
--- /dev/null
+++ b/Source/bindings/tests/results/core/StringOrDouble.h
@@ -0,0 +1,67 @@
+// 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 StringOrDouble_h
+#define StringOrDouble_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 StringOrDouble final {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+public:
+ StringOrDouble();
+ bool isNull() const { return m_type == SpecificTypeNone; }
+
+ bool isString() const { return m_type == SpecificTypeString; }
+ String getAsString() const;
+ void setString(String);
+ static StringOrDouble fromString(String);
+
+ bool isDouble() const { return m_type == SpecificTypeDouble; }
+ double getAsDouble() const;
+ void setDouble(double);
+ static StringOrDouble fromDouble(double);
+
+private:
+ enum SpecificTypes {
+ SpecificTypeNone,
+ SpecificTypeString,
+ SpecificTypeDouble,
+ };
+ SpecificTypes m_type;
+
+ String m_string;
+ double m_double;
+
+ friend v8::Local<v8::Value> toV8(const StringOrDouble&, v8::Local<v8::Object>, v8::Isolate*);
+};
+
+class V8StringOrDouble final {
+public:
+ static void toImpl(v8::Isolate*, v8::Local<v8::Value>, StringOrDouble&, ExceptionState&);
+};
+
+v8::Local<v8::Value> toV8(const StringOrDouble&, v8::Local<v8::Object>, v8::Isolate*);
+
+template <class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, StringOrDouble& impl)
+{
+ v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+template <>
+struct NativeValueTraits<StringOrDouble> {
+ static StringOrDouble nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&);
+};
+
+} // namespace blink
+
+#endif // StringOrDouble_h

Powered by Google App Engine
This is Rietveld 408576698