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 tcp_connected_socket_mojom; | 5 library tcp_connected_socket_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 13 |
12 | 14 |
13 | 15 |
| 16 |
| 17 |
| 18 |
| 19 class _TcpConnectedSocketServiceDescription implements service_describer.Service
Description { |
| 20 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 21 |
| 22 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 23 null; |
| 24 |
| 25 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 26 } |
| 27 |
14 abstract class TcpConnectedSocket { | 28 abstract class TcpConnectedSocket { |
15 static const String serviceName = null; | 29 static const String serviceName = null; |
16 } | 30 } |
17 | 31 |
18 | 32 |
19 class _TcpConnectedSocketProxyImpl extends bindings.Proxy { | 33 class _TcpConnectedSocketProxyImpl extends bindings.Proxy { |
20 _TcpConnectedSocketProxyImpl.fromEndpoint( | 34 _TcpConnectedSocketProxyImpl.fromEndpoint( |
21 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 35 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
22 | 36 |
23 _TcpConnectedSocketProxyImpl.fromHandle(core.MojoHandle handle) : | 37 _TcpConnectedSocketProxyImpl.fromHandle(core.MojoHandle handle) : |
24 super.fromHandle(handle); | 38 super.fromHandle(handle); |
25 | 39 |
26 _TcpConnectedSocketProxyImpl.unbound() : super.unbound(); | 40 _TcpConnectedSocketProxyImpl.unbound() : super.unbound(); |
27 | 41 |
28 static _TcpConnectedSocketProxyImpl newFromEndpoint( | 42 static _TcpConnectedSocketProxyImpl newFromEndpoint( |
29 core.MojoMessagePipeEndpoint endpoint) { | 43 core.MojoMessagePipeEndpoint endpoint) { |
30 assert(endpoint.setDescription("For _TcpConnectedSocketProxyImpl")); | 44 assert(endpoint.setDescription("For _TcpConnectedSocketProxyImpl")); |
31 return new _TcpConnectedSocketProxyImpl.fromEndpoint(endpoint); | 45 return new _TcpConnectedSocketProxyImpl.fromEndpoint(endpoint); |
32 } | 46 } |
33 | 47 |
| 48 service_describer.ServiceDescription get serviceDescription => |
| 49 new _TcpConnectedSocketServiceDescription(); |
| 50 |
34 void handleResponse(bindings.ServiceMessage message) { | 51 void handleResponse(bindings.ServiceMessage message) { |
35 switch (message.header.type) { | 52 switch (message.header.type) { |
36 default: | 53 default: |
37 proxyError("Unexpected message type: ${message.header.type}"); | 54 proxyError("Unexpected message type: ${message.header.type}"); |
38 close(immediate: true); | 55 close(immediate: true); |
39 break; | 56 break; |
40 } | 57 } |
41 } | 58 } |
42 | 59 |
43 String toString() { | 60 String toString() { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 assert(_impl == null); | 170 assert(_impl == null); |
154 _impl = d; | 171 _impl = d; |
155 } | 172 } |
156 | 173 |
157 String toString() { | 174 String toString() { |
158 var superString = super.toString(); | 175 var superString = super.toString(); |
159 return "TcpConnectedSocketStub($superString)"; | 176 return "TcpConnectedSocketStub($superString)"; |
160 } | 177 } |
161 | 178 |
162 int get version => 0; | 179 int get version => 0; |
| 180 |
| 181 service_describer.ServiceDescription get serviceDescription => |
| 182 new _TcpConnectedSocketServiceDescription(); |
163 } | 183 } |
164 | 184 |
165 | 185 |
| 186 |
| 187 |
OLD | NEW |