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

Unified Diff: runtime/vm/port.h

Issue 8588040: Add a mid-sized integration test for the Dart Embedding Api which (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.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
===================================================================
--- runtime/vm/port.h (revision 1904)
+++ runtime/vm/port.h (working copy)
@@ -13,20 +13,23 @@
class Isolate;
class Mutex;
+class PortMapTestPeer;
class PortMap: public AllStatic {
public:
// Allocate a port in the current isolate and return its VM-global id.
static Dart_Port CreatePort();
+ // 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);
+
// Close the port with id. All pending messages will be dropped.
static void ClosePort(Dart_Port id);
// Close all the ports of the current isolate.
static void ClosePorts();
- static bool IsActivePort(Dart_Port id);
-
// Enqueues the message in the port with id. Returns false if the port is not
// active any longer.
//
@@ -39,17 +42,23 @@
static void InitOnce();
private:
+ friend class dart::PortMapTestPeer;
+
// Mapping between port numbers and isolates.
// Free entries have id == 0 and isolate == NULL. Deleted entries have id == 0
// and isolate == deleted_entry_.
typedef struct {
Dart_Port port;
Isolate* isolate;
+ bool live;
} Entry;
// Allocate a new unique port.
static Dart_Port AllocatePort();
+ static bool IsActivePort(Dart_Port id);
+ static bool IsLivePort(Dart_Port id);
+
static intptr_t FindPort(Dart_Port port);
static void Rehash(intptr_t new_capacity);
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698