| OLD | NEW |
| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 | 371 |
| 372 def IsInterfaceRequestKind(kind): | 372 def IsInterfaceRequestKind(kind): |
| 373 return isinstance(kind, InterfaceRequest) | 373 return isinstance(kind, InterfaceRequest) |
| 374 | 374 |
| 375 | 375 |
| 376 def IsEnumKind(kind): | 376 def IsEnumKind(kind): |
| 377 return isinstance(kind, Enum) | 377 return isinstance(kind, Enum) |
| 378 | 378 |
| 379 | 379 |
| 380 def IsReferenceKind(kind): |
| 381 return isinstance(kind, ReferenceKind) |
| 382 |
| 383 |
| 380 def IsNullableKind(kind): | 384 def IsNullableKind(kind): |
| 381 return isinstance(kind, ReferenceKind) and kind.is_nullable | 385 return IsReferenceKind(kind) and kind.is_nullable |
| 382 | 386 |
| 383 | 387 |
| 384 def IsAnyArrayKind(kind): | 388 def IsAnyArrayKind(kind): |
| 385 return IsArrayKind(kind) or IsFixedArrayKind(kind) | 389 return IsArrayKind(kind) or IsFixedArrayKind(kind) |
| 386 | 390 |
| 387 | 391 |
| 388 def IsObjectKind(kind): | 392 def IsObjectKind(kind): |
| 389 return IsStructKind(kind) or IsAnyArrayKind(kind) or IsStringKind(kind) | 393 return IsStructKind(kind) or IsAnyArrayKind(kind) or IsStringKind(kind) |
| 390 | 394 |
| 391 | 395 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 406 def IsMoveOnlyKind(kind): | 410 def IsMoveOnlyKind(kind): |
| 407 return IsObjectKind(kind) or IsAnyHandleKind(kind) | 411 return IsObjectKind(kind) or IsAnyHandleKind(kind) |
| 408 | 412 |
| 409 | 413 |
| 410 def HasCallbacks(interface): | 414 def HasCallbacks(interface): |
| 411 for method in interface.methods: | 415 for method in interface.methods: |
| 412 if method.response_parameters != None: | 416 if method.response_parameters != None: |
| 413 return True | 417 return True |
| 414 return False | 418 return False |
| 415 | 419 |
| OLD | NEW |