OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 'core/html/HTMLCollection.h', | 350 'core/html/HTMLCollection.h', |
351 'core/html/HTMLDataListOptionsCollection.h', | 351 'core/html/HTMLDataListOptionsCollection.h', |
352 'core/html/HTMLFormControlsCollection.h', | 352 'core/html/HTMLFormControlsCollection.h', |
353 'core/html/HTMLTableRowsCollection.h']), | 353 'core/html/HTMLTableRowsCollection.h']), |
354 'NodeList': set(['bindings/core/v8/V8NodeList.h', | 354 'NodeList': set(['bindings/core/v8/V8NodeList.h', |
355 'core/dom/NameNodeList.h', | 355 'core/dom/NameNodeList.h', |
356 'core/dom/NodeList.h', | 356 'core/dom/NodeList.h', |
357 'core/dom/StaticNodeList.h', | 357 'core/dom/StaticNodeList.h', |
358 'core/html/LabelsNodeList.h']), | 358 'core/html/LabelsNodeList.h']), |
359 'Promise': set(['bindings/core/v8/ScriptPromise.h']), | 359 'Promise': set(['bindings/core/v8/ScriptPromise.h']), |
360 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h']), | 360 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h', |
| 361 'bindings/core/v8/SerializedScriptValueFactory
.h']), |
361 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']), | 362 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']), |
362 } | 363 } |
363 | 364 |
364 | 365 |
365 def includes_for_type(idl_type): | 366 def includes_for_type(idl_type): |
366 idl_type = idl_type.preprocessed_type | 367 idl_type = idl_type.preprocessed_type |
367 | 368 |
368 # Simple types | 369 # Simple types |
369 base_idl_type = idl_type.base_type | 370 base_idl_type = idl_type.base_type |
370 if base_idl_type in INCLUDES_FOR_TYPE: | 371 if base_idl_type in INCLUDES_FOR_TYPE: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 'unsigned short': 'toUInt16({arguments})', | 469 'unsigned short': 'toUInt16({arguments})', |
469 'long': 'toInt32({arguments})', | 470 'long': 'toInt32({arguments})', |
470 'unsigned long': 'toUInt32({arguments})', | 471 'unsigned long': 'toUInt32({arguments})', |
471 'long long': 'toInt64({arguments})', | 472 'long long': 'toInt64({arguments})', |
472 'unsigned long long': 'toUInt64({arguments})', | 473 'unsigned long long': 'toUInt64({arguments})', |
473 # Interface types | 474 # Interface types |
474 'Dictionary': 'Dictionary({v8_value}, {isolate})', | 475 'Dictionary': 'Dictionary({v8_value}, {isolate})', |
475 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', | 476 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', |
476 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', | 477 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', |
477 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', | 478 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', |
478 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, 0, 0, ex
ceptionState, {isolate})', | 479 'SerializedScriptValue': 'SerializedScriptValueFactory::factory().create({v8
_value}, 0, 0, exceptionState, {isolate})', |
479 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', | 480 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', |
480 'Window': 'toDOMWindow({v8_value}, {isolate})', | 481 'Window': 'toDOMWindow({v8_value}, {isolate})', |
481 'XPathNSResolver': 'toXPathNSResolver({isolate}, {v8_value})', | 482 'XPathNSResolver': 'toXPathNSResolver({isolate}, {v8_value})', |
482 } | 483 } |
483 | 484 |
484 | 485 |
485 def v8_conversion_needs_exception_state(idl_type): | 486 def v8_conversion_needs_exception_state(idl_type): |
486 return (idl_type.is_numeric_type or | 487 return (idl_type.is_numeric_type or |
487 idl_type.is_dictionary or | 488 idl_type.is_dictionary or |
488 idl_type.name in ('ByteString', 'USVString', 'SerializedScriptValue'
)) | 489 idl_type.name in ('ByteString', 'USVString', 'SerializedScriptValue'
)) |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 number_of_nullable_member_types_union) | 915 number_of_nullable_member_types_union) |
915 | 916 |
916 | 917 |
917 def includes_nullable_type_union(idl_type): | 918 def includes_nullable_type_union(idl_type): |
918 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type | 919 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type |
919 return idl_type.number_of_nullable_member_types == 1 | 920 return idl_type.number_of_nullable_member_types == 1 |
920 | 921 |
921 IdlTypeBase.includes_nullable_type = False | 922 IdlTypeBase.includes_nullable_type = False |
922 IdlNullableType.includes_nullable_type = True | 923 IdlNullableType.includes_nullable_type = True |
923 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) | 924 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) |
OLD | NEW |