| 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();
|
|
|
|
|