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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 'unsigned short', | 105 'unsigned short', |
106 ]) | 106 ]) |
107 CPP_SPECIAL_CONVERSION_RULES = { | 107 CPP_SPECIAL_CONVERSION_RULES = { |
108 'Date': 'double', | 108 'Date': 'double', |
109 'Dictionary': 'Dictionary', | 109 'Dictionary': 'Dictionary', |
110 'EventHandler': 'EventListener*', | 110 'EventHandler': 'EventListener*', |
111 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>', | 111 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>', |
112 'Promise': 'ScriptPromise', | 112 'Promise': 'ScriptPromise', |
113 'ScriptValue': 'ScriptValue', | 113 'ScriptValue': 'ScriptValue', |
114 # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345
529 | 114 # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345
529 |
115 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>', | 115 'XPathNSResolver': 'RawPtr<XPathNSResolver>', |
116 'boolean': 'bool', | 116 'boolean': 'bool', |
117 'unrestricted double': 'double', | 117 'unrestricted double': 'double', |
118 'unrestricted float': 'float', | 118 'unrestricted float': 'float', |
119 } | 119 } |
120 | 120 |
121 | 121 |
122 def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_
type=False, used_as_variadic_argument=False, used_in_cpp_sequence=False): | 122 def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_
type=False, used_as_variadic_argument=False, used_in_cpp_sequence=False): |
123 """Returns C++ type corresponding to IDL type. | 123 """Returns C++ type corresponding to IDL type. |
124 | 124 |
125 |idl_type| argument is of type IdlType, while return value is a string | 125 |idl_type| argument is of type IdlType, while return value is a string |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 number_of_nullable_member_types_union) | 974 number_of_nullable_member_types_union) |
975 | 975 |
976 | 976 |
977 def includes_nullable_type_union(idl_type): | 977 def includes_nullable_type_union(idl_type): |
978 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type | 978 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type |
979 return idl_type.number_of_nullable_member_types == 1 | 979 return idl_type.number_of_nullable_member_types == 1 |
980 | 980 |
981 IdlTypeBase.includes_nullable_type = False | 981 IdlTypeBase.includes_nullable_type = False |
982 IdlNullableType.includes_nullable_type = True | 982 IdlNullableType.includes_nullable_type = True |
983 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) | 983 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) |
OLD | NEW |