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

Side by Side Diff: Source/bindings/tests/results/core/UnrestrictedDoubleOrString.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #ifndef UnrestrictedDoubleOrString_h
8 #define UnrestrictedDoubleOrString_h
9
10 #include "bindings/core/v8/Dictionary.h"
11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/V8Binding.h"
13 #include "platform/heap/Handle.h"
14
15 namespace blink {
16
17 class UnrestrictedDoubleOrString final {
18 ALLOW_ONLY_INLINE_ALLOCATION();
19 public:
20 UnrestrictedDoubleOrString();
21 bool isNull() const { return m_type == SpecificTypeNone; }
22
23 bool isUnrestrictedDouble() const { return m_type == SpecificTypeUnrestricte dDouble; }
24 double getAsUnrestrictedDouble() const;
25 void setUnrestrictedDouble(double);
26 static UnrestrictedDoubleOrString fromUnrestrictedDouble(double);
27
28 bool isString() const { return m_type == SpecificTypeString; }
29 String getAsString() const;
30 void setString(String);
31 static UnrestrictedDoubleOrString fromString(String);
32
33 private:
34 enum SpecificTypes {
35 SpecificTypeNone,
36 SpecificTypeUnrestrictedDouble,
37 SpecificTypeString,
38 };
39 SpecificTypes m_type;
40
41 double m_unrestrictedDouble;
42 String m_string;
43
44 friend v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString&, v8::Loca l<v8::Object>, v8::Isolate*);
45 };
46
47 class V8UnrestrictedDoubleOrString final {
48 public:
49 static void toImpl(v8::Isolate*, v8::Local<v8::Value>, UnrestrictedDoubleOrS tring&, ExceptionState&);
50 };
51
52 v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString&, v8::Local<v8::Objec t>, v8::Isolate*);
53
54 template <class CallbackInfo>
55 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, UnrestrictedDoubl eOrString& impl)
56 {
57 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
58 }
59
60 template <>
61 struct NativeValueTraits<UnrestrictedDoubleOrString> {
62 static UnrestrictedDoubleOrString nativeValue(const v8::Local<v8::Value>&, v 8::Isolate*, ExceptionState&);
63 };
64
65 } // namespace blink
66
67 #endif // UnrestrictedDoubleOrString_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698