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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 def IsAnyHandleOrInterfaceKind(kind): | 785 def IsAnyHandleOrInterfaceKind(kind): |
786 return (IsAnyHandleKind(kind) or IsInterfaceKind(kind) or | 786 return (IsAnyHandleKind(kind) or IsInterfaceKind(kind) or |
787 IsAssociatedKind(kind)) | 787 IsAssociatedKind(kind)) |
788 | 788 |
789 | 789 |
790 def IsAssociatedKind(kind): | 790 def IsAssociatedKind(kind): |
791 return (IsAssociatedInterfaceKind(kind) or | 791 return (IsAssociatedInterfaceKind(kind) or |
792 IsAssociatedInterfaceRequestKind(kind)) | 792 IsAssociatedInterfaceRequestKind(kind)) |
793 | 793 |
794 | 794 |
795 def IsMoveOnlyKind(kind): | |
796 return (not IsStringKind(kind) and IsObjectKind(kind)) or \ | |
797 IsAnyHandleKind(kind) or IsInterfaceKind(kind) or IsAssociatedKind(kind) | |
798 | |
799 | |
800 def HasCallbacks(interface): | 795 def HasCallbacks(interface): |
801 for method in interface.methods: | 796 for method in interface.methods: |
802 if method.response_parameters != None: | 797 if method.response_parameters != None: |
803 return True | 798 return True |
804 return False | 799 return False |
805 | 800 |
806 | 801 |
807 # Finds out whether an interface passes associated interfaces and associated | 802 # Finds out whether an interface passes associated interfaces and associated |
808 # interface requests. | 803 # interface requests. |
809 def PassesAssociatedKinds(interface): | 804 def PassesAssociatedKinds(interface): |
(...skipping 26 matching lines...) Expand all Loading... |
836 if _ContainsAssociatedKinds(param.kind, visited_kinds): | 831 if _ContainsAssociatedKinds(param.kind, visited_kinds): |
837 return True | 832 return True |
838 return False | 833 return False |
839 | 834 |
840 | 835 |
841 def HasSyncMethods(interface): | 836 def HasSyncMethods(interface): |
842 for method in interface.methods: | 837 for method in interface.methods: |
843 if method.sync: | 838 if method.sync: |
844 return True | 839 return True |
845 return False | 840 return False |
OLD | NEW |