| 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 #include "config.h" | 7 #include "config.h" |
| 8 #include "bindings/modules/v8/UnionTypesModules.h" | 8 #include "bindings/modules/v8/UnionTypesModules.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return m_boolean; | 21 return m_boolean; |
| 22 } | 22 } |
| 23 | 23 |
| 24 void BooleanOrString::setBoolean(bool value) | 24 void BooleanOrString::setBoolean(bool value) |
| 25 { | 25 { |
| 26 ASSERT(isNull()); | 26 ASSERT(isNull()); |
| 27 m_boolean = value; | 27 m_boolean = value; |
| 28 m_type = SpecificTypeBoolean; | 28 m_type = SpecificTypeBoolean; |
| 29 } | 29 } |
| 30 | 30 |
| 31 BooleanOrString BooleanOrString::fromBoolean(bool value) |
| 32 { |
| 33 BooleanOrString container; |
| 34 container.setBoolean(value); |
| 35 return container; |
| 36 } |
| 37 |
| 31 String BooleanOrString::getAsString() const | 38 String BooleanOrString::getAsString() const |
| 32 { | 39 { |
| 33 ASSERT(isString()); | 40 ASSERT(isString()); |
| 34 return m_string; | 41 return m_string; |
| 35 } | 42 } |
| 36 | 43 |
| 37 void BooleanOrString::setString(String value) | 44 void BooleanOrString::setString(String value) |
| 38 { | 45 { |
| 39 ASSERT(isNull()); | 46 ASSERT(isNull()); |
| 40 m_string = value; | 47 m_string = value; |
| 41 m_type = SpecificTypeString; | 48 m_type = SpecificTypeString; |
| 42 } | 49 } |
| 43 | 50 |
| 51 BooleanOrString BooleanOrString::fromString(String value) |
| 52 { |
| 53 BooleanOrString container; |
| 54 container.setString(value); |
| 55 return container; |
| 56 } |
| 57 |
| 44 void V8BooleanOrString::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Valu
e, BooleanOrString& impl, ExceptionState& exceptionState) | 58 void V8BooleanOrString::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Valu
e, BooleanOrString& impl, ExceptionState& exceptionState) |
| 45 { | 59 { |
| 46 if (v8Value.IsEmpty()) | 60 if (v8Value.IsEmpty()) |
| 47 return; | 61 return; |
| 48 | 62 |
| 49 if (v8Value->IsBoolean()) { | 63 if (v8Value->IsBoolean()) { |
| 50 impl.setBoolean(v8Value->ToBoolean()->Value()); | 64 impl.setBoolean(v8Value->ToBoolean()->Value()); |
| 51 return; | 65 return; |
| 52 } | 66 } |
| 53 | 67 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 75 } | 89 } |
| 76 | 90 |
| 77 BooleanOrString NativeValueTraits<BooleanOrString>::nativeValue(const v8::Local<
v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) | 91 BooleanOrString NativeValueTraits<BooleanOrString>::nativeValue(const v8::Local<
v8::Value>& value, v8::Isolate* isolate, ExceptionState& exceptionState) |
| 78 { | 92 { |
| 79 BooleanOrString impl; | 93 BooleanOrString impl; |
| 80 V8BooleanOrString::toImpl(isolate, value, impl, exceptionState); | 94 V8BooleanOrString::toImpl(isolate, value, impl, exceptionState); |
| 81 return impl; | 95 return impl; |
| 82 } | 96 } |
| 83 | 97 |
| 84 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |