Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import v8_utilities | 5 import v8_utilities |
| 6 | 6 |
| 7 | 7 |
| 8 UNION_H_INCLUDES = frozenset([ | 8 UNION_H_INCLUDES = frozenset([ |
| 9 'bindings/core/v8/Dictionary.h', | 9 'bindings/core/v8/Dictionary.h', |
| 10 'bindings/core/v8/ExceptionState.h', | 10 'bindings/core/v8/ExceptionState.h', |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 raise Exception('%s contains more than one nullable members' % union_typ e.name) | 102 raise Exception('%s contains more than one nullable members' % union_typ e.name) |
| 103 if dictionary_type and nullable_members == 1: | 103 if dictionary_type and nullable_members == 1: |
| 104 raise Exception('%s has a dictionary and a nullable member' % union_type .name) | 104 raise Exception('%s has a dictionary and a nullable member' % union_type .name) |
| 105 | 105 |
| 106 return { | 106 return { |
| 107 'array_buffer_type': array_buffer_type, | 107 'array_buffer_type': array_buffer_type, |
| 108 'array_buffer_view_type': array_buffer_view_type, | 108 'array_buffer_view_type': array_buffer_view_type, |
| 109 'boolean_type': boolean_type, | 109 'boolean_type': boolean_type, |
| 110 'cpp_class': union_type.cpp_type, | 110 'cpp_class': union_type.cpp_type, |
| 111 'dictionary_type': dictionary_type, | 111 'dictionary_type': dictionary_type, |
| 112 'idl_type': str(union_type), | |
|
haraken
2014/11/14 00:44:30
idl_type => type_string ?
(The IDL compiler uses
bashi
2014/11/14 00:51:38
Done. (I used "idl_type" because v8_attribute.py u
| |
| 112 'includes_nullable_type': union_type.includes_nullable_type, | 113 'includes_nullable_type': union_type.includes_nullable_type, |
| 113 'interface_types': interface_types, | 114 'interface_types': interface_types, |
| 114 'members': members, | 115 'members': members, |
| 115 'needs_trace': any(member['is_traceable'] for member in members), | 116 'needs_trace': any(member['is_traceable'] for member in members), |
| 116 'numeric_type': numeric_type, | 117 'numeric_type': numeric_type, |
| 117 'string_type': string_type, | 118 'string_type': string_type, |
| 118 } | 119 } |
| 119 | 120 |
| 120 | 121 |
| 121 def member_context(member, interfaces_info): | 122 def member_context(member, interfaces_info): |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 134 cpp_value='impl.getAs%s()' % member.name, isolate='isolate', | 135 cpp_value='impl.getAs%s()' % member.name, isolate='isolate', |
| 135 creation_context='creationContext'), | 136 creation_context='creationContext'), |
| 136 'is_traceable': member.is_traceable, | 137 'is_traceable': member.is_traceable, |
| 137 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True), | 138 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True), |
| 138 'specific_type_enum': 'SpecificType' + member.name, | 139 'specific_type_enum': 'SpecificType' + member.name, |
| 139 'type_name': member.name, | 140 'type_name': member.name, |
| 140 'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value( | 141 'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value( |
| 141 {}, 'v8Value', 'cppValue', isolate='isolate', | 142 {}, 'v8Value', 'cppValue', isolate='isolate', |
| 142 needs_exception_state_for_string=True), | 143 needs_exception_state_for_string=True), |
| 143 } | 144 } |
| OLD | NEW |