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/public/dart/src/proxy.dart

Issue 982673002: Dart: Removes need to call listen(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Don't pile up callbacks Created 5 years, 9 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 abstract class Proxy extends core.MojoEventStreamListener { 7 abstract class Proxy extends core.MojoEventStreamListener {
8 Map<int, Completer> _completerMap; 8 Map<int, Completer> _completerMap;
9 int _nextId = 0; 9 int _nextId = 0;
10 10
11 Proxy.fromEndpoint(core.MojoMessagePipeEndpoint endpoint, {bool doListen: 11 Proxy.fromEndpoint(core.MojoMessagePipeEndpoint endpoint)
12 true, Function onClosed})
13 : _completerMap = {}, 12 : _completerMap = {},
14 super.fromEndpoint(endpoint, doListen: doListen, onClosed: onClosed); 13 super.fromEndpoint(endpoint);
15 14
16 Proxy.fromHandle(core.MojoHandle handle, {bool doListen: true, 15 Proxy.fromHandle(core.MojoHandle handle)
17 Function onClosed})
18 : _completerMap = {}, 16 : _completerMap = {},
19 super.fromHandle(handle, doListen: doListen, onClosed: onClosed); 17 super.fromHandle(handle);
20 18
21 Proxy.unbound() 19 Proxy.unbound()
22 : _completerMap = {}, 20 : _completerMap = {},
23 super.unbound(); 21 super.unbound();
24 22
25 void handleResponse(ServiceMessage reader); 23 void handleResponse(ServiceMessage reader);
26 24
27 void handleRead() { 25 void handleRead() {
28 // Query how many bytes are available. 26 // Query how many bytes are available.
29 var result = endpoint.query(); 27 var result = endpoint.query();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // Need a getter for this for access in subclasses. 81 // Need a getter for this for access in subclasses.
84 Map<int, Completer> get completerMap => _completerMap; 82 Map<int, Completer> get completerMap => _completerMap;
85 } 83 }
86 84
87 85
88 // Generated Proxy classes implement this interface. 86 // Generated Proxy classes implement this interface.
89 abstract class ProxyBase { 87 abstract class ProxyBase {
90 final Proxy impl; 88 final Proxy impl;
91 final String name; 89 final String name;
92 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698