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

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/generate/module.py

Issue 1427893002: Handle contained declarations for interfaces and structs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 # This module's classes provide an interface to mojo modules. Modules are 5 # This module's classes provide an interface to mojo modules. Modules are
6 # collections of interfaces and structs to be used by mojo ipc clients and 6 # collections of interfaces and structs to be used by mojo ipc clients and
7 # servers. 7 # servers.
8 # 8 #
9 # A simple interface would be created this way: 9 # A simple interface would be created this way:
10 # module = mojom.generate.module.Module('Foo') 10 # module = mojom.generate.module.Module('Foo')
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return self.attributes.get(ATTRIBUTE_MIN_VERSION) \ 358 return self.attributes.get(ATTRIBUTE_MIN_VERSION) \
359 if self.attributes else None 359 if self.attributes else None
360 360
361 361
362 class Interface(ReferenceKind): 362 class Interface(ReferenceKind):
363 ReferenceKind.AddSharedProperty('module') 363 ReferenceKind.AddSharedProperty('module')
364 ReferenceKind.AddSharedProperty('name') 364 ReferenceKind.AddSharedProperty('name')
365 ReferenceKind.AddSharedProperty('imported_from') 365 ReferenceKind.AddSharedProperty('imported_from')
366 ReferenceKind.AddSharedProperty('methods') 366 ReferenceKind.AddSharedProperty('methods')
367 ReferenceKind.AddSharedProperty('attributes') 367 ReferenceKind.AddSharedProperty('attributes')
368 ReferenceKind.AddSharedProperty('constants')
369 ReferenceKind.AddSharedProperty('enums')
368 370
369 def __init__(self, name=None, module=None, attributes=None): 371 def __init__(self, name=None, module=None, attributes=None):
370 if name is not None: 372 if name is not None:
371 spec = 'x:' + name 373 spec = 'x:' + name
372 else: 374 else:
373 spec = None 375 spec = None
374 ReferenceKind.__init__(self, spec) 376 ReferenceKind.__init__(self, spec)
375 self.module = module 377 self.module = module
376 self.name = name 378 self.name = name
377 self.imported_from = None 379 self.imported_from = None
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 return False 575 return False
574 576
575 return not ContainsHandles(kind, set()) 577 return not ContainsHandles(kind, set())
576 578
577 579
578 def HasCallbacks(interface): 580 def HasCallbacks(interface):
579 for method in interface.methods: 581 for method in interface.methods:
580 if method.response_parameters != None: 582 if method.response_parameters != None:
581 return True 583 return True
582 return False 584 return False
OLDNEW
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/generate/mojom_translator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698