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 """Generate template contexts of dictionaries for both v8 bindings and | 5 """Generate template contexts of dictionaries for both v8 bindings and |
6 implementation classes that are used by blink's core/modules. | 6 implementation classes that are used by blink's core/modules. |
7 """ | 7 """ |
8 | 8 |
9 import operator | 9 import operator |
10 from idl_types import IdlType | 10 from idl_types import IdlType |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 return idl_type.inner_type | 47 return idl_type.inner_type |
48 return idl_type | 48 return idl_type |
49 | 49 |
50 | 50 |
51 # Context for V8 bindings | 51 # Context for V8 bindings |
52 | 52 |
53 def dictionary_context(dictionary, interfaces_info): | 53 def dictionary_context(dictionary, interfaces_info): |
54 includes.clear() | 54 includes.clear() |
55 includes.update(DICTIONARY_CPP_INCLUDES) | 55 includes.update(DICTIONARY_CPP_INCLUDES) |
56 | 56 |
| 57 if 'RuntimeEnabled' in dictionary.extended_attributes: |
| 58 raise Exception( |
| 59 'Dictionary cannot be RuntimeEnabled: %s' % dictionary.name) |
| 60 |
57 members = [member_context(dictionary, member) | 61 members = [member_context(dictionary, member) |
58 for member in sorted(dictionary.members, | 62 for member in sorted(dictionary.members, |
59 key=operator.attrgetter('name'))] | 63 key=operator.attrgetter('name'))] |
60 | 64 |
61 for member in members: | 65 for member in members: |
62 if member['runtime_enabled_function']: | 66 if member['runtime_enabled_function']: |
63 includes.add('platform/RuntimeEnabledFeatures.h') | 67 includes.add('platform/RuntimeEnabledFeatures.h') |
64 break | 68 break |
65 | 69 |
66 cpp_class = v8_utilities.cpp_name(dictionary) | 70 cpp_class = v8_utilities.cpp_name(dictionary) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 'getter_expression': getter_expression(), | 220 'getter_expression': getter_expression(), |
217 'has_method_expression': has_method_expression(), | 221 'has_method_expression': has_method_expression(), |
218 'has_method_name': has_method_name_for_dictionary_member(member), | 222 'has_method_name': has_method_name_for_dictionary_member(member), |
219 'is_nullable': idl_type.is_nullable, | 223 'is_nullable': idl_type.is_nullable, |
220 'is_traceable': idl_type.is_traceable, | 224 'is_traceable': idl_type.is_traceable, |
221 'member_cpp_type': member_cpp_type(), | 225 'member_cpp_type': member_cpp_type(), |
222 'null_setter_name': null_setter_name_for_dictionary_member(member), | 226 'null_setter_name': null_setter_name_for_dictionary_member(member), |
223 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 227 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
224 'setter_name': setter_name_for_dictionary_member(member), | 228 'setter_name': setter_name_for_dictionary_member(member), |
225 } | 229 } |
OLD | NEW |