Chromium Code Reviews| Index: Source/bindings/scripts/unstable/v8_types.py |
| diff --git a/Source/bindings/scripts/unstable/v8_types.py b/Source/bindings/scripts/unstable/v8_types.py |
| index 7e002313f5809ca099e3606dee22466beca72f84..363775d1a70514930645a43180d070a742144e9d 100644 |
| --- a/Source/bindings/scripts/unstable/v8_types.py |
| +++ b/Source/bindings/scripts/unstable/v8_types.py |
| @@ -166,6 +166,9 @@ DOM_NODE_TYPES = set([ |
| 'TestNode', |
| ]) |
| NON_WRAPPER_TYPES = set([ |
| + 'CompareHow', |
| + 'Dictionary', |
| + 'MediaQueryListListener', |
| 'NodeFilter', |
| 'SerializedScriptValue', |
| ]) |
| @@ -226,16 +229,17 @@ CPP_UNSIGNED_TYPES = set([ |
| 'unsigned short', |
| ]) |
| CPP_SPECIAL_CONVERSION_RULES = { |
| + 'CompareHow': 'Range::CompareHow', |
| 'Date': 'double', |
| + 'Dictionary': 'Dictionary', |
| + 'EventHandler': 'EventListener*', |
| 'Promise': 'ScriptPromise', |
| 'any': 'ScriptValue', |
| 'boolean': 'bool', |
| } |
| CPP_REF_PTR_CONVERSION_TYPES = set([ |
| - # FIXME: overlaps with NON_WRAPPER_TYPES |
| + # FIXME: can these be merged to NON_WRAPPER_TYPES? |
|
Nils Barth (inactive)
2013/10/30 11:21:14
Same comment and same 2 exceptions as in Perl.
haraken
2013/10/30 11:32:16
Yeah, we want to remove CPP_REF_PTR_CONVERSION_TYP
Nils Barth (inactive)
2013/10/31 01:10:06
Looks like we can reduce this to one special case,
|
| 'DOMStringList', |
| - 'NodeFilter', |
| - 'SerializedScriptValue', |
| 'XPathNSResolver', |
| ]) |
| @@ -263,7 +267,8 @@ def cpp_type(idl_type, extended_attributes=None, used_as_argument=False): |
| return 'unsigned' |
| if idl_type in CPP_SPECIAL_CONVERSION_RULES: |
| return CPP_SPECIAL_CONVERSION_RULES[idl_type] |
| - if idl_type in CPP_REF_PTR_CONVERSION_TYPES: |
| + if (idl_type in NON_WRAPPER_TYPES or |
|
Nils Barth (inactive)
2013/10/30 11:21:14
Mostly merged to NON_WRAPPER_TYPES
|
| + idl_type in CPP_REF_PTR_CONVERSION_TYPES): |
| return 'RefPtr<%s>' % idl_type |
| if idl_type == 'DOMString': |
| return cpp_string_type() |
| @@ -273,12 +278,8 @@ def cpp_type(idl_type, extended_attributes=None, used_as_argument=False): |
| if this_array_or_sequence_type: |
| return cpp_template_type('Vector', cpp_type(this_array_or_sequence_type)) |
| - # Special cases |
| - if idl_type == 'EventHandler': |
| - return 'EventListener*' |
| if is_typed_array_type and used_as_argument: |
| return idl_type + '*' |
| - |
| if is_interface_type(idl_type) and not used_as_argument: |
| return cpp_template_type('RefPtr', idl_type) |
| # Default, assume native type is a pointer with same type name as idl type |
| @@ -357,11 +358,14 @@ V8_VALUE_TO_CPP_VALUE_AND_INCLUDES = { |
| # idl_type -> (cpp_expression_format, includes) |
| 'any': ('ScriptValue({v8_value}, {isolate})', |
| set(['bindings/v8/ScriptValue.h'])), |
| + 'CompareHow': ('static_cast<Range::CompareHow>({v8_value}->Int32Value())', |
| + set()), |
| 'Dictionary': ('Dictionary({v8_value}, {isolate})', |
| set(['bindings/v8/Dictionary.h'])), |
| 'DOMStringList': ('toDOMStringList({v8_value}, {isolate})', set()), |
| - 'MediaQueryListListener': ('MediaQueryListListener::create({v8_value})', |
| - set(['core/css/MediaQueryListListener.h'])), |
| + 'MediaQueryListListener': ( |
| + 'MediaQueryListListener::create(ScriptValue({v8_value}, {isolate}))', |
| + set(['core/css/MediaQueryListListener.h'])), |
| 'NodeFilter': ('toNodeFilter({v8_value}, {isolate})', set()), |
| 'Promise': ('ScriptPromise({v8_value})', |
| set(['bindings/v8/ScriptPromise.h'])), |