Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: mojo/dart/packages/mojo/lib/src/proxy.dart

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge with master Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.
40 /// Note: The description is null or incomplete if type info is unavailable.
41 service_describer.ServiceDescription get description => null;
42
38 void handleRead() { 43 void handleRead() {
39 var result = endpoint.queryAndRead(); 44 var result = endpoint.queryAndRead();
40 if ((result.data == null) || (result.dataLength == 0)) { 45 if ((result.data == null) || (result.dataLength == 0)) {
41 proxyError("Read from message pipe endpoint failed"); 46 proxyError("Read from message pipe endpoint failed");
42 return; 47 return;
43 } 48 }
44 try { 49 try {
45 var message = new ServiceMessage.fromMessage(new Message(result.data, 50 var message = new ServiceMessage.fromMessage(new Message(result.data,
46 result.handles, result.dataLength, result.handlesLength)); 51 result.handles, result.dataLength, result.handlesLength));
47 _pendingCount--; 52 _pendingCount--;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 251
247 /// Generated Proxy classes have a factory Proxy.connectToService which takes 252 /// Generated Proxy classes have a factory Proxy.connectToService which takes
248 /// a ServiceConnector, a url, and optionally a service name and returns a 253 /// a ServiceConnector, a url, and optionally a service name and returns a
249 /// bound Proxy. For example, every class extending the Application base class 254 /// bound Proxy. For example, every class extending the Application base class
250 /// in package:mojo/application.dart inherits and implementation of the 255 /// in package:mojo/application.dart inherits and implementation of the
251 /// ServiceConnector interface. 256 /// ServiceConnector interface.
252 abstract class ServiceConnector { 257 abstract class ServiceConnector {
253 /// Connects [proxy] to the service called [serviceName] that lives at [url]. 258 /// Connects [proxy] to the service called [serviceName] that lives at [url].
254 void connectToService(String url, ProxyBase proxy, [String serviceName]); 259 void connectToService(String url, ProxyBase proxy, [String serviceName]);
255 } 260 }
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/lib/mojo/url_response.mojom.dart ('k') | mojo/dart/packages/mojo/lib/src/stub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698