| 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 terminal_client_mojom; | 5 library terminal_client_mojom; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; |
| 8 | 9 |
| 9 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
| 10 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
| 12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 11 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; | 14 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; |
| 12 | 15 |
| 13 | 16 |
| 14 | 17 |
| 15 class _TerminalClientConnectToTerminalParams extends bindings.Struct { | 18 class _TerminalClientConnectToTerminalParams extends bindings.Struct { |
| 16 static const List<bindings.StructDataHeader> kVersions = const [ | 19 static const List<bindings.StructDataHeader> kVersions = const [ |
| 17 const bindings.StructDataHeader(16, 0) | 20 const bindings.StructDataHeader(16, 0) |
| 18 ]; | 21 ]; |
| 19 Object terminal = null; | 22 Object terminal = null; |
| 20 | 23 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 String toString() { | 72 String toString() { |
| 70 return "_TerminalClientConnectToTerminalParams(" | 73 return "_TerminalClientConnectToTerminalParams(" |
| 71 "terminal: $terminal" ")"; | 74 "terminal: $terminal" ")"; |
| 72 } | 75 } |
| 73 | 76 |
| 74 Map toJson() { | 77 Map toJson() { |
| 75 throw new bindings.MojoCodecError( | 78 throw new bindings.MojoCodecError( |
| 76 'Object containing handles cannot be encoded to JSON.'); | 79 'Object containing handles cannot be encoded to JSON.'); |
| 77 } | 80 } |
| 78 } | 81 } |
| 82 mojom_types.MojomStruct _terminal_client_TerminalClient_ConnectToTerminal_Params
__() { |
| 83 return new mojom_types.MojomStruct() |
| 84 ..declData = (new mojom_types.DeclarationData() |
| 85 ..shortName = '_TerminalClientConnectToTerminalParams' |
| 86 ..fullIdentifier = 'mojo.terminal._TerminalClientConnectToTerminalParams') |
| 87 ..fields = <mojom_types.StructField>[ |
| 88 new mojom_types.StructField() |
| 89 ..declData = (new mojom_types.DeclarationData()..shortName = 'Terminal') |
| 90 ..type = (new mojom_types.Type() |
| 91 ..typeReference = (new mojom_types.TypeReference() |
| 92 |
| 93 ..identifier = '_file_File__' |
| 94 ..typeKey = '_file_File__' |
| 95 )), |
| 96 ]; |
| 97 } |
| 98 |
| 79 | 99 |
| 80 const int _TerminalClient_connectToTerminalName = 0; | 100 const int _TerminalClient_connectToTerminalName = 0; |
| 81 | 101 |
| 102 mojom_types.MojomInterface _terminal_client_TerminalClient__() { |
| 103 return new mojom_types.MojomInterface() |
| 104 ..declData = (new mojom_types.DeclarationData() |
| 105 ..shortName = 'TerminalClient' |
| 106 ..fullIdentifier = 'mojo.terminal.TerminalClient') |
| 107 ..interfaceName = 'TerminalClient' |
| 108 ..methods = <int, mojom_types.MojomMethod>{ |
| 109 _TerminalClient_connectToTerminalName: new mojom_types.MojomMethod() |
| 110 ..declData = (new mojom_types.DeclarationData()..shortName = 'ConnectToT
erminal') |
| 111 ..ordinal = _TerminalClient_connectToTerminalName..parameters = _termina
l_client_TerminalClient_ConnectToTerminal_Params__(), |
| 112 }; |
| 113 } |
| 114 |
| 115 class _TerminalClientServiceDescription implements service_describer.ServiceDesc
ription { |
| 116 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 117 return _terminal_client_TerminalClient__(); |
| 118 } |
| 119 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 120 return getAllMojomTypeDefinitions()[typeKey]; |
| 121 } |
| 122 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 123 return getAllMojomTypeDefinitions(); |
| 124 } |
| 125 } |
| 126 |
| 82 abstract class TerminalClient { | 127 abstract class TerminalClient { |
| 83 static const String serviceName = "mojo::terminal::TerminalClient"; | 128 static const String serviceName = "mojo::terminal::TerminalClient"; |
| 84 void connectToTerminal(Object terminal); | 129 void connectToTerminal(Object terminal); |
| 85 } | 130 } |
| 86 | 131 |
| 87 | 132 |
| 88 class _TerminalClientProxyImpl extends bindings.Proxy { | 133 class _TerminalClientProxyImpl extends bindings.Proxy { |
| 89 _TerminalClientProxyImpl.fromEndpoint( | 134 _TerminalClientProxyImpl.fromEndpoint( |
| 90 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 135 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 91 | 136 |
| 92 _TerminalClientProxyImpl.fromHandle(core.MojoHandle handle) : | 137 _TerminalClientProxyImpl.fromHandle(core.MojoHandle handle) : |
| 93 super.fromHandle(handle); | 138 super.fromHandle(handle); |
| 94 | 139 |
| 95 _TerminalClientProxyImpl.unbound() : super.unbound(); | 140 _TerminalClientProxyImpl.unbound() : super.unbound(); |
| 96 | 141 |
| 97 static _TerminalClientProxyImpl newFromEndpoint( | 142 static _TerminalClientProxyImpl newFromEndpoint( |
| 98 core.MojoMessagePipeEndpoint endpoint) { | 143 core.MojoMessagePipeEndpoint endpoint) { |
| 99 assert(endpoint.setDescription("For _TerminalClientProxyImpl")); | 144 assert(endpoint.setDescription("For _TerminalClientProxyImpl")); |
| 100 return new _TerminalClientProxyImpl.fromEndpoint(endpoint); | 145 return new _TerminalClientProxyImpl.fromEndpoint(endpoint); |
| 101 } | 146 } |
| 102 | 147 |
| 148 service_describer.ServiceDescription get serviceDescription => |
| 149 new _TerminalClientServiceDescription(); |
| 150 |
| 103 void handleResponse(bindings.ServiceMessage message) { | 151 void handleResponse(bindings.ServiceMessage message) { |
| 104 switch (message.header.type) { | 152 switch (message.header.type) { |
| 105 default: | 153 default: |
| 106 proxyError("Unexpected message type: ${message.header.type}"); | 154 proxyError("Unexpected message type: ${message.header.type}"); |
| 107 close(immediate: true); | 155 close(immediate: true); |
| 108 break; | 156 break; |
| 109 } | 157 } |
| 110 } | 158 } |
| 111 | 159 |
| 112 String toString() { | 160 String toString() { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 assert(_impl == null); | 284 assert(_impl == null); |
| 237 _impl = d; | 285 _impl = d; |
| 238 } | 286 } |
| 239 | 287 |
| 240 String toString() { | 288 String toString() { |
| 241 var superString = super.toString(); | 289 var superString = super.toString(); |
| 242 return "TerminalClientStub($superString)"; | 290 return "TerminalClientStub($superString)"; |
| 243 } | 291 } |
| 244 | 292 |
| 245 int get version => 0; | 293 int get version => 0; |
| 294 |
| 295 |
| 296 service_describer.ServiceDescription get serviceDescription => |
| 297 new _TerminalClientServiceDescription(); |
| 246 } | 298 } |
| 247 | 299 |
| 248 | 300 |
| 301 |
| 302 |
| 303 |
| 304 |
| 305 |
| 306 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 307 var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| 308 map["_terminal_client_TerminalClient_ConnectToTerminal_Params__"] = |
| 309 new mojom_types.UserDefinedType() |
| 310 ..structType = _terminal_client_TerminalClient_ConnectToTerminal_Params__(
); |
| 311 map["_terminal_client_TerminalClient__"] = |
| 312 new mojom_types.UserDefinedType() |
| 313 ..interfaceType = _terminal_client_TerminalClient__(); |
| 314 file_mojom.getAllMojomTypeDefinitions().forEach((String s, mojom_types.UserDefin
edType udt) { |
| 315 map[s] = udt; |
| 316 }); |
| 317 |
| 318 return map; |
| 319 } |
| 320 |
| 321 var _MojomDesc; |
| 322 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 323 if (_MojomDesc == null) { |
| 324 _MojomDesc = _initDescriptions(); |
| 325 } |
| 326 return _MojomDesc; |
| 327 } |
| 328 |
| OLD | NEW |