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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 'core/html/HTMLCollection.h', | 367 'core/html/HTMLCollection.h', |
368 'core/html/HTMLDataListOptionsCollection.h', | 368 'core/html/HTMLDataListOptionsCollection.h', |
369 'core/html/HTMLFormControlsCollection.h', | 369 'core/html/HTMLFormControlsCollection.h', |
370 'core/html/HTMLTableRowsCollection.h']), | 370 'core/html/HTMLTableRowsCollection.h']), |
371 'NodeList': set(['bindings/core/v8/V8NodeList.h', | 371 'NodeList': set(['bindings/core/v8/V8NodeList.h', |
372 'core/dom/NameNodeList.h', | 372 'core/dom/NameNodeList.h', |
373 'core/dom/NodeList.h', | 373 'core/dom/NodeList.h', |
374 'core/dom/StaticNodeList.h', | 374 'core/dom/StaticNodeList.h', |
375 'core/html/LabelsNodeList.h']), | 375 'core/html/LabelsNodeList.h']), |
376 'Promise': set(['bindings/core/v8/ScriptPromise.h']), | 376 'Promise': set(['bindings/core/v8/ScriptPromise.h']), |
377 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h']), | 377 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h', |
| 378 'bindings/core/v8/SerializedScriptValueFactory
.h']), |
378 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']), | 379 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']), |
379 } | 380 } |
380 | 381 |
381 | 382 |
382 def includes_for_type(idl_type): | 383 def includes_for_type(idl_type): |
383 idl_type = idl_type.preprocessed_type | 384 idl_type = idl_type.preprocessed_type |
384 | 385 |
385 # Simple types | 386 # Simple types |
386 base_idl_type = idl_type.base_type | 387 base_idl_type = idl_type.base_type |
387 if base_idl_type in INCLUDES_FOR_TYPE: | 388 if base_idl_type in INCLUDES_FOR_TYPE: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 'unsigned short': 'toUInt16({arguments})', | 486 'unsigned short': 'toUInt16({arguments})', |
486 'long': 'toInt32({arguments})', | 487 'long': 'toInt32({arguments})', |
487 'unsigned long': 'toUInt32({arguments})', | 488 'unsigned long': 'toUInt32({arguments})', |
488 'long long': 'toInt64({arguments})', | 489 'long long': 'toInt64({arguments})', |
489 'unsigned long long': 'toUInt64({arguments})', | 490 'unsigned long long': 'toUInt64({arguments})', |
490 # Interface types | 491 # Interface types |
491 'Dictionary': 'Dictionary({v8_value}, {isolate}, exceptionState)', | 492 'Dictionary': 'Dictionary({v8_value}, {isolate}, exceptionState)', |
492 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', | 493 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', |
493 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', | 494 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', |
494 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', | 495 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', |
495 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, 0, 0, ex
ceptionState, {isolate})', | 496 'SerializedScriptValue': 'SerializedScriptValueFactory::instance().create({v
8_value}, 0, 0, exceptionState, {isolate})', |
496 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', | 497 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', |
497 'Window': 'toDOMWindow({isolate}, {v8_value})', | 498 'Window': 'toDOMWindow({isolate}, {v8_value})', |
498 'XPathNSResolver': 'toXPathNSResolver({isolate}, {v8_value})', | 499 'XPathNSResolver': 'toXPathNSResolver({isolate}, {v8_value})', |
499 } | 500 } |
500 | 501 |
501 | 502 |
502 def v8_conversion_needs_exception_state(idl_type): | 503 def v8_conversion_needs_exception_state(idl_type): |
503 return (idl_type.is_numeric_type or | 504 return (idl_type.is_numeric_type or |
504 idl_type.is_dictionary or | 505 idl_type.is_dictionary or |
505 idl_type.name in ('ByteString', 'Dictionary', 'USVString', 'Serializ
edScriptValue')) | 506 idl_type.name in ('ByteString', 'Dictionary', 'USVString', 'Serializ
edScriptValue')) |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 number_of_nullable_member_types_union) | 932 number_of_nullable_member_types_union) |
932 | 933 |
933 | 934 |
934 def includes_nullable_type_union(idl_type): | 935 def includes_nullable_type_union(idl_type): |
935 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type | 936 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type |
936 return idl_type.number_of_nullable_member_types == 1 | 937 return idl_type.number_of_nullable_member_types == 1 |
937 | 938 |
938 IdlTypeBase.includes_nullable_type = False | 939 IdlTypeBase.includes_nullable_type = False |
939 IdlNullableType.includes_nullable_type = True | 940 IdlNullableType.includes_nullable_type = True |
940 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) | 941 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) |
OLD | NEW |