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 part of bindings; | 5 part of bindings; |
6 | 6 |
7 class ProxyError { | 7 class ProxyError { |
8 final String message; | 8 final String message; |
9 ProxyError(this.message); | 9 ProxyError(this.message); |
10 String toString() => "ProxyError: $message"; | 10 String toString() => "ProxyError: $message"; |
(...skipping 17 matching lines...) Expand all Loading... | |
28 void handleResponse(ServiceMessage reader); | 28 void handleResponse(ServiceMessage reader); |
29 | 29 |
30 /// If there is an error in using this proxy, this future completes with | 30 /// If there is an error in using this proxy, this future completes with |
31 /// a ProxyError. | 31 /// a ProxyError. |
32 Future get errorFuture => _errorCompleter.future; | 32 Future get errorFuture => _errorCompleter.future; |
33 | 33 |
34 /// Version of this interface that the remote side supports. Updated when a | 34 /// Version of this interface that the remote side supports. Updated when a |
35 /// call to [queryVersion] or [requireVersion] is made. | 35 /// call to [queryVersion] or [requireVersion] is made. |
36 int get version => _version; | 36 int get version => _version; |
37 | 37 |
38 /// Returns a service description, which exposes the mojom type information | |
39 /// of the service being proxied. This type information can be forwarded to | |
40 /// other Mojo applications and can be used to implement a generic client. | |
41 /// Note: In some implementations, the ServiceDescription returned will not | |
42 /// provide type information. Methods called may return null or an error. | |
zra
2016/01/27 18:15:12
It's unclear if you mean the `description` getter
alexfandrianto
2016/01/28 03:45:12
Done.
| |
43 service_describer.ServiceDescription get description => null; | |
44 | |
38 void handleRead() { | 45 void handleRead() { |
39 var result = endpoint.queryAndRead(); | 46 var result = endpoint.queryAndRead(); |
40 if ((result.data == null) || (result.dataLength == 0)) { | 47 if ((result.data == null) || (result.dataLength == 0)) { |
41 proxyError("Read from message pipe endpoint failed"); | 48 proxyError("Read from message pipe endpoint failed"); |
42 return; | 49 return; |
43 } | 50 } |
44 try { | 51 try { |
45 var message = new ServiceMessage.fromMessage(new Message(result.data, | 52 var message = new ServiceMessage.fromMessage(new Message(result.data, |
46 result.handles, result.dataLength, result.handlesLength)); | 53 result.handles, result.dataLength, result.handlesLength)); |
47 _pendingCount--; | 54 _pendingCount--; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 | 252 |
246 /// Generated Proxy classes have a factory Proxy.connectToService which takes | 253 /// Generated Proxy classes have a factory Proxy.connectToService which takes |
247 /// a ServiceConnector, a url, and optionally a service name and returns a | 254 /// a ServiceConnector, a url, and optionally a service name and returns a |
248 /// bound Proxy. For example, every class extending the Application base class | 255 /// bound Proxy. For example, every class extending the Application base class |
249 /// in package:mojo/application.dart inherits and implementation of the | 256 /// in package:mojo/application.dart inherits and implementation of the |
250 /// ServiceConnector interface. | 257 /// ServiceConnector interface. |
251 abstract class ServiceConnector { | 258 abstract class ServiceConnector { |
252 /// Connects [proxy] to the service called [serviceName] that lives at [url]. | 259 /// Connects [proxy] to the service called [serviceName] that lives at [url]. |
253 void connectToService(String url, ProxyBase proxy, [String serviceName]); | 260 void connectToService(String url, ProxyBase proxy, [String serviceName]); |
254 } | 261 } |
OLD | NEW |