OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This Mojo app is a benchmark of Dart <=> Dart IPC Round Trip Times. | 5 // This Mojo app is a benchmark of Dart <=> Dart IPC Round Trip Times. |
6 // To run it: | 6 // To run it: |
7 // | 7 // |
8 // $ ./mojo/devtools/common/mojo_benchmark [--release] mojo/tools/data/rtt_bench
marks | 8 // $ ./mojo/devtools/common/mojo_benchmark [--release] mojo/tools/data/rtt_bench
marks |
9 | 9 |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 _isolateMessageHandler(msg) { | 89 _isolateMessageHandler(msg) { |
90 if (msg is SendPort) { | 90 if (msg is SendPort) { |
91 _sendPortCompleter.complete(msg); | 91 _sendPortCompleter.complete(msg); |
92 } else { | 92 } else { |
93 var completer = _completers.removeAt(0); | 93 var completer = _completers.removeAt(0); |
94 completer.complete(null); | 94 completer.complete(null); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 void _errorHandler() { | 98 void _errorHandler(Object e) { |
99 _doEcho = false; | 99 _doEcho = false; |
100 _receivePort.close(); | 100 _receivePort.close(); |
101 MojoHandle.reportLeakedHandles(); | 101 MojoHandle.reportLeakedHandles(); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 main(List args) { | 105 main(List args) { |
106 MojoHandle appHandle = new MojoHandle(args[0]); | 106 MojoHandle appHandle = new MojoHandle(args[0]); |
107 new IsolateMessageApp.fromHandle(appHandle); | 107 new IsolateMessageApp.fromHandle(appHandle); |
108 } | 108 } |
OLD | NEW |