OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #ifndef UnionTypeModules_h | 7 #ifndef UnionTypeModules_h |
8 #define UnionTypeModules_h | 8 #define UnionTypeModules_h |
9 | 9 |
10 #include "bindings/core/v8/Dictionary.h" | 10 #include "bindings/core/v8/Dictionary.h" |
11 #include "bindings/core/v8/ExceptionState.h" | 11 #include "bindings/core/v8/ExceptionState.h" |
12 #include "bindings/core/v8/UnionTypesCore.h" | 12 #include "bindings/core/v8/UnionTypesCore.h" |
13 #include "bindings/core/v8/V8Binding.h" | 13 #include "bindings/core/v8/V8Binding.h" |
14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 | 18 |
19 class BooleanOrString final { | 19 class BooleanOrString final { |
20 ALLOW_ONLY_INLINE_ALLOCATION(); | 20 ALLOW_ONLY_INLINE_ALLOCATION(); |
21 public: | 21 public: |
22 BooleanOrString(); | 22 BooleanOrString(); |
23 bool isNull() const { return m_type == SpecificTypeNone; } | 23 bool isNull() const { return m_type == SpecificTypeNone; } |
24 | 24 |
25 bool isBoolean() const { return m_type == SpecificTypeBoolean; } | 25 bool isBoolean() const { return m_type == SpecificTypeBoolean; } |
26 bool getAsBoolean() const; | 26 bool getAsBoolean() const; |
27 void setBoolean(bool); | 27 void setBoolean(bool); |
| 28 static BooleanOrString fromBoolean(bool); |
28 | 29 |
29 bool isString() const { return m_type == SpecificTypeString; } | 30 bool isString() const { return m_type == SpecificTypeString; } |
30 String getAsString() const; | 31 String getAsString() const; |
31 void setString(String); | 32 void setString(String); |
| 33 static BooleanOrString fromString(String); |
32 | 34 |
33 private: | 35 private: |
34 enum SpecificTypes { | 36 enum SpecificTypes { |
35 SpecificTypeNone, | 37 SpecificTypeNone, |
36 SpecificTypeBoolean, | 38 SpecificTypeBoolean, |
37 SpecificTypeString, | 39 SpecificTypeString, |
38 }; | 40 }; |
39 SpecificTypes m_type; | 41 SpecificTypes m_type; |
40 | 42 |
41 bool m_boolean; | 43 bool m_boolean; |
(...skipping 16 matching lines...) Expand all Loading... |
58 } | 60 } |
59 | 61 |
60 template <> | 62 template <> |
61 struct NativeValueTraits<BooleanOrString> { | 63 struct NativeValueTraits<BooleanOrString> { |
62 static BooleanOrString nativeValue(const v8::Local<v8::Value>&, v8::Isolate*
, ExceptionState&); | 64 static BooleanOrString nativeValue(const v8::Local<v8::Value>&, v8::Isolate*
, ExceptionState&); |
63 }; | 65 }; |
64 | 66 |
65 } // namespace blink | 67 } // namespace blink |
66 | 68 |
67 #endif // UnionTypeModules_h | 69 #endif // UnionTypeModules_h |
OLD | NEW |