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

Unified Diff: runtime/bin/io_service_patch.dart

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 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
« no previous file with comments | « runtime/bin/eventhandler_patch.dart ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/io_service_patch.dart
diff --git a/runtime/bin/io_service_patch.dart b/runtime/bin/io_service_patch.dart
index c6a703529cf9fd67fe50451879e337ca6c48ae44..85f51241acd4ffb4894c33a5e665f34c5ca23d41 100644
--- a/runtime/bin/io_service_patch.dart
+++ b/runtime/bin/io_service_patch.dart
@@ -6,7 +6,7 @@ patch class _IOService {
// Lazy initialize service ports, 32 per isolate.
static const int _SERVICE_PORT_COUNT = 32;
static List<SendPort> _servicePort = new List(_SERVICE_PORT_COUNT);
- static ReceivePort _receivePort;
+ static RawReceivePort _receivePort;
static SendPort _replyToPort;
static Map<int, Completer> _messageMap = {};
static int _id = 0;
@@ -29,9 +29,9 @@ patch class _IOService {
_servicePort[index] = _newServicePort();
}
if (_receivePort == null) {
- _receivePort = new ReceivePort();
- _replyToPort = _receivePort.toSendPort();
- _receivePort.receive((data, _) {
+ _receivePort = new RawReceivePort();
+ _replyToPort = _receivePort.sendPort;
+ _receivePort.handler = (data) {
assert(data is List && data.length == 2);
_messageMap.remove(data[0]).complete(data[1]);
if (_messageMap.length == 0) {
@@ -39,7 +39,7 @@ patch class _IOService {
_receivePort.close();
_receivePort = null;
}
- });
+ };
}
}
« no previous file with comments | « runtime/bin/eventhandler_patch.dart ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698