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 """Utility functions (file reading, simple IDL parsing by regexes) for IDL build
. | 5 """Utility functions (file reading, simple IDL parsing by regexes) for IDL build
. |
6 | 6 |
7 Design doc: http://www.chromium.org/developers/design-documents/idl-build | 7 Design doc: http://www.chromium.org/developers/design-documents/idl-build |
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 @property | 82 @property |
83 def typedefs(self): | 83 def typedefs(self): |
84 return {} | 84 return {} |
85 | 85 |
86 @property | 86 @property |
87 def union_types(self): | 87 def union_types(self): |
88 return set() | 88 return set() |
89 | 89 |
90 @property | 90 @property |
91 def include_path_for_union_types(self, name): | 91 def include_path_for_union_types(self): |
92 return None | 92 return None |
93 | 93 |
94 | 94 |
95 class ComponentInfoProviderCore(ComponentInfoProvider): | 95 class ComponentInfoProviderCore(ComponentInfoProvider): |
96 def __init__(self, interfaces_info, component_info): | 96 def __init__(self, interfaces_info, component_info): |
97 super(ComponentInfoProviderCore, self).__init__() | 97 super(ComponentInfoProviderCore, self).__init__() |
98 self._interfaces_info = interfaces_info | 98 self._interfaces_info = interfaces_info |
99 self._component_info = component_info | 99 self._component_info = component_info |
100 | 100 |
101 @property | 101 @property |
102 def interfaces_info(self): | 102 def interfaces_info(self): |
103 return self._interfaces_info | 103 return self._interfaces_info |
104 | 104 |
105 @property | 105 @property |
106 def component_info(self): | 106 def component_info(self): |
107 return self._component_info | 107 return self._component_info |
108 | 108 |
109 @property | 109 @property |
110 def enumerations(self): | 110 def enumerations(self): |
111 return self._component_info['enumerations'] | 111 return self._component_info['enumerations'] |
112 | 112 |
113 @property | 113 @property |
114 def typedefs(self): | 114 def typedefs(self): |
115 return self._component_info['typedefs'] | 115 return self._component_info['typedefs'] |
116 | 116 |
117 @property | 117 @property |
118 def union_types(self): | 118 def union_types(self): |
119 return self._component_info['union_types'] | 119 return self._component_info['union_types'] |
120 | 120 |
121 def include_path_for_union_types(self, name): | 121 @property |
122 return 'bindings/core/v8/%s.h' % name | 122 def include_path_for_union_types(self): |
| 123 return 'bindings/core/v8/UnionTypesCore.h' |
123 | 124 |
124 @property | 125 @property |
125 def specifier_for_export(self): | 126 def specifier_for_export(self): |
126 return 'CORE_EXPORT ' | 127 return 'CORE_EXPORT ' |
127 | 128 |
128 @property | 129 @property |
129 def include_path_for_export(self): | 130 def include_path_for_export(self): |
130 return 'core/CoreExport.h' | 131 return 'core/CoreExport.h' |
131 | 132 |
132 | 133 |
(...skipping 24 matching lines...) Expand all Loading... |
157 typedefs = self._component_info_core['typedefs'].copy() | 158 typedefs = self._component_info_core['typedefs'].copy() |
158 typedefs.update(self._component_info_modules['typedefs']) | 159 typedefs.update(self._component_info_modules['typedefs']) |
159 return typedefs | 160 return typedefs |
160 | 161 |
161 @property | 162 @property |
162 def union_types(self): | 163 def union_types(self): |
163 # Remove duplicate union types from component_info_modules to avoid | 164 # Remove duplicate union types from component_info_modules to avoid |
164 # generating multiple container generation. | 165 # generating multiple container generation. |
165 return self._component_info_modules['union_types'] - self._component_inf
o_core['union_types'] | 166 return self._component_info_modules['union_types'] - self._component_inf
o_core['union_types'] |
166 | 167 |
167 def include_path_for_union_types(self, name): | 168 @property |
168 core_union_type_names = [union_type.name for union_type | 169 def include_path_for_union_types(self): |
169 in self._component_info_core['union_types']] | 170 return 'bindings/modules/v8/UnionTypesModules.h' |
170 if name in core_union_type_names: | |
171 return 'bindings/core/v8/%s.h' % name | |
172 return 'bindings/modules/v8/%s.h' % name | |
173 | 171 |
174 @property | 172 @property |
175 def specifier_for_export(self): | 173 def specifier_for_export(self): |
176 return 'MODULES_EXPORT ' | 174 return 'MODULES_EXPORT ' |
177 | 175 |
178 @property | 176 @property |
179 def include_path_for_export(self): | 177 def include_path_for_export(self): |
180 return 'modules/ModulesExport.h' | 178 return 'modules/ModulesExport.h' |
181 | 179 |
182 | 180 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 extended_attributes_string = match.group(1) | 377 extended_attributes_string = match.group(1) |
380 match = re.search(r'[^=]\bExposed\(([^)]*)\)', file_contents) | 378 match = re.search(r'[^=]\bExposed\(([^)]*)\)', file_contents) |
381 if not match: | 379 if not match: |
382 return None | 380 return None |
383 arguments = [] | 381 arguments = [] |
384 for argument in map(string.strip, match.group(1).split(',')): | 382 for argument in map(string.strip, match.group(1).split(',')): |
385 exposed, runtime_enabled = argument.split() | 383 exposed, runtime_enabled = argument.split() |
386 arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled
}) | 384 arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled
}) |
387 | 385 |
388 return arguments | 386 return arguments |
OLD | NEW |