Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: Source/bindings/scripts/utilities.py

Issue 1054443002: Make classes for union types exported. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return self._component_info['typedefs'] 104 return self._component_info['typedefs']
105 105
106 @property 106 @property
107 def union_types(self): 107 def union_types(self):
108 return self._component_info['union_types'] 108 return self._component_info['union_types']
109 109
110 @property 110 @property
111 def include_path_for_union_types(self): 111 def include_path_for_union_types(self):
112 return 'bindings/core/v8/UnionTypesCore.h' 112 return 'bindings/core/v8/UnionTypesCore.h'
113 113
114 @property
115 def specifier_for_export(self):
116 return 'CORE_EXPORT '
117
118 @property
119 def include_path_for_export(self):
120 return 'core/CoreExport.h'
121
114 122
115 class ComponentInfoProviderModules(ComponentInfoProvider): 123 class ComponentInfoProviderModules(ComponentInfoProvider):
116 def __init__(self, interfaces_info, component_info_core, 124 def __init__(self, interfaces_info, component_info_core,
117 component_info_modules): 125 component_info_modules):
118 super(ComponentInfoProviderModules, self).__init__() 126 super(ComponentInfoProviderModules, self).__init__()
119 self._interfaces_info = interfaces_info 127 self._interfaces_info = interfaces_info
120 self._component_info_core = component_info_core 128 self._component_info_core = component_info_core
121 self._component_info_modules = component_info_modules 129 self._component_info_modules = component_info_modules
122 130
123 @property 131 @property
(...skipping 19 matching lines...) Expand all
143 @property 151 @property
144 def union_types(self): 152 def union_types(self):
145 # Remove duplicate union types from component_info_modules to avoid 153 # Remove duplicate union types from component_info_modules to avoid
146 # generating multiple container generation. 154 # generating multiple container generation.
147 return self._component_info_modules['union_types'] - self._component_inf o_core['union_types'] 155 return self._component_info_modules['union_types'] - self._component_inf o_core['union_types']
148 156
149 @property 157 @property
150 def include_path_for_union_types(self): 158 def include_path_for_union_types(self):
151 return 'bindings/modules/v8/UnionTypesModules.h' 159 return 'bindings/modules/v8/UnionTypesModules.h'
152 160
161 @property
162 def specifier_for_export(self):
163 return 'MODULES_EXPORT '
164
165 @property
166 def include_path_for_export(self):
167 return 'modules/ModulesExport.h'
haraken 2015/04/02 09:13:09 I'd propose introducing wtf/Export.h (and remove C
168
153 169
154 def load_interfaces_info_overall_pickle(info_dir): 170 def load_interfaces_info_overall_pickle(info_dir):
155 with open(os.path.join(info_dir, 'modules', 'InterfacesInfoOverall.pickle')) as interface_info_file: 171 with open(os.path.join(info_dir, 'modules', 'InterfacesInfoOverall.pickle')) as interface_info_file:
156 return pickle.load(interface_info_file) 172 return pickle.load(interface_info_file)
157 173
158 174
159 def create_component_info_provider_core(info_dir): 175 def create_component_info_provider_core(info_dir):
160 interfaces_info = load_interfaces_info_overall_pickle(info_dir) 176 interfaces_info = load_interfaces_info_overall_pickle(info_dir)
161 with open(os.path.join(info_dir, 'core', 'ComponentInfoCore.pickle')) as com ponent_info_file: 177 with open(os.path.join(info_dir, 'core', 'ComponentInfoCore.pickle')) as com ponent_info_file:
162 component_info = pickle.load(component_info_file) 178 component_info = pickle.load(component_info_file)
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 extended_attributes_string = match.group(1) 338 extended_attributes_string = match.group(1)
323 match = re.search(r'[^=]\bExposed\(([^)]*)\)', file_contents) 339 match = re.search(r'[^=]\bExposed\(([^)]*)\)', file_contents)
324 if not match: 340 if not match:
325 return None 341 return None
326 arguments = [] 342 arguments = []
327 for argument in map(string.strip, match.group(1).split(',')): 343 for argument in map(string.strip, match.group(1).split(',')):
328 exposed, runtime_enabled = argument.split() 344 exposed, runtime_enabled = argument.split()
329 arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled }) 345 arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled })
330 346
331 return arguments 347 return arguments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698