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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 'unsigned int', | 101 'unsigned int', |
102 'unsigned long', | 102 'unsigned long', |
103 'unsigned short', | 103 'unsigned short', |
104 ]) | 104 ]) |
105 CPP_SPECIAL_CONVERSION_RULES = { | 105 CPP_SPECIAL_CONVERSION_RULES = { |
106 'CompareHow': 'Range::CompareHow', | 106 'CompareHow': 'Range::CompareHow', |
107 'Date': 'double', | 107 'Date': 'double', |
108 'Dictionary': 'Dictionary', | 108 'Dictionary': 'Dictionary', |
109 'EventHandler': 'EventListener*', | 109 'EventHandler': 'EventListener*', |
110 'MediaQueryListListener': 'RefPtrWillBeRawPtr<MediaQueryListListener>', | 110 'MediaQueryListListener': 'RefPtrWillBeRawPtr<MediaQueryListListener>', |
| 111 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>', |
111 'Promise': 'ScriptPromise', | 112 'Promise': 'ScriptPromise', |
112 'ScriptValue': 'ScriptValue', | 113 'ScriptValue': 'ScriptValue', |
113 # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345
529 | 114 # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345
529 |
114 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>', | 115 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>', |
115 'boolean': 'bool', | 116 'boolean': 'bool', |
116 'unrestricted double': 'double', | 117 'unrestricted double': 'double', |
117 'unrestricted float': 'float', | 118 'unrestricted float': 'float', |
118 } | 119 } |
119 | 120 |
120 | 121 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 def cpp_value_to_v8_value(idl_type, cpp_value, isolate='info.GetIsolate()', crea
tion_context='', extended_attributes=None): | 642 def cpp_value_to_v8_value(idl_type, cpp_value, isolate='info.GetIsolate()', crea
tion_context='', extended_attributes=None): |
642 """Returns an expression that converts a C++ value to a V8 value.""" | 643 """Returns an expression that converts a C++ value to a V8 value.""" |
643 # the isolate parameter is needed for callback interfaces | 644 # the isolate parameter is needed for callback interfaces |
644 idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, ext
ended_attributes) | 645 idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, ext
ended_attributes) |
645 this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) | 646 this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) |
646 format_string = CPP_VALUE_TO_V8_VALUE[this_v8_conversion_type] | 647 format_string = CPP_VALUE_TO_V8_VALUE[this_v8_conversion_type] |
647 statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creat
ion_context=creation_context) | 648 statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creat
ion_context=creation_context) |
648 return statement | 649 return statement |
649 | 650 |
650 IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value | 651 IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value |
OLD | NEW |