| 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 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(core.MojoMessagePipeEndpoint endpoint) : | 11 Proxy.fromEndpoint(core.MojoMessagePipeEndpoint endpoint, |
| 12 {bool doListen: true, Function onClosed}) : |
| 12 _completerMap = {}, | 13 _completerMap = {}, |
| 13 super(endpoint); | 14 super.fromEndpoint(endpoint, doListen: doListen, onClosed: onClosed); |
| 14 | 15 |
| 15 Proxy.fromHandle(core.MojoHandle handle) : | 16 Proxy.fromHandle(core.MojoHandle handle, |
| 17 {bool doListen: true, Function onClosed}) : |
| 16 _completerMap = {}, | 18 _completerMap = {}, |
| 17 super.fromHandle(handle); | 19 super.fromHandle(handle, doListen: doListen, onClosed: onClosed); |
| 18 | 20 |
| 19 Proxy.unbound() : | 21 Proxy.unbound() : |
| 20 _completerMap = {}, | 22 _completerMap = {}, |
| 21 super.unbound(); | 23 super.unbound(); |
| 22 | 24 |
| 23 void handleResponse(ServiceMessage reader); | 25 void handleResponse(ServiceMessage reader); |
| 24 | 26 |
| 25 void handleRead() { | 27 void handleRead() { |
| 26 // Query how many bytes are available. | 28 // Query how many bytes are available. |
| 27 var result = endpoint.query(); | 29 var result = endpoint.query(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Need a getter for this for access in subclasses. | 82 // Need a getter for this for access in subclasses. |
| 81 Map<int, Completer> get completerMap => _completerMap; | 83 Map<int, Completer> get completerMap => _completerMap; |
| 82 } | 84 } |
| 83 | 85 |
| 84 | 86 |
| 85 // Generated Proxy classes implement this interface. | 87 // Generated Proxy classes implement this interface. |
| 86 abstract class ProxyBase { | 88 abstract class ProxyBase { |
| 87 final Proxy impl; | 89 final Proxy impl; |
| 88 final String name; | 90 final String name; |
| 89 } | 91 } |
| OLD | NEW |