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 "bindings/core/v8/UnionTypesCore.h" | 7 #include "bindings/core/v8/UnionTypesCore.h" |
8 | 8 |
9 #include "bindings/core/v8/Dictionary.h" | 9 #include "bindings/core/v8/Dictionary.h" |
10 #include "bindings/core/v8/UnionTypesCore.h" | 10 #include "bindings/core/v8/UnionTypesCore.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 void V8ArrayBufferOrArrayBufferViewOrDictionary::toImpl(v8::Isolate* isolate, v8
::Local<v8::Value> v8Value, ArrayBufferOrArrayBufferViewOrDictionary& impl, Unio
nTypeConversionMode conversionMode, ExceptionState& exceptionState) | 107 void V8ArrayBufferOrArrayBufferViewOrDictionary::toImpl(v8::Isolate* isolate, v8
::Local<v8::Value> v8Value, ArrayBufferOrArrayBufferViewOrDictionary& impl, Unio
nTypeConversionMode conversionMode, ExceptionState& exceptionState) |
108 { | 108 { |
109 if (v8Value.IsEmpty()) | 109 if (v8Value.IsEmpty()) |
110 return; | 110 return; |
111 | 111 |
112 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 112 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
113 return; | 113 return; |
114 | 114 |
115 if (V8ArrayBuffer::hasInstance(v8Value, isolate)) { | 115 if (V8ArrayBuffer::hasInstance(v8Value, isolate)) { |
116 RawPtr<TestArrayBuffer> cppValue = V8ArrayBuffer::toImpl(v8::Local<v8::O
bject>::Cast(v8Value)); | 116 TestArrayBuffer* cppValue = V8ArrayBuffer::toImpl(v8::Local<v8::Object>:
:Cast(v8Value)); |
117 impl.setArrayBuffer(cppValue); | 117 impl.setArrayBuffer(cppValue); |
118 return; | 118 return; |
119 } | 119 } |
120 | 120 |
121 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { | 121 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { |
122 RawPtr<TestArrayBufferView> cppValue = V8ArrayBufferView::toImpl(v8::Loc
al<v8::Object>::Cast(v8Value)); | 122 TestArrayBufferView* cppValue = V8ArrayBufferView::toImpl(v8::Local<v8::
Object>::Cast(v8Value)); |
123 impl.setArrayBufferView(cppValue); | 123 impl.setArrayBufferView(cppValue); |
124 return; | 124 return; |
125 } | 125 } |
126 | 126 |
127 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { | 127 if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { |
128 Dictionary cppValue = Dictionary(v8Value, isolate, exceptionState); | 128 Dictionary cppValue = Dictionary(v8Value, isolate, exceptionState); |
129 if (exceptionState.hadException()) | 129 if (exceptionState.hadException()) |
130 return; | 130 return; |
131 impl.setDictionary(cppValue); | 131 impl.setDictionary(cppValue); |
132 return; | 132 return; |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 void V8NodeOrNodeList::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, NodeOrNodeList& impl, UnionTypeConversionMode conversionMode, ExceptionState&
exceptionState) | 557 void V8NodeOrNodeList::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
, NodeOrNodeList& impl, UnionTypeConversionMode conversionMode, ExceptionState&
exceptionState) |
558 { | 558 { |
559 if (v8Value.IsEmpty()) | 559 if (v8Value.IsEmpty()) |
560 return; | 560 return; |
561 | 561 |
562 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 562 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
563 return; | 563 return; |
564 | 564 |
565 if (V8Node::hasInstance(v8Value, isolate)) { | 565 if (V8Node::hasInstance(v8Value, isolate)) { |
566 RawPtr<Node> cppValue = V8Node::toImpl(v8::Local<v8::Object>::Cast(v8Val
ue)); | 566 Node* cppValue = V8Node::toImpl(v8::Local<v8::Object>::Cast(v8Value)); |
567 impl.setNode(cppValue); | 567 impl.setNode(cppValue); |
568 return; | 568 return; |
569 } | 569 } |
570 | 570 |
571 if (V8NodeList::hasInstance(v8Value, isolate)) { | 571 if (V8NodeList::hasInstance(v8Value, isolate)) { |
572 RawPtr<NodeList> cppValue = V8NodeList::toImpl(v8::Local<v8::Object>::Ca
st(v8Value)); | 572 NodeList* cppValue = V8NodeList::toImpl(v8::Local<v8::Object>::Cast(v8Va
lue)); |
573 impl.setNodeList(cppValue); | 573 impl.setNodeList(cppValue); |
574 return; | 574 return; |
575 } | 575 } |
576 | 576 |
577 exceptionState.throwTypeError("The provided value is not of type '(Node or N
odeList)'"); | 577 exceptionState.throwTypeError("The provided value is not of type '(Node or N
odeList)'"); |
578 } | 578 } |
579 | 579 |
580 v8::Local<v8::Value> toV8(const NodeOrNodeList& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) | 580 v8::Local<v8::Value> toV8(const NodeOrNodeList& impl, v8::Local<v8::Object> crea
tionContext, v8::Isolate* isolate) |
581 { | 581 { |
582 switch (impl.m_type) { | 582 switch (impl.m_type) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 676 |
677 void V8StringOrArrayBufferOrArrayBufferView::toImpl(v8::Isolate* isolate, v8::Lo
cal<v8::Value> v8Value, StringOrArrayBufferOrArrayBufferView& impl, UnionTypeCon
versionMode conversionMode, ExceptionState& exceptionState) | 677 void V8StringOrArrayBufferOrArrayBufferView::toImpl(v8::Isolate* isolate, v8::Lo
cal<v8::Value> v8Value, StringOrArrayBufferOrArrayBufferView& impl, UnionTypeCon
versionMode conversionMode, ExceptionState& exceptionState) |
678 { | 678 { |
679 if (v8Value.IsEmpty()) | 679 if (v8Value.IsEmpty()) |
680 return; | 680 return; |
681 | 681 |
682 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 682 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
683 return; | 683 return; |
684 | 684 |
685 if (V8ArrayBuffer::hasInstance(v8Value, isolate)) { | 685 if (V8ArrayBuffer::hasInstance(v8Value, isolate)) { |
686 RawPtr<TestArrayBuffer> cppValue = V8ArrayBuffer::toImpl(v8::Local<v8::O
bject>::Cast(v8Value)); | 686 TestArrayBuffer* cppValue = V8ArrayBuffer::toImpl(v8::Local<v8::Object>:
:Cast(v8Value)); |
687 impl.setArrayBuffer(cppValue); | 687 impl.setArrayBuffer(cppValue); |
688 return; | 688 return; |
689 } | 689 } |
690 | 690 |
691 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { | 691 if (V8ArrayBufferView::hasInstance(v8Value, isolate)) { |
692 RawPtr<TestArrayBufferView> cppValue = V8ArrayBufferView::toImpl(v8::Loc
al<v8::Object>::Cast(v8Value)); | 692 TestArrayBufferView* cppValue = V8ArrayBufferView::toImpl(v8::Local<v8::
Object>::Cast(v8Value)); |
693 impl.setArrayBufferView(cppValue); | 693 impl.setArrayBufferView(cppValue); |
694 return; | 694 return; |
695 } | 695 } |
696 | 696 |
697 { | 697 { |
698 V8StringResource<> cppValue = v8Value; | 698 V8StringResource<> cppValue = v8Value; |
699 if (!cppValue.prepare(exceptionState)) | 699 if (!cppValue.prepare(exceptionState)) |
700 return; | 700 return; |
701 impl.setString(cppValue); | 701 impl.setString(cppValue); |
702 return; | 702 return; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 TestEnumOrDouble impl; | 1048 TestEnumOrDouble impl; |
1049 V8TestEnumOrDouble::toImpl(isolate, value, impl, UnionTypeConversionMode::No
tNullable, exceptionState); | 1049 V8TestEnumOrDouble::toImpl(isolate, value, impl, UnionTypeConversionMode::No
tNullable, exceptionState); |
1050 return impl; | 1050 return impl; |
1051 } | 1051 } |
1052 | 1052 |
1053 TestInterface2OrUint8Array::TestInterface2OrUint8Array() | 1053 TestInterface2OrUint8Array::TestInterface2OrUint8Array() |
1054 : m_type(SpecificTypeNone) | 1054 : m_type(SpecificTypeNone) |
1055 { | 1055 { |
1056 } | 1056 } |
1057 | 1057 |
1058 PassRefPtr<TestInterface2> TestInterface2OrUint8Array::getAsTestInterface2() con
st | 1058 TestInterface2* TestInterface2OrUint8Array::getAsTestInterface2() const |
1059 { | 1059 { |
1060 ASSERT(isTestInterface2()); | 1060 ASSERT(isTestInterface2()); |
1061 return m_testInterface2; | 1061 return m_testInterface2; |
1062 } | 1062 } |
1063 | 1063 |
1064 void TestInterface2OrUint8Array::setTestInterface2(PassRefPtr<TestInterface2> va
lue) | 1064 void TestInterface2OrUint8Array::setTestInterface2(TestInterface2* value) |
1065 { | 1065 { |
1066 ASSERT(isNull()); | 1066 ASSERT(isNull()); |
1067 m_testInterface2 = value; | 1067 m_testInterface2 = value; |
1068 m_type = SpecificTypeTestInterface2; | 1068 m_type = SpecificTypeTestInterface2; |
1069 } | 1069 } |
1070 | 1070 |
1071 TestInterface2OrUint8Array TestInterface2OrUint8Array::fromTestInterface2(PassRe
fPtr<TestInterface2> value) | 1071 TestInterface2OrUint8Array TestInterface2OrUint8Array::fromTestInterface2(TestIn
terface2* value) |
1072 { | 1072 { |
1073 TestInterface2OrUint8Array container; | 1073 TestInterface2OrUint8Array container; |
1074 container.setTestInterface2(value); | 1074 container.setTestInterface2(value); |
1075 return container; | 1075 return container; |
1076 } | 1076 } |
1077 | 1077 |
1078 DOMUint8Array* TestInterface2OrUint8Array::getAsUint8Array() const | 1078 DOMUint8Array* TestInterface2OrUint8Array::getAsUint8Array() const |
1079 { | 1079 { |
1080 ASSERT(isUint8Array()); | 1080 ASSERT(isUint8Array()); |
1081 return m_uint8Array; | 1081 return m_uint8Array; |
(...skipping 12 matching lines...) Expand all Loading... |
1094 container.setUint8Array(value); | 1094 container.setUint8Array(value); |
1095 return container; | 1095 return container; |
1096 } | 1096 } |
1097 | 1097 |
1098 TestInterface2OrUint8Array::TestInterface2OrUint8Array(const TestInterface2OrUin
t8Array&) = default; | 1098 TestInterface2OrUint8Array::TestInterface2OrUint8Array(const TestInterface2OrUin
t8Array&) = default; |
1099 TestInterface2OrUint8Array::~TestInterface2OrUint8Array() = default; | 1099 TestInterface2OrUint8Array::~TestInterface2OrUint8Array() = default; |
1100 TestInterface2OrUint8Array& TestInterface2OrUint8Array::operator=(const TestInte
rface2OrUint8Array&) = default; | 1100 TestInterface2OrUint8Array& TestInterface2OrUint8Array::operator=(const TestInte
rface2OrUint8Array&) = default; |
1101 | 1101 |
1102 DEFINE_TRACE(TestInterface2OrUint8Array) | 1102 DEFINE_TRACE(TestInterface2OrUint8Array) |
1103 { | 1103 { |
| 1104 visitor->trace(m_testInterface2); |
1104 visitor->trace(m_uint8Array); | 1105 visitor->trace(m_uint8Array); |
1105 } | 1106 } |
1106 | 1107 |
1107 void V8TestInterface2OrUint8Array::toImpl(v8::Isolate* isolate, v8::Local<v8::Va
lue> v8Value, TestInterface2OrUint8Array& impl, UnionTypeConversionMode conversi
onMode, ExceptionState& exceptionState) | 1108 void V8TestInterface2OrUint8Array::toImpl(v8::Isolate* isolate, v8::Local<v8::Va
lue> v8Value, TestInterface2OrUint8Array& impl, UnionTypeConversionMode conversi
onMode, ExceptionState& exceptionState) |
1108 { | 1109 { |
1109 if (v8Value.IsEmpty()) | 1110 if (v8Value.IsEmpty()) |
1110 return; | 1111 return; |
1111 | 1112 |
1112 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 1113 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
1113 return; | 1114 return; |
1114 | 1115 |
1115 if (V8TestInterface2::hasInstance(v8Value, isolate)) { | 1116 if (V8TestInterface2::hasInstance(v8Value, isolate)) { |
1116 RefPtr<TestInterface2> cppValue = V8TestInterface2::toImpl(v8::Local<v8:
:Object>::Cast(v8Value)); | 1117 TestInterface2* cppValue = V8TestInterface2::toImpl(v8::Local<v8::Object
>::Cast(v8Value)); |
1117 impl.setTestInterface2(cppValue); | 1118 impl.setTestInterface2(cppValue); |
1118 return; | 1119 return; |
1119 } | 1120 } |
1120 | 1121 |
1121 if (V8Uint8Array::hasInstance(v8Value, isolate)) { | 1122 if (V8Uint8Array::hasInstance(v8Value, isolate)) { |
1122 RawPtr<DOMUint8Array> cppValue = V8Uint8Array::toImpl(v8::Local<v8::Obje
ct>::Cast(v8Value)); | 1123 DOMUint8Array* cppValue = V8Uint8Array::toImpl(v8::Local<v8::Object>::Ca
st(v8Value)); |
1123 impl.setUint8Array(cppValue); | 1124 impl.setUint8Array(cppValue); |
1124 return; | 1125 return; |
1125 } | 1126 } |
1126 | 1127 |
1127 exceptionState.throwTypeError("The provided value is not of type '(TestInter
face2 or Uint8Array)'"); | 1128 exceptionState.throwTypeError("The provided value is not of type '(TestInter
face2 or Uint8Array)'"); |
1128 } | 1129 } |
1129 | 1130 |
1130 v8::Local<v8::Value> toV8(const TestInterface2OrUint8Array& impl, v8::Local<v8::
Object> creationContext, v8::Isolate* isolate) | 1131 v8::Local<v8::Value> toV8(const TestInterface2OrUint8Array& impl, v8::Local<v8::
Object> creationContext, v8::Isolate* isolate) |
1131 { | 1132 { |
1132 switch (impl.m_type) { | 1133 switch (impl.m_type) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 | 1206 |
1206 void V8TestInterfaceGarbageCollectedOrString::toImpl(v8::Isolate* isolate, v8::L
ocal<v8::Value> v8Value, TestInterfaceGarbageCollectedOrString& impl, UnionTypeC
onversionMode conversionMode, ExceptionState& exceptionState) | 1207 void V8TestInterfaceGarbageCollectedOrString::toImpl(v8::Isolate* isolate, v8::L
ocal<v8::Value> v8Value, TestInterfaceGarbageCollectedOrString& impl, UnionTypeC
onversionMode conversionMode, ExceptionState& exceptionState) |
1207 { | 1208 { |
1208 if (v8Value.IsEmpty()) | 1209 if (v8Value.IsEmpty()) |
1209 return; | 1210 return; |
1210 | 1211 |
1211 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 1212 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
1212 return; | 1213 return; |
1213 | 1214 |
1214 if (V8TestInterfaceGarbageCollected::hasInstance(v8Value, isolate)) { | 1215 if (V8TestInterfaceGarbageCollected::hasInstance(v8Value, isolate)) { |
1215 RawPtr<TestInterfaceGarbageCollected> cppValue = V8TestInterfaceGarbageC
ollected::toImpl(v8::Local<v8::Object>::Cast(v8Value)); | 1216 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollecte
d::toImpl(v8::Local<v8::Object>::Cast(v8Value)); |
1216 impl.setTestInterfaceGarbageCollected(cppValue); | 1217 impl.setTestInterfaceGarbageCollected(cppValue); |
1217 return; | 1218 return; |
1218 } | 1219 } |
1219 | 1220 |
1220 { | 1221 { |
1221 V8StringResource<> cppValue = v8Value; | 1222 V8StringResource<> cppValue = v8Value; |
1222 if (!cppValue.prepare(exceptionState)) | 1223 if (!cppValue.prepare(exceptionState)) |
1223 return; | 1224 return; |
1224 impl.setString(cppValue); | 1225 impl.setString(cppValue); |
1225 return; | 1226 return; |
(...skipping 21 matching lines...) Expand all Loading... |
1247 TestInterfaceGarbageCollectedOrString impl; | 1248 TestInterfaceGarbageCollectedOrString impl; |
1248 V8TestInterfaceGarbageCollectedOrString::toImpl(isolate, value, impl, UnionT
ypeConversionMode::NotNullable, exceptionState); | 1249 V8TestInterfaceGarbageCollectedOrString::toImpl(isolate, value, impl, UnionT
ypeConversionMode::NotNullable, exceptionState); |
1249 return impl; | 1250 return impl; |
1250 } | 1251 } |
1251 | 1252 |
1252 TestInterfaceOrLong::TestInterfaceOrLong() | 1253 TestInterfaceOrLong::TestInterfaceOrLong() |
1253 : m_type(SpecificTypeNone) | 1254 : m_type(SpecificTypeNone) |
1254 { | 1255 { |
1255 } | 1256 } |
1256 | 1257 |
1257 PassRefPtr<TestInterfaceImplementation> TestInterfaceOrLong::getAsTestInterface(
) const | 1258 TestInterfaceImplementation* TestInterfaceOrLong::getAsTestInterface() const |
1258 { | 1259 { |
1259 ASSERT(isTestInterface()); | 1260 ASSERT(isTestInterface()); |
1260 return m_testInterface; | 1261 return m_testInterface; |
1261 } | 1262 } |
1262 | 1263 |
1263 void TestInterfaceOrLong::setTestInterface(PassRefPtr<TestInterfaceImplementatio
n> value) | 1264 void TestInterfaceOrLong::setTestInterface(TestInterfaceImplementation* value) |
1264 { | 1265 { |
1265 ASSERT(isNull()); | 1266 ASSERT(isNull()); |
1266 m_testInterface = value; | 1267 m_testInterface = value; |
1267 m_type = SpecificTypeTestInterface; | 1268 m_type = SpecificTypeTestInterface; |
1268 } | 1269 } |
1269 | 1270 |
1270 TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(PassRefPtr<TestInterf
aceImplementation> value) | 1271 TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(TestInterfaceImplemen
tation* value) |
1271 { | 1272 { |
1272 TestInterfaceOrLong container; | 1273 TestInterfaceOrLong container; |
1273 container.setTestInterface(value); | 1274 container.setTestInterface(value); |
1274 return container; | 1275 return container; |
1275 } | 1276 } |
1276 | 1277 |
1277 int TestInterfaceOrLong::getAsLong() const | 1278 int TestInterfaceOrLong::getAsLong() const |
1278 { | 1279 { |
1279 ASSERT(isLong()); | 1280 ASSERT(isLong()); |
1280 return m_long; | 1281 return m_long; |
(...skipping 12 matching lines...) Expand all Loading... |
1293 container.setLong(value); | 1294 container.setLong(value); |
1294 return container; | 1295 return container; |
1295 } | 1296 } |
1296 | 1297 |
1297 TestInterfaceOrLong::TestInterfaceOrLong(const TestInterfaceOrLong&) = default; | 1298 TestInterfaceOrLong::TestInterfaceOrLong(const TestInterfaceOrLong&) = default; |
1298 TestInterfaceOrLong::~TestInterfaceOrLong() = default; | 1299 TestInterfaceOrLong::~TestInterfaceOrLong() = default; |
1299 TestInterfaceOrLong& TestInterfaceOrLong::operator=(const TestInterfaceOrLong&)
= default; | 1300 TestInterfaceOrLong& TestInterfaceOrLong::operator=(const TestInterfaceOrLong&)
= default; |
1300 | 1301 |
1301 DEFINE_TRACE(TestInterfaceOrLong) | 1302 DEFINE_TRACE(TestInterfaceOrLong) |
1302 { | 1303 { |
| 1304 visitor->trace(m_testInterface); |
1303 } | 1305 } |
1304 | 1306 |
1305 void V8TestInterfaceOrLong::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8
Value, TestInterfaceOrLong& impl, UnionTypeConversionMode conversionMode, Except
ionState& exceptionState) | 1307 void V8TestInterfaceOrLong::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8
Value, TestInterfaceOrLong& impl, UnionTypeConversionMode conversionMode, Except
ionState& exceptionState) |
1306 { | 1308 { |
1307 if (v8Value.IsEmpty()) | 1309 if (v8Value.IsEmpty()) |
1308 return; | 1310 return; |
1309 | 1311 |
1310 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 1312 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
1311 return; | 1313 return; |
1312 | 1314 |
1313 if (V8TestInterface::hasInstance(v8Value, isolate)) { | 1315 if (V8TestInterface::hasInstance(v8Value, isolate)) { |
1314 RefPtr<TestInterfaceImplementation> cppValue = V8TestInterface::toImpl(v
8::Local<v8::Object>::Cast(v8Value)); | 1316 TestInterfaceImplementation* cppValue = V8TestInterface::toImpl(v8::Loca
l<v8::Object>::Cast(v8Value)); |
1315 impl.setTestInterface(cppValue); | 1317 impl.setTestInterface(cppValue); |
1316 return; | 1318 return; |
1317 } | 1319 } |
1318 | 1320 |
1319 if (v8Value->IsNumber()) { | 1321 if (v8Value->IsNumber()) { |
1320 int cppValue = toInt32(isolate, v8Value, NormalConversion, exceptionStat
e); | 1322 int cppValue = toInt32(isolate, v8Value, NormalConversion, exceptionStat
e); |
1321 if (exceptionState.hadException()) | 1323 if (exceptionState.hadException()) |
1322 return; | 1324 return; |
1323 impl.setLong(cppValue); | 1325 impl.setLong(cppValue); |
1324 return; | 1326 return; |
(...skipping 29 matching lines...) Expand all Loading... |
1354 TestInterfaceOrLong impl; | 1356 TestInterfaceOrLong impl; |
1355 V8TestInterfaceOrLong::toImpl(isolate, value, impl, UnionTypeConversionMode:
:NotNullable, exceptionState); | 1357 V8TestInterfaceOrLong::toImpl(isolate, value, impl, UnionTypeConversionMode:
:NotNullable, exceptionState); |
1356 return impl; | 1358 return impl; |
1357 } | 1359 } |
1358 | 1360 |
1359 TestInterfaceOrTestInterfaceEmpty::TestInterfaceOrTestInterfaceEmpty() | 1361 TestInterfaceOrTestInterfaceEmpty::TestInterfaceOrTestInterfaceEmpty() |
1360 : m_type(SpecificTypeNone) | 1362 : m_type(SpecificTypeNone) |
1361 { | 1363 { |
1362 } | 1364 } |
1363 | 1365 |
1364 PassRefPtr<TestInterfaceImplementation> TestInterfaceOrTestInterfaceEmpty::getAs
TestInterface() const | 1366 TestInterfaceImplementation* TestInterfaceOrTestInterfaceEmpty::getAsTestInterfa
ce() const |
1365 { | 1367 { |
1366 ASSERT(isTestInterface()); | 1368 ASSERT(isTestInterface()); |
1367 return m_testInterface; | 1369 return m_testInterface; |
1368 } | 1370 } |
1369 | 1371 |
1370 void TestInterfaceOrTestInterfaceEmpty::setTestInterface(PassRefPtr<TestInterfac
eImplementation> value) | 1372 void TestInterfaceOrTestInterfaceEmpty::setTestInterface(TestInterfaceImplementa
tion* value) |
1371 { | 1373 { |
1372 ASSERT(isNull()); | 1374 ASSERT(isNull()); |
1373 m_testInterface = value; | 1375 m_testInterface = value; |
1374 m_type = SpecificTypeTestInterface; | 1376 m_type = SpecificTypeTestInterface; |
1375 } | 1377 } |
1376 | 1378 |
1377 TestInterfaceOrTestInterfaceEmpty TestInterfaceOrTestInterfaceEmpty::fromTestInt
erface(PassRefPtr<TestInterfaceImplementation> value) | 1379 TestInterfaceOrTestInterfaceEmpty TestInterfaceOrTestInterfaceEmpty::fromTestInt
erface(TestInterfaceImplementation* value) |
1378 { | 1380 { |
1379 TestInterfaceOrTestInterfaceEmpty container; | 1381 TestInterfaceOrTestInterfaceEmpty container; |
1380 container.setTestInterface(value); | 1382 container.setTestInterface(value); |
1381 return container; | 1383 return container; |
1382 } | 1384 } |
1383 | 1385 |
1384 PassRefPtr<TestInterfaceEmpty> TestInterfaceOrTestInterfaceEmpty::getAsTestInter
faceEmpty() const | 1386 TestInterfaceEmpty* TestInterfaceOrTestInterfaceEmpty::getAsTestInterfaceEmpty()
const |
1385 { | 1387 { |
1386 ASSERT(isTestInterfaceEmpty()); | 1388 ASSERT(isTestInterfaceEmpty()); |
1387 return m_testInterfaceEmpty; | 1389 return m_testInterfaceEmpty; |
1388 } | 1390 } |
1389 | 1391 |
1390 void TestInterfaceOrTestInterfaceEmpty::setTestInterfaceEmpty(PassRefPtr<TestInt
erfaceEmpty> value) | 1392 void TestInterfaceOrTestInterfaceEmpty::setTestInterfaceEmpty(TestInterfaceEmpty
* value) |
1391 { | 1393 { |
1392 ASSERT(isNull()); | 1394 ASSERT(isNull()); |
1393 m_testInterfaceEmpty = value; | 1395 m_testInterfaceEmpty = value; |
1394 m_type = SpecificTypeTestInterfaceEmpty; | 1396 m_type = SpecificTypeTestInterfaceEmpty; |
1395 } | 1397 } |
1396 | 1398 |
1397 TestInterfaceOrTestInterfaceEmpty TestInterfaceOrTestInterfaceEmpty::fromTestInt
erfaceEmpty(PassRefPtr<TestInterfaceEmpty> value) | 1399 TestInterfaceOrTestInterfaceEmpty TestInterfaceOrTestInterfaceEmpty::fromTestInt
erfaceEmpty(TestInterfaceEmpty* value) |
1398 { | 1400 { |
1399 TestInterfaceOrTestInterfaceEmpty container; | 1401 TestInterfaceOrTestInterfaceEmpty container; |
1400 container.setTestInterfaceEmpty(value); | 1402 container.setTestInterfaceEmpty(value); |
1401 return container; | 1403 return container; |
1402 } | 1404 } |
1403 | 1405 |
1404 TestInterfaceOrTestInterfaceEmpty::TestInterfaceOrTestInterfaceEmpty(const TestI
nterfaceOrTestInterfaceEmpty&) = default; | 1406 TestInterfaceOrTestInterfaceEmpty::TestInterfaceOrTestInterfaceEmpty(const TestI
nterfaceOrTestInterfaceEmpty&) = default; |
1405 TestInterfaceOrTestInterfaceEmpty::~TestInterfaceOrTestInterfaceEmpty() = defaul
t; | 1407 TestInterfaceOrTestInterfaceEmpty::~TestInterfaceOrTestInterfaceEmpty() = defaul
t; |
1406 TestInterfaceOrTestInterfaceEmpty& TestInterfaceOrTestInterfaceEmpty::operator=(
const TestInterfaceOrTestInterfaceEmpty&) = default; | 1408 TestInterfaceOrTestInterfaceEmpty& TestInterfaceOrTestInterfaceEmpty::operator=(
const TestInterfaceOrTestInterfaceEmpty&) = default; |
1407 | 1409 |
1408 DEFINE_TRACE(TestInterfaceOrTestInterfaceEmpty) | 1410 DEFINE_TRACE(TestInterfaceOrTestInterfaceEmpty) |
1409 { | 1411 { |
| 1412 visitor->trace(m_testInterface); |
| 1413 visitor->trace(m_testInterfaceEmpty); |
1410 } | 1414 } |
1411 | 1415 |
1412 void V8TestInterfaceOrTestInterfaceEmpty::toImpl(v8::Isolate* isolate, v8::Local
<v8::Value> v8Value, TestInterfaceOrTestInterfaceEmpty& impl, UnionTypeConversio
nMode conversionMode, ExceptionState& exceptionState) | 1416 void V8TestInterfaceOrTestInterfaceEmpty::toImpl(v8::Isolate* isolate, v8::Local
<v8::Value> v8Value, TestInterfaceOrTestInterfaceEmpty& impl, UnionTypeConversio
nMode conversionMode, ExceptionState& exceptionState) |
1413 { | 1417 { |
1414 if (v8Value.IsEmpty()) | 1418 if (v8Value.IsEmpty()) |
1415 return; | 1419 return; |
1416 | 1420 |
1417 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) | 1421 if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull
(v8Value)) |
1418 return; | 1422 return; |
1419 | 1423 |
1420 if (V8TestInterface::hasInstance(v8Value, isolate)) { | 1424 if (V8TestInterface::hasInstance(v8Value, isolate)) { |
1421 RefPtr<TestInterfaceImplementation> cppValue = V8TestInterface::toImpl(v
8::Local<v8::Object>::Cast(v8Value)); | 1425 TestInterfaceImplementation* cppValue = V8TestInterface::toImpl(v8::Loca
l<v8::Object>::Cast(v8Value)); |
1422 impl.setTestInterface(cppValue); | 1426 impl.setTestInterface(cppValue); |
1423 return; | 1427 return; |
1424 } | 1428 } |
1425 | 1429 |
1426 if (V8TestInterfaceEmpty::hasInstance(v8Value, isolate)) { | 1430 if (V8TestInterfaceEmpty::hasInstance(v8Value, isolate)) { |
1427 RefPtr<TestInterfaceEmpty> cppValue = V8TestInterfaceEmpty::toImpl(v8::L
ocal<v8::Object>::Cast(v8Value)); | 1431 TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImpl(v8::Local<v8
::Object>::Cast(v8Value)); |
1428 impl.setTestInterfaceEmpty(cppValue); | 1432 impl.setTestInterfaceEmpty(cppValue); |
1429 return; | 1433 return; |
1430 } | 1434 } |
1431 | 1435 |
1432 exceptionState.throwTypeError("The provided value is not of type '(TestInter
face or TestInterfaceEmpty)'"); | 1436 exceptionState.throwTypeError("The provided value is not of type '(TestInter
face or TestInterfaceEmpty)'"); |
1433 } | 1437 } |
1434 | 1438 |
1435 v8::Local<v8::Value> toV8(const TestInterfaceOrTestInterfaceEmpty& impl, v8::Loc
al<v8::Object> creationContext, v8::Isolate* isolate) | 1439 v8::Local<v8::Value> toV8(const TestInterfaceOrTestInterfaceEmpty& impl, v8::Loc
al<v8::Object> creationContext, v8::Isolate* isolate) |
1436 { | 1440 { |
1437 switch (impl.m_type) { | 1441 switch (impl.m_type) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 } | 1553 } |
1550 | 1554 |
1551 UnrestrictedDoubleOrString NativeValueTraits<UnrestrictedDoubleOrString>::native
Value(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptio
nState) | 1555 UnrestrictedDoubleOrString NativeValueTraits<UnrestrictedDoubleOrString>::native
Value(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptio
nState) |
1552 { | 1556 { |
1553 UnrestrictedDoubleOrString impl; | 1557 UnrestrictedDoubleOrString impl; |
1554 V8UnrestrictedDoubleOrString::toImpl(isolate, value, impl, UnionTypeConversi
onMode::NotNullable, exceptionState); | 1558 V8UnrestrictedDoubleOrString::toImpl(isolate, value, impl, UnionTypeConversi
onMode::NotNullable, exceptionState); |
1555 return impl; | 1559 return impl; |
1556 } | 1560 } |
1557 | 1561 |
1558 } // namespace blink | 1562 } // namespace blink |
OLD | NEW |