OLD | NEW |
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 library process_mojom; | 5 library process_mojom; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
10 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; | 10 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; |
11 import 'package:mojo_services/mojo/files/types.mojom.dart' as types_mojom; | 11 import 'package:mojo_services/mojo/files/types.mojom.dart' as types_mojom; |
12 | 12 |
13 | 13 |
14 | 14 |
15 class _ProcessSpawnParams extends bindings.Struct { | 15 class _ProcessSpawnParams extends bindings.Struct { |
16 static const List<bindings.StructDataHeader> kVersions = const [ | 16 static const List<bindings.StructDataHeader> kVersions = const [ |
17 const bindings.StructDataHeader(64, 0) | 17 const bindings.StructDataHeader(64, 0) |
18 ]; | 18 ]; |
19 List<int> path = null; | 19 List<int> path = null; |
20 List<List<int>> argv = null; | 20 List<List<int>> argv = null; |
21 List<List<int>> envp = null; | 21 List<List<int>> envp = null; |
22 Object stdinFile = null; | 22 file_mojom.FileInterface stdinFile = null; |
23 Object stdoutFile = null; | 23 file_mojom.FileInterface stdoutFile = null; |
24 Object stderrFile = null; | 24 file_mojom.FileInterface stderrFile = null; |
25 Object processController = null; | 25 ProcessControllerInterfaceRequest processController = null; |
26 | 26 |
27 _ProcessSpawnParams() : super(kVersions.last.size); | 27 _ProcessSpawnParams() : super(kVersions.last.size); |
28 | 28 |
29 static _ProcessSpawnParams deserialize(bindings.Message message) { | 29 static _ProcessSpawnParams deserialize(bindings.Message message) { |
30 var decoder = new bindings.Decoder(message); | 30 var decoder = new bindings.Decoder(message); |
31 var result = decode(decoder); | 31 var result = decode(decoder); |
32 if (decoder.excessHandles != null) { | 32 if (decoder.excessHandles != null) { |
33 decoder.excessHandles.forEach((h) => h.close()); | 33 decoder.excessHandles.forEach((h) => h.close()); |
34 } | 34 } |
35 return result; | 35 return result; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 | 272 |
273 | 273 |
274 class _ProcessSpawnWithTerminalParams extends bindings.Struct { | 274 class _ProcessSpawnWithTerminalParams extends bindings.Struct { |
275 static const List<bindings.StructDataHeader> kVersions = const [ | 275 static const List<bindings.StructDataHeader> kVersions = const [ |
276 const bindings.StructDataHeader(48, 0) | 276 const bindings.StructDataHeader(48, 0) |
277 ]; | 277 ]; |
278 List<int> path = null; | 278 List<int> path = null; |
279 List<List<int>> argv = null; | 279 List<List<int>> argv = null; |
280 List<List<int>> envp = null; | 280 List<List<int>> envp = null; |
281 Object terminalFile = null; | 281 file_mojom.FileInterface terminalFile = null; |
282 Object processController = null; | 282 ProcessControllerInterfaceRequest processController = null; |
283 | 283 |
284 _ProcessSpawnWithTerminalParams() : super(kVersions.last.size); | 284 _ProcessSpawnWithTerminalParams() : super(kVersions.last.size); |
285 | 285 |
286 static _ProcessSpawnWithTerminalParams deserialize(bindings.Message message) { | 286 static _ProcessSpawnWithTerminalParams deserialize(bindings.Message message) { |
287 var decoder = new bindings.Decoder(message); | 287 var decoder = new bindings.Decoder(message); |
288 var result = decode(decoder); | 288 var result = decode(decoder); |
289 if (decoder.excessHandles != null) { | 289 if (decoder.excessHandles != null) { |
290 decoder.excessHandles.forEach((h) => h.close()); | 290 decoder.excessHandles.forEach((h) => h.close()); |
291 } | 291 } |
292 return result; | 292 return result; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 | 808 |
809 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 809 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
810 responseFactory(null); | 810 responseFactory(null); |
811 | 811 |
812 dynamic getAllTypeDefinitions([Function responseFactory]) => | 812 dynamic getAllTypeDefinitions([Function responseFactory]) => |
813 responseFactory(null); | 813 responseFactory(null); |
814 } | 814 } |
815 | 815 |
816 abstract class Process { | 816 abstract class Process { |
817 static const String serviceName = "native_support::Process"; | 817 static const String serviceName = "native_support::Process"; |
818 dynamic spawn(List<int> path,List<List<int>> argv,List<List<int>> envp,Object
stdinFile,Object stdoutFile,Object stderrFile,Object processController,[Function
responseFactory = null]); | 818 |
819 dynamic spawnWithTerminal(List<int> path,List<List<int>> argv,List<List<int>>
envp,Object terminalFile,Object processController,[Function responseFactory = nu
ll]); | 819 static service_describer.ServiceDescription _cachedServiceDescription; |
| 820 static service_describer.ServiceDescription get serviceDescription { |
| 821 if (_cachedServiceDescription == null) { |
| 822 _cachedServiceDescription = new _ProcessServiceDescription(); |
| 823 } |
| 824 return _cachedServiceDescription; |
| 825 } |
| 826 |
| 827 static ProcessProxy connectToService( |
| 828 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 829 ProcessProxy p = new ProcessProxy.unbound(); |
| 830 String name = serviceName ?? Process.serviceName; |
| 831 if ((name == null) || name.isEmpty) { |
| 832 throw new core.MojoApiError( |
| 833 "If an interface has no ServiceName, then one must be provided."); |
| 834 } |
| 835 s.connectToService(url, p, name); |
| 836 return p; |
| 837 } |
| 838 dynamic spawn(List<int> path,List<List<int>> argv,List<List<int>> envp,file_mo
jom.FileInterface stdinFile,file_mojom.FileInterface stdoutFile,file_mojom.FileI
nterface stderrFile,ProcessControllerInterfaceRequest processController,[Functio
n responseFactory = null]); |
| 839 dynamic spawnWithTerminal(List<int> path,List<List<int>> argv,List<List<int>>
envp,file_mojom.FileInterface terminalFile,ProcessControllerInterfaceRequest pro
cessController,[Function responseFactory = null]); |
| 840 } |
| 841 |
| 842 abstract class ProcessInterface |
| 843 implements bindings.MojoInterface<Process>, |
| 844 Process { |
| 845 factory ProcessInterface([Process impl]) => |
| 846 new ProcessStub.unbound(impl); |
| 847 factory ProcessInterface.fromEndpoint( |
| 848 core.MojoMessagePipeEndpoint endpoint, |
| 849 [Process impl]) => |
| 850 new ProcessStub.fromEndpoint(endpoint, impl); |
| 851 } |
| 852 |
| 853 abstract class ProcessInterfaceRequest |
| 854 implements bindings.MojoInterface<Process>, |
| 855 Process { |
| 856 factory ProcessInterfaceRequest() => |
| 857 new ProcessProxy.unbound(); |
820 } | 858 } |
821 | 859 |
822 class _ProcessProxyControl | 860 class _ProcessProxyControl |
823 extends bindings.ProxyMessageHandler | 861 extends bindings.ProxyMessageHandler |
824 implements bindings.ProxyControl { | 862 implements bindings.ProxyControl<Process> { |
825 _ProcessProxyControl.fromEndpoint( | 863 _ProcessProxyControl.fromEndpoint( |
826 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 864 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
827 | 865 |
828 _ProcessProxyControl.fromHandle( | 866 _ProcessProxyControl.fromHandle( |
829 core.MojoHandle handle) : super.fromHandle(handle); | 867 core.MojoHandle handle) : super.fromHandle(handle); |
830 | 868 |
831 _ProcessProxyControl.unbound() : super.unbound(); | 869 _ProcessProxyControl.unbound() : super.unbound(); |
832 | 870 |
833 service_describer.ServiceDescription get serviceDescription => | |
834 new _ProcessServiceDescription(); | |
835 | |
836 String get serviceName => Process.serviceName; | 871 String get serviceName => Process.serviceName; |
837 | 872 |
838 void handleResponse(bindings.ServiceMessage message) { | 873 void handleResponse(bindings.ServiceMessage message) { |
839 switch (message.header.type) { | 874 switch (message.header.type) { |
840 case _processMethodSpawnName: | 875 case _processMethodSpawnName: |
841 var r = ProcessSpawnResponseParams.deserialize( | 876 var r = ProcessSpawnResponseParams.deserialize( |
842 message.payload); | 877 message.payload); |
843 if (!message.header.hasRequestId) { | 878 if (!message.header.hasRequestId) { |
844 proxyError("Expected a message with a valid request Id."); | 879 proxyError("Expected a message with a valid request Id."); |
845 return; | 880 return; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 } | 912 } |
878 c.complete(r); | 913 c.complete(r); |
879 break; | 914 break; |
880 default: | 915 default: |
881 proxyError("Unexpected message type: ${message.header.type}"); | 916 proxyError("Unexpected message type: ${message.header.type}"); |
882 close(immediate: true); | 917 close(immediate: true); |
883 break; | 918 break; |
884 } | 919 } |
885 } | 920 } |
886 | 921 |
| 922 Process get impl => null; |
| 923 set impl(Process _) { |
| 924 throw new core.MojoApiError("The impl of a Proxy cannot be set."); |
| 925 } |
| 926 |
887 @override | 927 @override |
888 String toString() { | 928 String toString() { |
889 var superString = super.toString(); | 929 var superString = super.toString(); |
890 return "_ProcessProxyControl($superString)"; | 930 return "_ProcessProxyControl($superString)"; |
891 } | 931 } |
892 } | 932 } |
893 | 933 |
894 class ProcessProxy | 934 class ProcessProxy |
895 extends bindings.Proxy | 935 extends bindings.Proxy<Process> |
896 implements Process { | 936 implements Process, |
| 937 ProcessInterface, |
| 938 ProcessInterfaceRequest { |
897 ProcessProxy.fromEndpoint( | 939 ProcessProxy.fromEndpoint( |
898 core.MojoMessagePipeEndpoint endpoint) | 940 core.MojoMessagePipeEndpoint endpoint) |
899 : super(new _ProcessProxyControl.fromEndpoint(endpoint)); | 941 : super(new _ProcessProxyControl.fromEndpoint(endpoint)); |
900 | 942 |
901 ProcessProxy.fromHandle(core.MojoHandle handle) | 943 ProcessProxy.fromHandle(core.MojoHandle handle) |
902 : super(new _ProcessProxyControl.fromHandle(handle)); | 944 : super(new _ProcessProxyControl.fromHandle(handle)); |
903 | 945 |
904 ProcessProxy.unbound() | 946 ProcessProxy.unbound() |
905 : super(new _ProcessProxyControl.unbound()); | 947 : super(new _ProcessProxyControl.unbound()); |
906 | 948 |
907 static ProcessProxy newFromEndpoint( | 949 static ProcessProxy newFromEndpoint( |
908 core.MojoMessagePipeEndpoint endpoint) { | 950 core.MojoMessagePipeEndpoint endpoint) { |
909 assert(endpoint.setDescription("For ProcessProxy")); | 951 assert(endpoint.setDescription("For ProcessProxy")); |
910 return new ProcessProxy.fromEndpoint(endpoint); | 952 return new ProcessProxy.fromEndpoint(endpoint); |
911 } | 953 } |
912 | 954 |
913 factory ProcessProxy.connectToService( | |
914 bindings.ServiceConnector s, String url, [String serviceName]) { | |
915 ProcessProxy p = new ProcessProxy.unbound(); | |
916 s.connectToService(url, p, serviceName); | |
917 return p; | |
918 } | |
919 | 955 |
920 | 956 dynamic spawn(List<int> path,List<List<int>> argv,List<List<int>> envp,file_mo
jom.FileInterface stdinFile,file_mojom.FileInterface stdoutFile,file_mojom.FileI
nterface stderrFile,ProcessControllerInterfaceRequest processController,[Functio
n responseFactory = null]) { |
921 dynamic spawn(List<int> path,List<List<int>> argv,List<List<int>> envp,Object
stdinFile,Object stdoutFile,Object stderrFile,Object processController,[Function
responseFactory = null]) { | |
922 var params = new _ProcessSpawnParams(); | 957 var params = new _ProcessSpawnParams(); |
923 params.path = path; | 958 params.path = path; |
924 params.argv = argv; | 959 params.argv = argv; |
925 params.envp = envp; | 960 params.envp = envp; |
926 params.stdinFile = stdinFile; | 961 params.stdinFile = stdinFile; |
927 params.stdoutFile = stdoutFile; | 962 params.stdoutFile = stdoutFile; |
928 params.stderrFile = stderrFile; | 963 params.stderrFile = stderrFile; |
929 params.processController = processController; | 964 params.processController = processController; |
930 return ctrl.sendMessageWithRequestId( | 965 return ctrl.sendMessageWithRequestId( |
931 params, | 966 params, |
932 _processMethodSpawnName, | 967 _processMethodSpawnName, |
933 -1, | 968 -1, |
934 bindings.MessageHeader.kMessageExpectsResponse); | 969 bindings.MessageHeader.kMessageExpectsResponse); |
935 } | 970 } |
936 dynamic spawnWithTerminal(List<int> path,List<List<int>> argv,List<List<int>>
envp,Object terminalFile,Object processController,[Function responseFactory = nu
ll]) { | 971 dynamic spawnWithTerminal(List<int> path,List<List<int>> argv,List<List<int>>
envp,file_mojom.FileInterface terminalFile,ProcessControllerInterfaceRequest pro
cessController,[Function responseFactory = null]) { |
937 var params = new _ProcessSpawnWithTerminalParams(); | 972 var params = new _ProcessSpawnWithTerminalParams(); |
938 params.path = path; | 973 params.path = path; |
939 params.argv = argv; | 974 params.argv = argv; |
940 params.envp = envp; | 975 params.envp = envp; |
941 params.terminalFile = terminalFile; | 976 params.terminalFile = terminalFile; |
942 params.processController = processController; | 977 params.processController = processController; |
943 return ctrl.sendMessageWithRequestId( | 978 return ctrl.sendMessageWithRequestId( |
944 params, | 979 params, |
945 _processMethodSpawnWithTerminalName, | 980 _processMethodSpawnWithTerminalName, |
946 -1, | 981 -1, |
(...skipping 13 matching lines...) Expand all Loading... |
960 } | 995 } |
961 | 996 |
962 _ProcessStubControl.fromHandle( | 997 _ProcessStubControl.fromHandle( |
963 core.MojoHandle handle, [Process impl]) | 998 core.MojoHandle handle, [Process impl]) |
964 : super.fromHandle(handle, autoBegin: impl != null) { | 999 : super.fromHandle(handle, autoBegin: impl != null) { |
965 _impl = impl; | 1000 _impl = impl; |
966 } | 1001 } |
967 | 1002 |
968 _ProcessStubControl.unbound([this._impl]) : super.unbound(); | 1003 _ProcessStubControl.unbound([this._impl]) : super.unbound(); |
969 | 1004 |
| 1005 String get serviceName => Process.serviceName; |
| 1006 |
970 | 1007 |
971 ProcessSpawnResponseParams _processSpawnResponseParamsFactory(types_mojom.Erro
r error) { | 1008 ProcessSpawnResponseParams _processSpawnResponseParamsFactory(types_mojom.Erro
r error) { |
972 var result = new ProcessSpawnResponseParams(); | 1009 var result = new ProcessSpawnResponseParams(); |
973 result.error = error; | 1010 result.error = error; |
974 return result; | 1011 return result; |
975 } | 1012 } |
976 ProcessSpawnWithTerminalResponseParams _processSpawnWithTerminalResponseParams
Factory(types_mojom.Error error) { | 1013 ProcessSpawnWithTerminalResponseParams _processSpawnWithTerminalResponseParams
Factory(types_mojom.Error error) { |
977 var result = new ProcessSpawnWithTerminalResponseParams(); | 1014 var result = new ProcessSpawnWithTerminalResponseParams(); |
978 result.error = error; | 1015 result.error = error; |
979 return result; | 1016 return result; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 } | 1096 } |
1060 } | 1097 } |
1061 | 1098 |
1062 @override | 1099 @override |
1063 String toString() { | 1100 String toString() { |
1064 var superString = super.toString(); | 1101 var superString = super.toString(); |
1065 return "_ProcessStubControl($superString)"; | 1102 return "_ProcessStubControl($superString)"; |
1066 } | 1103 } |
1067 | 1104 |
1068 int get version => 0; | 1105 int get version => 0; |
1069 | |
1070 static service_describer.ServiceDescription _cachedServiceDescription; | |
1071 static service_describer.ServiceDescription get serviceDescription { | |
1072 if (_cachedServiceDescription == null) { | |
1073 _cachedServiceDescription = new _ProcessServiceDescription(); | |
1074 } | |
1075 return _cachedServiceDescription; | |
1076 } | |
1077 } | 1106 } |
1078 | 1107 |
1079 class ProcessStub | 1108 class ProcessStub |
1080 extends bindings.Stub<Process> | 1109 extends bindings.Stub<Process> |
1081 implements Process { | 1110 implements Process, |
| 1111 ProcessInterface, |
| 1112 ProcessInterfaceRequest { |
| 1113 ProcessStub.unbound([Process impl]) |
| 1114 : super(new _ProcessStubControl.unbound(impl)); |
| 1115 |
1082 ProcessStub.fromEndpoint( | 1116 ProcessStub.fromEndpoint( |
1083 core.MojoMessagePipeEndpoint endpoint, [Process impl]) | 1117 core.MojoMessagePipeEndpoint endpoint, [Process impl]) |
1084 : super(new _ProcessStubControl.fromEndpoint(endpoint, impl)); | 1118 : super(new _ProcessStubControl.fromEndpoint(endpoint, impl)); |
1085 | 1119 |
1086 ProcessStub.fromHandle( | 1120 ProcessStub.fromHandle( |
1087 core.MojoHandle handle, [Process impl]) | 1121 core.MojoHandle handle, [Process impl]) |
1088 : super(new _ProcessStubControl.fromHandle(handle, impl)); | 1122 : super(new _ProcessStubControl.fromHandle(handle, impl)); |
1089 | 1123 |
1090 ProcessStub.unbound([Process impl]) | |
1091 : super(new _ProcessStubControl.unbound(impl)); | |
1092 | |
1093 static ProcessStub newFromEndpoint( | 1124 static ProcessStub newFromEndpoint( |
1094 core.MojoMessagePipeEndpoint endpoint) { | 1125 core.MojoMessagePipeEndpoint endpoint) { |
1095 assert(endpoint.setDescription("For ProcessStub")); | 1126 assert(endpoint.setDescription("For ProcessStub")); |
1096 return new ProcessStub.fromEndpoint(endpoint); | 1127 return new ProcessStub.fromEndpoint(endpoint); |
1097 } | 1128 } |
1098 | 1129 |
1099 static service_describer.ServiceDescription get serviceDescription => | |
1100 _ProcessStubControl.serviceDescription; | |
1101 | 1130 |
1102 | 1131 dynamic spawn(List<int> path,List<List<int>> argv,List<List<int>> envp,file_mo
jom.FileInterface stdinFile,file_mojom.FileInterface stdoutFile,file_mojom.FileI
nterface stderrFile,ProcessControllerInterfaceRequest processController,[Functio
n responseFactory = null]) { |
1103 dynamic spawn(List<int> path,List<List<int>> argv,List<List<int>> envp,Object
stdinFile,Object stdoutFile,Object stderrFile,Object processController,[Function
responseFactory = null]) { | |
1104 return impl.spawn(path,argv,envp,stdinFile,stdoutFile,stderrFile,processCont
roller,responseFactory); | 1132 return impl.spawn(path,argv,envp,stdinFile,stdoutFile,stderrFile,processCont
roller,responseFactory); |
1105 } | 1133 } |
1106 dynamic spawnWithTerminal(List<int> path,List<List<int>> argv,List<List<int>>
envp,Object terminalFile,Object processController,[Function responseFactory = nu
ll]) { | 1134 dynamic spawnWithTerminal(List<int> path,List<List<int>> argv,List<List<int>>
envp,file_mojom.FileInterface terminalFile,ProcessControllerInterfaceRequest pro
cessController,[Function responseFactory = null]) { |
1107 return impl.spawnWithTerminal(path,argv,envp,terminalFile,processController,
responseFactory); | 1135 return impl.spawnWithTerminal(path,argv,envp,terminalFile,processController,
responseFactory); |
1108 } | 1136 } |
1109 } | 1137 } |
1110 | 1138 |
1111 const int _processControllerMethodWaitName = 0; | 1139 const int _processControllerMethodWaitName = 0; |
1112 const int _processControllerMethodKillName = 1; | 1140 const int _processControllerMethodKillName = 1; |
1113 | 1141 |
1114 class _ProcessControllerServiceDescription implements service_describer.ServiceD
escription { | 1142 class _ProcessControllerServiceDescription implements service_describer.ServiceD
escription { |
1115 dynamic getTopLevelInterface([Function responseFactory]) => | 1143 dynamic getTopLevelInterface([Function responseFactory]) => |
1116 responseFactory(null); | 1144 responseFactory(null); |
1117 | 1145 |
1118 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1146 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
1119 responseFactory(null); | 1147 responseFactory(null); |
1120 | 1148 |
1121 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1149 dynamic getAllTypeDefinitions([Function responseFactory]) => |
1122 responseFactory(null); | 1150 responseFactory(null); |
1123 } | 1151 } |
1124 | 1152 |
1125 abstract class ProcessController { | 1153 abstract class ProcessController { |
1126 static const String serviceName = null; | 1154 static const String serviceName = null; |
| 1155 |
| 1156 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1157 static service_describer.ServiceDescription get serviceDescription { |
| 1158 if (_cachedServiceDescription == null) { |
| 1159 _cachedServiceDescription = new _ProcessControllerServiceDescription(); |
| 1160 } |
| 1161 return _cachedServiceDescription; |
| 1162 } |
| 1163 |
| 1164 static ProcessControllerProxy connectToService( |
| 1165 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 1166 ProcessControllerProxy p = new ProcessControllerProxy.unbound(); |
| 1167 String name = serviceName ?? ProcessController.serviceName; |
| 1168 if ((name == null) || name.isEmpty) { |
| 1169 throw new core.MojoApiError( |
| 1170 "If an interface has no ServiceName, then one must be provided."); |
| 1171 } |
| 1172 s.connectToService(url, p, name); |
| 1173 return p; |
| 1174 } |
1127 dynamic wait([Function responseFactory = null]); | 1175 dynamic wait([Function responseFactory = null]); |
1128 dynamic kill(int signal,[Function responseFactory = null]); | 1176 dynamic kill(int signal,[Function responseFactory = null]); |
1129 } | 1177 } |
1130 | 1178 |
| 1179 abstract class ProcessControllerInterface |
| 1180 implements bindings.MojoInterface<ProcessController>, |
| 1181 ProcessController { |
| 1182 factory ProcessControllerInterface([ProcessController impl]) => |
| 1183 new ProcessControllerStub.unbound(impl); |
| 1184 factory ProcessControllerInterface.fromEndpoint( |
| 1185 core.MojoMessagePipeEndpoint endpoint, |
| 1186 [ProcessController impl]) => |
| 1187 new ProcessControllerStub.fromEndpoint(endpoint, impl); |
| 1188 } |
| 1189 |
| 1190 abstract class ProcessControllerInterfaceRequest |
| 1191 implements bindings.MojoInterface<ProcessController>, |
| 1192 ProcessController { |
| 1193 factory ProcessControllerInterfaceRequest() => |
| 1194 new ProcessControllerProxy.unbound(); |
| 1195 } |
| 1196 |
1131 class _ProcessControllerProxyControl | 1197 class _ProcessControllerProxyControl |
1132 extends bindings.ProxyMessageHandler | 1198 extends bindings.ProxyMessageHandler |
1133 implements bindings.ProxyControl { | 1199 implements bindings.ProxyControl<ProcessController> { |
1134 _ProcessControllerProxyControl.fromEndpoint( | 1200 _ProcessControllerProxyControl.fromEndpoint( |
1135 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1201 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1136 | 1202 |
1137 _ProcessControllerProxyControl.fromHandle( | 1203 _ProcessControllerProxyControl.fromHandle( |
1138 core.MojoHandle handle) : super.fromHandle(handle); | 1204 core.MojoHandle handle) : super.fromHandle(handle); |
1139 | 1205 |
1140 _ProcessControllerProxyControl.unbound() : super.unbound(); | 1206 _ProcessControllerProxyControl.unbound() : super.unbound(); |
1141 | 1207 |
1142 service_describer.ServiceDescription get serviceDescription => | |
1143 new _ProcessControllerServiceDescription(); | |
1144 | |
1145 String get serviceName => ProcessController.serviceName; | 1208 String get serviceName => ProcessController.serviceName; |
1146 | 1209 |
1147 void handleResponse(bindings.ServiceMessage message) { | 1210 void handleResponse(bindings.ServiceMessage message) { |
1148 switch (message.header.type) { | 1211 switch (message.header.type) { |
1149 case _processControllerMethodWaitName: | 1212 case _processControllerMethodWaitName: |
1150 var r = ProcessControllerWaitResponseParams.deserialize( | 1213 var r = ProcessControllerWaitResponseParams.deserialize( |
1151 message.payload); | 1214 message.payload); |
1152 if (!message.header.hasRequestId) { | 1215 if (!message.header.hasRequestId) { |
1153 proxyError("Expected a message with a valid request Id."); | 1216 proxyError("Expected a message with a valid request Id."); |
1154 return; | 1217 return; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 } | 1249 } |
1187 c.complete(r); | 1250 c.complete(r); |
1188 break; | 1251 break; |
1189 default: | 1252 default: |
1190 proxyError("Unexpected message type: ${message.header.type}"); | 1253 proxyError("Unexpected message type: ${message.header.type}"); |
1191 close(immediate: true); | 1254 close(immediate: true); |
1192 break; | 1255 break; |
1193 } | 1256 } |
1194 } | 1257 } |
1195 | 1258 |
| 1259 ProcessController get impl => null; |
| 1260 set impl(ProcessController _) { |
| 1261 throw new core.MojoApiError("The impl of a Proxy cannot be set."); |
| 1262 } |
| 1263 |
1196 @override | 1264 @override |
1197 String toString() { | 1265 String toString() { |
1198 var superString = super.toString(); | 1266 var superString = super.toString(); |
1199 return "_ProcessControllerProxyControl($superString)"; | 1267 return "_ProcessControllerProxyControl($superString)"; |
1200 } | 1268 } |
1201 } | 1269 } |
1202 | 1270 |
1203 class ProcessControllerProxy | 1271 class ProcessControllerProxy |
1204 extends bindings.Proxy | 1272 extends bindings.Proxy<ProcessController> |
1205 implements ProcessController { | 1273 implements ProcessController, |
| 1274 ProcessControllerInterface, |
| 1275 ProcessControllerInterfaceRequest { |
1206 ProcessControllerProxy.fromEndpoint( | 1276 ProcessControllerProxy.fromEndpoint( |
1207 core.MojoMessagePipeEndpoint endpoint) | 1277 core.MojoMessagePipeEndpoint endpoint) |
1208 : super(new _ProcessControllerProxyControl.fromEndpoint(endpoint)); | 1278 : super(new _ProcessControllerProxyControl.fromEndpoint(endpoint)); |
1209 | 1279 |
1210 ProcessControllerProxy.fromHandle(core.MojoHandle handle) | 1280 ProcessControllerProxy.fromHandle(core.MojoHandle handle) |
1211 : super(new _ProcessControllerProxyControl.fromHandle(handle)); | 1281 : super(new _ProcessControllerProxyControl.fromHandle(handle)); |
1212 | 1282 |
1213 ProcessControllerProxy.unbound() | 1283 ProcessControllerProxy.unbound() |
1214 : super(new _ProcessControllerProxyControl.unbound()); | 1284 : super(new _ProcessControllerProxyControl.unbound()); |
1215 | 1285 |
1216 static ProcessControllerProxy newFromEndpoint( | 1286 static ProcessControllerProxy newFromEndpoint( |
1217 core.MojoMessagePipeEndpoint endpoint) { | 1287 core.MojoMessagePipeEndpoint endpoint) { |
1218 assert(endpoint.setDescription("For ProcessControllerProxy")); | 1288 assert(endpoint.setDescription("For ProcessControllerProxy")); |
1219 return new ProcessControllerProxy.fromEndpoint(endpoint); | 1289 return new ProcessControllerProxy.fromEndpoint(endpoint); |
1220 } | 1290 } |
1221 | 1291 |
1222 factory ProcessControllerProxy.connectToService( | |
1223 bindings.ServiceConnector s, String url, [String serviceName]) { | |
1224 ProcessControllerProxy p = new ProcessControllerProxy.unbound(); | |
1225 s.connectToService(url, p, serviceName); | |
1226 return p; | |
1227 } | |
1228 | |
1229 | 1292 |
1230 dynamic wait([Function responseFactory = null]) { | 1293 dynamic wait([Function responseFactory = null]) { |
1231 var params = new _ProcessControllerWaitParams(); | 1294 var params = new _ProcessControllerWaitParams(); |
1232 return ctrl.sendMessageWithRequestId( | 1295 return ctrl.sendMessageWithRequestId( |
1233 params, | 1296 params, |
1234 _processControllerMethodWaitName, | 1297 _processControllerMethodWaitName, |
1235 -1, | 1298 -1, |
1236 bindings.MessageHeader.kMessageExpectsResponse); | 1299 bindings.MessageHeader.kMessageExpectsResponse); |
1237 } | 1300 } |
1238 dynamic kill(int signal,[Function responseFactory = null]) { | 1301 dynamic kill(int signal,[Function responseFactory = null]) { |
(...skipping 19 matching lines...) Expand all Loading... |
1258 } | 1321 } |
1259 | 1322 |
1260 _ProcessControllerStubControl.fromHandle( | 1323 _ProcessControllerStubControl.fromHandle( |
1261 core.MojoHandle handle, [ProcessController impl]) | 1324 core.MojoHandle handle, [ProcessController impl]) |
1262 : super.fromHandle(handle, autoBegin: impl != null) { | 1325 : super.fromHandle(handle, autoBegin: impl != null) { |
1263 _impl = impl; | 1326 _impl = impl; |
1264 } | 1327 } |
1265 | 1328 |
1266 _ProcessControllerStubControl.unbound([this._impl]) : super.unbound(); | 1329 _ProcessControllerStubControl.unbound([this._impl]) : super.unbound(); |
1267 | 1330 |
| 1331 String get serviceName => ProcessController.serviceName; |
| 1332 |
1268 | 1333 |
1269 ProcessControllerWaitResponseParams _processControllerWaitResponseParamsFactor
y(types_mojom.Error error, int exitStatus) { | 1334 ProcessControllerWaitResponseParams _processControllerWaitResponseParamsFactor
y(types_mojom.Error error, int exitStatus) { |
1270 var result = new ProcessControllerWaitResponseParams(); | 1335 var result = new ProcessControllerWaitResponseParams(); |
1271 result.error = error; | 1336 result.error = error; |
1272 result.exitStatus = exitStatus; | 1337 result.exitStatus = exitStatus; |
1273 return result; | 1338 return result; |
1274 } | 1339 } |
1275 ProcessControllerKillResponseParams _processControllerKillResponseParamsFactor
y(types_mojom.Error error) { | 1340 ProcessControllerKillResponseParams _processControllerKillResponseParamsFactor
y(types_mojom.Error error) { |
1276 var result = new ProcessControllerKillResponseParams(); | 1341 var result = new ProcessControllerKillResponseParams(); |
1277 result.error = error; | 1342 result.error = error; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 } | 1421 } |
1357 } | 1422 } |
1358 | 1423 |
1359 @override | 1424 @override |
1360 String toString() { | 1425 String toString() { |
1361 var superString = super.toString(); | 1426 var superString = super.toString(); |
1362 return "_ProcessControllerStubControl($superString)"; | 1427 return "_ProcessControllerStubControl($superString)"; |
1363 } | 1428 } |
1364 | 1429 |
1365 int get version => 0; | 1430 int get version => 0; |
1366 | |
1367 static service_describer.ServiceDescription _cachedServiceDescription; | |
1368 static service_describer.ServiceDescription get serviceDescription { | |
1369 if (_cachedServiceDescription == null) { | |
1370 _cachedServiceDescription = new _ProcessControllerServiceDescription(); | |
1371 } | |
1372 return _cachedServiceDescription; | |
1373 } | |
1374 } | 1431 } |
1375 | 1432 |
1376 class ProcessControllerStub | 1433 class ProcessControllerStub |
1377 extends bindings.Stub<ProcessController> | 1434 extends bindings.Stub<ProcessController> |
1378 implements ProcessController { | 1435 implements ProcessController, |
| 1436 ProcessControllerInterface, |
| 1437 ProcessControllerInterfaceRequest { |
| 1438 ProcessControllerStub.unbound([ProcessController impl]) |
| 1439 : super(new _ProcessControllerStubControl.unbound(impl)); |
| 1440 |
1379 ProcessControllerStub.fromEndpoint( | 1441 ProcessControllerStub.fromEndpoint( |
1380 core.MojoMessagePipeEndpoint endpoint, [ProcessController impl]) | 1442 core.MojoMessagePipeEndpoint endpoint, [ProcessController impl]) |
1381 : super(new _ProcessControllerStubControl.fromEndpoint(endpoint, impl)); | 1443 : super(new _ProcessControllerStubControl.fromEndpoint(endpoint, impl)); |
1382 | 1444 |
1383 ProcessControllerStub.fromHandle( | 1445 ProcessControllerStub.fromHandle( |
1384 core.MojoHandle handle, [ProcessController impl]) | 1446 core.MojoHandle handle, [ProcessController impl]) |
1385 : super(new _ProcessControllerStubControl.fromHandle(handle, impl)); | 1447 : super(new _ProcessControllerStubControl.fromHandle(handle, impl)); |
1386 | 1448 |
1387 ProcessControllerStub.unbound([ProcessController impl]) | |
1388 : super(new _ProcessControllerStubControl.unbound(impl)); | |
1389 | |
1390 static ProcessControllerStub newFromEndpoint( | 1449 static ProcessControllerStub newFromEndpoint( |
1391 core.MojoMessagePipeEndpoint endpoint) { | 1450 core.MojoMessagePipeEndpoint endpoint) { |
1392 assert(endpoint.setDescription("For ProcessControllerStub")); | 1451 assert(endpoint.setDescription("For ProcessControllerStub")); |
1393 return new ProcessControllerStub.fromEndpoint(endpoint); | 1452 return new ProcessControllerStub.fromEndpoint(endpoint); |
1394 } | 1453 } |
1395 | 1454 |
1396 static service_describer.ServiceDescription get serviceDescription => | |
1397 _ProcessControllerStubControl.serviceDescription; | |
1398 | |
1399 | 1455 |
1400 dynamic wait([Function responseFactory = null]) { | 1456 dynamic wait([Function responseFactory = null]) { |
1401 return impl.wait(responseFactory); | 1457 return impl.wait(responseFactory); |
1402 } | 1458 } |
1403 dynamic kill(int signal,[Function responseFactory = null]) { | 1459 dynamic kill(int signal,[Function responseFactory = null]) { |
1404 return impl.kill(signal,responseFactory); | 1460 return impl.kill(signal,responseFactory); |
1405 } | 1461 } |
1406 } | 1462 } |
1407 | 1463 |
1408 | 1464 |
1409 | 1465 |
OLD | NEW |