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

Unified Diff: runtime/lib/isolate_patch.dart

Issue 196443009: - First step in refactoring ports with the goal of moving (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/custom_isolate_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate_patch.dart
===================================================================
--- runtime/lib/isolate_patch.dart (revision 34429)
+++ runtime/lib/isolate_patch.dart (working copy)
@@ -84,16 +84,17 @@
}
SendPort get sendPort {
- return new _SendPortImpl(_id);
+ return new _SendPortImpl._from(this);
}
/**** Internal implementation details ****/
// Called from the VM to create a new RawReceivePort instance.
- static _RawReceivePortImpl _get_or_create(int id) {
- _RawReceivePortImpl port = _portMap[id];
- if (port != null) {
- return port;
- }
+ static _RawReceivePortImpl _get(int id) {
+ return _portMap[id];
+ }
+
+ static _RawReceivePortImpl _create(int id) {
+ assert(_portMap[id]== null);
return new _RawReceivePortImpl._internal(id);
}
@@ -157,12 +158,13 @@
}
/*--- private implementation ---*/
- const _SendPortImpl(int id) : _id = id;
+ _SendPortImpl._from(_RawReceivePortImpl from) : _id = from._id;
+ _SendPortImpl._with(int id) : _id = id;
// _SendPortImpl._create is called from the VM when a new SendPort instance is
// needed by the VM code.
static SendPort _create(int id) {
- return new _SendPortImpl(id);
+ return new _SendPortImpl._with(id);
}
// Forward the implementation of sending messages to the VM. Only port ids
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/custom_isolate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698