| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 ################################################################################ | 47 ################################################################################ |
| 48 # V8-specific handling of IDL types | 48 # V8-specific handling of IDL types |
| 49 ################################################################################ | 49 ################################################################################ |
| 50 | 50 |
| 51 NON_WRAPPER_TYPES = frozenset([ | 51 NON_WRAPPER_TYPES = frozenset([ |
| 52 'CompareHow', | 52 'CompareHow', |
| 53 'Dictionary', | 53 'Dictionary', |
| 54 'EventHandler', | 54 'EventHandler', |
| 55 'EventListener', | 55 'EventListener', |
| 56 'MediaQueryListListener', | |
| 57 'NodeFilter', | 56 'NodeFilter', |
| 58 'SerializedScriptValue', | 57 'SerializedScriptValue', |
| 59 ]) | 58 ]) |
| 60 TYPED_ARRAYS = { | 59 TYPED_ARRAYS = { |
| 61 # (cpp_type, v8_type), used by constructor templates | 60 # (cpp_type, v8_type), used by constructor templates |
| 62 'ArrayBuffer': None, | 61 'ArrayBuffer': None, |
| 63 'ArrayBufferView': None, | 62 'ArrayBufferView': None, |
| 64 'Float32Array': ('float', 'v8::kExternalFloatArray'), | 63 'Float32Array': ('float', 'v8::kExternalFloatArray'), |
| 65 'Float64Array': ('double', 'v8::kExternalDoubleArray'), | 64 'Float64Array': ('double', 'v8::kExternalDoubleArray'), |
| 66 'Int8Array': ('signed char', 'v8::kExternalByteArray'), | 65 'Int8Array': ('signed char', 'v8::kExternalByteArray'), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 'octet', | 98 'octet', |
| 100 'unsigned int', | 99 'unsigned int', |
| 101 'unsigned long', | 100 'unsigned long', |
| 102 'unsigned short', | 101 'unsigned short', |
| 103 ]) | 102 ]) |
| 104 CPP_SPECIAL_CONVERSION_RULES = { | 103 CPP_SPECIAL_CONVERSION_RULES = { |
| 105 'CompareHow': 'Range::CompareHow', | 104 'CompareHow': 'Range::CompareHow', |
| 106 'Date': 'double', | 105 'Date': 'double', |
| 107 'Dictionary': 'Dictionary', | 106 'Dictionary': 'Dictionary', |
| 108 'EventHandler': 'EventListener*', | 107 'EventHandler': 'EventListener*', |
| 109 'MediaQueryListListener': 'RefPtrWillBeRawPtr<MediaQueryListListener>', | |
| 110 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>', | 108 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>', |
| 111 'Promise': 'ScriptPromise', | 109 'Promise': 'ScriptPromise', |
| 112 'ScriptValue': 'ScriptValue', | 110 'ScriptValue': 'ScriptValue', |
| 113 # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345
529 | 111 # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345
529 |
| 114 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>', | 112 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>', |
| 115 'boolean': 'bool', | 113 'boolean': 'bool', |
| 116 'unrestricted double': 'double', | 114 'unrestricted double': 'double', |
| 117 'unrestricted float': 'float', | 115 'unrestricted float': 'float', |
| 118 } | 116 } |
| 119 | 117 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 'EventListener': set(['bindings/core/v8/BindingSecurity.h', | 335 'EventListener': set(['bindings/core/v8/BindingSecurity.h', |
| 338 'bindings/core/v8/V8EventListenerList.h', | 336 'bindings/core/v8/V8EventListenerList.h', |
| 339 'core/frame/LocalDOMWindow.h']), | 337 'core/frame/LocalDOMWindow.h']), |
| 340 'HTMLCollection': set(['bindings/core/v8/V8HTMLCollection.h', | 338 'HTMLCollection': set(['bindings/core/v8/V8HTMLCollection.h', |
| 341 'core/dom/ClassCollection.h', | 339 'core/dom/ClassCollection.h', |
| 342 'core/dom/TagCollection.h', | 340 'core/dom/TagCollection.h', |
| 343 'core/html/HTMLCollection.h', | 341 'core/html/HTMLCollection.h', |
| 344 'core/html/HTMLDataListOptionsCollection.h', | 342 'core/html/HTMLDataListOptionsCollection.h', |
| 345 'core/html/HTMLFormControlsCollection.h', | 343 'core/html/HTMLFormControlsCollection.h', |
| 346 'core/html/HTMLTableRowsCollection.h']), | 344 'core/html/HTMLTableRowsCollection.h']), |
| 347 'MediaQueryListListener': set(['core/css/MediaQueryListListener.h']), | |
| 348 'NodeList': set(['bindings/core/v8/V8NodeList.h', | 345 'NodeList': set(['bindings/core/v8/V8NodeList.h', |
| 349 'core/dom/NameNodeList.h', | 346 'core/dom/NameNodeList.h', |
| 350 'core/dom/NodeList.h', | 347 'core/dom/NodeList.h', |
| 351 'core/dom/StaticNodeList.h', | 348 'core/dom/StaticNodeList.h', |
| 352 'core/html/LabelsNodeList.h']), | 349 'core/html/LabelsNodeList.h']), |
| 353 'Promise': set(['bindings/core/v8/ScriptPromise.h']), | 350 'Promise': set(['bindings/core/v8/ScriptPromise.h']), |
| 354 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h']), | 351 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h']), |
| 355 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']), | 352 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']), |
| 356 } | 353 } |
| 357 | 354 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 'short': 'toInt16({arguments})', | 457 'short': 'toInt16({arguments})', |
| 461 'unsigned short': 'toUInt16({arguments})', | 458 'unsigned short': 'toUInt16({arguments})', |
| 462 'long': 'toInt32({arguments})', | 459 'long': 'toInt32({arguments})', |
| 463 'unsigned long': 'toUInt32({arguments})', | 460 'unsigned long': 'toUInt32({arguments})', |
| 464 'long long': 'toInt64({arguments})', | 461 'long long': 'toInt64({arguments})', |
| 465 'unsigned long long': 'toUInt64({arguments})', | 462 'unsigned long long': 'toUInt64({arguments})', |
| 466 # Interface types | 463 # Interface types |
| 467 'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())', | 464 'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())', |
| 468 'Dictionary': 'Dictionary({v8_value}, {isolate})', | 465 'Dictionary': 'Dictionary({v8_value}, {isolate})', |
| 469 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', | 466 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', |
| 470 'MediaQueryListListener': 'MediaQueryListListener::create(ScriptState::curre
nt({isolate}), ScriptValue(ScriptState::current({isolate}), {v8_value}))', | |
| 471 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', | 467 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', |
| 472 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', | 468 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', |
| 473 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, {isolate
})', | 469 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, {isolate
})', |
| 474 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', | 470 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', |
| 475 'Window': 'toDOMWindow({v8_value}, {isolate})', | 471 'Window': 'toDOMWindow({v8_value}, {isolate})', |
| 476 'XPathNSResolver': 'toXPathNSResolver({v8_value}, {isolate})', | 472 'XPathNSResolver': 'toXPathNSResolver({v8_value}, {isolate})', |
| 477 } | 473 } |
| 478 | 474 |
| 479 | 475 |
| 480 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolat
e): | 476 def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolat
e): |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 | 812 |
| 817 | 813 |
| 818 def is_explicit_nullable(idl_type): | 814 def is_explicit_nullable(idl_type): |
| 819 # Nullable type that isn't implicit nullable (see above.) For such types, | 815 # Nullable type that isn't implicit nullable (see above.) For such types, |
| 820 # we use Nullable<T> or similar explicit ways to represent a null value. | 816 # we use Nullable<T> or similar explicit ways to represent a null value. |
| 821 return idl_type.is_nullable and not idl_type.is_implicit_nullable | 817 return idl_type.is_nullable and not idl_type.is_implicit_nullable |
| 822 | 818 |
| 823 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) | 819 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) |
| 824 IdlUnionType.is_implicit_nullable = False | 820 IdlUnionType.is_implicit_nullable = False |
| 825 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) | 821 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) |
| OLD | NEW |