| 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 "BooleanOrString.h" | 7 #include "BooleanOrString.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ToV8.h" | 9 #include "bindings/core/v8/ToV8.h" |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 71 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 if (v8Value->IsBoolean()) { | 74 if (v8Value->IsBoolean()) { |
| 75 impl.setBoolean(v8Value.As<v8::Boolean>()->Value()); | 75 impl.setBoolean(v8Value.As<v8::Boolean>()->Value()); |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 | 78 |
| 79 { | 79 { |
| 80 V8StringResource<> cppValue = v8Value; | 80 V8StringResource<> cppValue = v8Value; |
| 81 if (!cppValue.prepare(exceptionState)) | 81 if (!cppValue.prepare(exceptionState)) { |
| 82 return; | 82 return; |
| 83 } |
| 83 impl.setString(cppValue); | 84 impl.setString(cppValue); |
| 84 return; | 85 return; |
| 85 } | 86 } |
| 86 | 87 |
| 87 } | 88 } |
| 88 | 89 |
| 89 v8::Local<v8::Value> toV8(const BooleanOrString& impl, v8::Local<v8::Object> cre
ationContext, v8::Isolate* isolate) | 90 v8::Local<v8::Value> toV8(const BooleanOrString& impl, v8::Local<v8::Object> cre
ationContext, v8::Isolate* isolate) |
| 90 { | 91 { |
| 91 switch (impl.m_type) { | 92 switch (impl.m_type) { |
| 92 case BooleanOrString::SpecificTypeNone: | 93 case BooleanOrString::SpecificTypeNone: |
| 93 return v8::Null(isolate); | 94 return v8::Null(isolate); |
| 94 case BooleanOrString::SpecificTypeBoolean: | 95 case BooleanOrString::SpecificTypeBoolean: |
| 95 return v8Boolean(impl.getAsBoolean(), isolate); | 96 return v8Boolean(impl.getAsBoolean(), isolate); |
| 96 case BooleanOrString::SpecificTypeString: | 97 case BooleanOrString::SpecificTypeString: |
| 97 return v8String(isolate, impl.getAsString()); | 98 return v8String(isolate, impl.getAsString()); |
| 98 default: | 99 default: |
| 99 ASSERT_NOT_REACHED(); | 100 ASSERT_NOT_REACHED(); |
| 100 } | 101 } |
| 101 return v8::Local<v8::Value>(); | 102 return v8::Local<v8::Value>(); |
| 102 } | 103 } |
| 103 | 104 |
| 104 BooleanOrString NativeValueTraits<BooleanOrString>::nativeValue(v8::Isolate* iso
late, v8::Local<v8::Value> value, ExceptionState& exceptionState) | 105 BooleanOrString NativeValueTraits<BooleanOrString>::nativeValue(v8::Isolate* iso
late, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
| 105 { | 106 { |
| 106 BooleanOrString impl; | 107 BooleanOrString impl; |
| 107 V8BooleanOrString::toImpl(isolate, value, impl, UnionTypeConversionMode::Not
Nullable, exceptionState); | 108 V8BooleanOrString::toImpl(isolate, value, impl, UnionTypeConversionMode::Not
Nullable, exceptionState); |
| 108 return impl; | 109 return impl; |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |