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

Side by Side Diff: benchmarks/mojo_rtt_benchmark/lib/isolate.dart

Issue 1414483010: Dart: Use a RawReceivePort to receive events for Mojo handles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 5 years, 1 month 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 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698