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

Side by Side Diff: lib/dom/scripts/dartgenerator.py

Issue 10378040: Generate and use cross frame wrappers for types in other frames/windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Factored out template Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/dom/scripts/systemhtml.py » ('j') | lib/dom/scripts/systemhtml.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module generates Dart APIs from the IDL database.""" 6 """This module generates Dart APIs from the IDL database."""
7 7
8 import emitter 8 import emitter
9 import idlnode 9 import idlnode
10 import logging 10 import logging
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 self._ComputeInheritanceClosure() 237 self._ComputeInheritanceClosure()
238 238
239 self._systems = [] 239 self._systems = []
240 240
241 # TODO(jmesserly): only create these if needed 241 # TODO(jmesserly): only create these if needed
242 if ('htmlfrog' in systems) or ('htmldartium' in systems): 242 if ('htmlfrog' in systems) or ('htmldartium' in systems):
243 html_interface_system = HtmlInterfacesSystem( 243 html_interface_system = HtmlInterfacesSystem(
244 TemplateLoader(self._template_dir, ['html/interface', 'html', '']), 244 TemplateLoader(self._template_dir, ['html/interface', 'html', '']),
245 self._database, self._emitters, self._output_dir, self) 245 self._database, self._emitters, self._output_dir, self)
246 self._systems.append(html_interface_system) 246 self._systems.append(html_interface_system)
247
248 html_cross_frame_system = HtmlCrossFrameSystem(
249 TemplateLoader(self._template_dir, ['html', '']),
250 self._database, self._emitters, self._output_dir, self)
251 self._systems.append(html_cross_frame_system)
247 else: 252 else:
248 interface_system = InterfacesSystem( 253 interface_system = InterfacesSystem(
249 TemplateLoader(self._template_dir, ['dom/interface', 'dom', '']), 254 TemplateLoader(self._template_dir, ['dom/interface', 'dom', '']),
250 self._database, self._emitters, self._output_dir) 255 self._database, self._emitters, self._output_dir)
251 self._systems.append(interface_system) 256 self._systems.append(interface_system)
252 257
253 if 'native' in systems: 258 if 'native' in systems:
254 native_system = NativeImplementationSystem( 259 native_system = NativeImplementationSystem(
255 TemplateLoader(self._template_dir, ['dom/native', 'dom', '']), 260 TemplateLoader(self._template_dir, ['dom/native', 'dom', '']),
256 self._database, self._emitters, self._auxiliary_dir, 261 self._database, self._emitters, self._auxiliary_dir,
(...skipping 30 matching lines...) Expand all
287 self._systems.append(frog_system) 292 self._systems.append(frog_system)
288 293
289 if 'htmlfrog' in systems: 294 if 'htmlfrog' in systems:
290 html_system = HtmlFrogSystem( 295 html_system = HtmlFrogSystem(
291 TemplateLoader(self._template_dir, 296 TemplateLoader(self._template_dir,
292 ['html/frog', 'html/impl', 'html', ''], 297 ['html/frog', 'html/impl', 'html', ''],
293 {'DARTIUM': False, 'FROG': True}), 298 {'DARTIUM': False, 'FROG': True}),
294 self._database, self._emitters, self._output_dir, self) 299 self._database, self._emitters, self._output_dir, self)
295 300
296 html_system._interface_system = html_interface_system 301 html_system._interface_system = html_interface_system
302 html_system._cross_frame_system = html_cross_frame_system
297 self._systems.append(html_system) 303 self._systems.append(html_system)
298 304
299 if 'htmldartium' in systems: 305 if 'htmldartium' in systems:
300 html_system = HtmlDartiumSystem( 306 html_system = HtmlDartiumSystem(
301 TemplateLoader(self._template_dir, 307 TemplateLoader(self._template_dir,
302 ['html/dartium', 'html/impl', 'html', ''], 308 ['html/dartium', 'html/impl', 'html', ''],
303 {'DARTIUM': True, 'FROG': False}), 309 {'DARTIUM': True, 'FROG': False}),
304 self._database, self._emitters, self._auxiliary_dir, 310 self._database, self._emitters, self._auxiliary_dir,
305 self._output_dir, self) 311 self._output_dir, self)
306 312
307 html_system._interface_system = html_interface_system 313 html_system._interface_system = html_interface_system
314 html_system._cross_frame_system = html_cross_frame_system
308 self._systems.append(html_system) 315 self._systems.append(html_system)
309 316
310 # Collect interfaces 317 # Collect interfaces
311 interfaces = [] 318 interfaces = []
312 for interface in database.GetInterfaces(): 319 for interface in database.GetInterfaces():
313 if not MatchSourceFilter(source_filter, interface): 320 if not MatchSourceFilter(source_filter, interface):
314 # Skip this interface since it's not present in the required source 321 # Skip this interface since it's not present in the required source
315 _logger.info('Omitting interface - %s' % interface.id) 322 _logger.info('Omitting interface - %s' % interface.id)
316 continue 323 continue
317 interfaces.append(interface) 324 interfaces.append(interface)
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 pass 646 pass
640 647
641 def AddOperation(self, info): 648 def AddOperation(self, info):
642 pass 649 pass
643 650
644 def AddStaticOperation(self, info): 651 def AddStaticOperation(self, info):
645 pass 652 pass
646 653
647 def AddEventAttributes(self, event_attrs): 654 def AddEventAttributes(self, event_attrs):
648 pass 655 pass
OLDNEW
« no previous file with comments | « no previous file | lib/dom/scripts/systemhtml.py » ('j') | lib/dom/scripts/systemhtml.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698