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

Unified Diff: third_party/mojo/src/mojo/public/dart/src/proxy.dart

Issue 1029113005: Update mojo sdk to rev cb6c5abfadfea0ca73dca466e2894554ac1ae144 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/public/dart/src/proxy.dart
diff --git a/third_party/mojo/src/mojo/public/dart/src/proxy.dart b/third_party/mojo/src/mojo/public/dart/src/proxy.dart
index 5317e5648b558843fb533c2e90c1b1f66083dccf..a84ca3ec0c23726726e432aa7f8e111552c27f25 100644
--- a/third_party/mojo/src/mojo/public/dart/src/proxy.dart
+++ b/third_party/mojo/src/mojo/public/dart/src/proxy.dart
@@ -4,6 +4,12 @@
part of bindings;
+class ProxyCloseException {
+ final String message;
+ ProxyCloseException(this.message);
+ String toString() => message;
+}
+
abstract class Proxy extends core.MojoEventStreamListener {
Map<int, Completer> _completerMap;
int _nextId = 0;
@@ -40,6 +46,15 @@ abstract class Proxy extends core.MojoEventStreamListener {
throw 'Unexpected write signal in proxy.';
}
+ @override
+ Future close({bool nodefer: false}) {
+ for (var completer in _completerMap.values) {
+ completer.completeError(new ProxyCloseException('Proxy closed'));
+ }
+ _completerMap.clear();
+ return super.close(nodefer: nodefer);
+ }
+
void sendMessage(Struct message, int name) {
if (!isOpen) {
listen();

Powered by Google App Engine
This is Rietveld 408576698