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

Unified Diff: runtime/vm/port.h

Issue 456983002: Refactor isolate startup code in preparation for making isolate spawning more truly non-blocking. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 4 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/vm/object.cc ('k') | runtime/vm/port.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/port.h
diff --git a/runtime/vm/port.h b/runtime/vm/port.h
index 5a0f177402b5ef2f02a276fe5c286feb78eaca86..f62ac8bd6eefbc933bd009870a252512c867dd17 100644
--- a/runtime/vm/port.h
+++ b/runtime/vm/port.h
@@ -20,12 +20,18 @@ class PortMapTestPeer;
class PortMap: public AllStatic {
public:
+ enum PortState {
+ kNewPort = 0, // a newly allocated port
+ kLivePort = 1, // a regular port (has a ReceivePort)
+ kControlPort = 2, // a special control port (has a ReceivePort)
+ };
+
// Allocate a port for the provided handler and return its VM-global id.
static Dart_Port CreatePort(MessageHandler* handler);
// Indicates that a port has had a ReceivePort created for it at the
// dart language level. The port remains live until it is closed.
- static void SetLive(Dart_Port id);
+ static void SetPortState(Dart_Port id, PortState kind);
// Close the port with id. All pending messages will be dropped.
//
@@ -59,9 +65,11 @@ class PortMap: public AllStatic {
typedef struct {
Dart_Port port;
MessageHandler* handler;
- bool live;
+ PortState state;
} Entry;
+ static const char* PortStateString(PortState state);
+
// Allocate a new unique port.
static Dart_Port AllocatePort();
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698