| 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.fromEndpoint(core.MojoMessagePipeEndpoint endpoint, | 11 Proxy.fromEndpoint(core.MojoMessagePipeEndpoint endpoint) |
| 12 {bool doListen: 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, | 15 Proxy.fromHandle(core.MojoHandle handle) |
| 17 {bool doListen: true, 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 Loading... |
| 83 var superString = super.toString(); | 81 var superString = super.toString(); |
| 84 return "Proxy(${superString})"; | 82 return "Proxy(${superString})"; |
| 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 } |
| OLD | NEW |