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. | 5 // This file has been auto-generated by code_generator_v8.py. |
6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
7 | 7 |
8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
9 // third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 visitor->Trace(m_elementSequence); | 67 visitor->Trace(m_elementSequence); |
68 } | 68 } |
69 | 69 |
70 void V8BooleanOrElementSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Valu
e> v8Value, BooleanOrElementSequence& impl, UnionTypeConversionMode conversionMo
de, ExceptionState& exceptionState) { | 70 void V8BooleanOrElementSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Valu
e> v8Value, BooleanOrElementSequence& impl, UnionTypeConversionMode conversionMo
de, ExceptionState& exceptionState) { |
71 if (v8Value.IsEmpty()) | 71 if (v8Value.IsEmpty()) |
72 return; | 72 return; |
73 | 73 |
74 if (conversionMode == UnionTypeConversionMode::kNullable && IsUndefinedOrNull(
v8Value)) | 74 if (conversionMode == UnionTypeConversionMode::kNullable && IsUndefinedOrNull(
v8Value)) |
75 return; | 75 return; |
76 | 76 |
77 if (v8Value->IsArray()) { | 77 if (IsV8Sequence(isolate, v8Value, exceptionState)) { |
78 HeapVector<Member<Element>> cppValue = ToMemberNativeArray<Element>(v8Value,
0, isolate, exceptionState); | 78 HeapVector<Member<Element>> cppValue = NativeValueTraits<IDLSequence<Element
>>::NativeValue(isolate, v8Value, exceptionState); |
79 if (exceptionState.HadException()) | 79 if (exceptionState.HadException()) |
80 return; | 80 return; |
81 impl.setElementSequence(cppValue); | 81 impl.setElementSequence(cppValue); |
82 return; | 82 return; |
83 } | 83 } |
84 | 84 |
85 if (v8Value->IsBoolean()) { | 85 if (v8Value->IsBoolean()) { |
86 impl.setBoolean(v8Value.As<v8::Boolean>()->Value()); | 86 impl.setBoolean(v8Value.As<v8::Boolean>()->Value()); |
87 return; | 87 return; |
88 } | 88 } |
(...skipping 18 matching lines...) Expand all Loading... |
107 return v8::Local<v8::Value>(); | 107 return v8::Local<v8::Value>(); |
108 } | 108 } |
109 | 109 |
110 BooleanOrElementSequence NativeValueTraits<BooleanOrElementSequence>::NativeValu
e(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionSta
te) { | 110 BooleanOrElementSequence NativeValueTraits<BooleanOrElementSequence>::NativeValu
e(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionSta
te) { |
111 BooleanOrElementSequence impl; | 111 BooleanOrElementSequence impl; |
112 V8BooleanOrElementSequence::toImpl(isolate, value, impl, UnionTypeConversionMo
de::kNotNullable, exceptionState); | 112 V8BooleanOrElementSequence::toImpl(isolate, value, impl, UnionTypeConversionMo
de::kNotNullable, exceptionState); |
113 return impl; | 113 return impl; |
114 } | 114 } |
115 | 115 |
116 } // namespace blink | 116 } // namespace blink |
OLD | NEW |