OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_PORT_H_ | 5 #ifndef VM_PORT_H_ |
6 #define VM_PORT_H_ | 6 #define VM_PORT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
11 #include "vm/random.h" | 11 #include "vm/random.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 class Isolate; | 15 class Isolate; |
16 class Message; | 16 class Message; |
17 class MessageHandler; | 17 class MessageHandler; |
18 class Mutex; | 18 class Mutex; |
19 class PortMapTestPeer; | 19 class PortMapTestPeer; |
20 | 20 |
21 class PortMap: public AllStatic { | 21 class PortMap : public AllStatic { |
22 public: | 22 public: |
23 enum PortState { | 23 enum PortState { |
24 kNewPort = 0, // a newly allocated port | 24 kNewPort = 0, // a newly allocated port |
25 kLivePort = 1, // a regular port (has a ReceivePort) | 25 kLivePort = 1, // a regular port (has a ReceivePort) |
26 kControlPort = 2, // a special control port (has a ReceivePort) | 26 kControlPort = 2, // a special control port (has a ReceivePort) |
27 }; | 27 }; |
28 | 28 |
29 // Allocate a port for the provided handler and return its VM-global id. | 29 // Allocate a port for the provided handler and return its VM-global id. |
30 static Dart_Port CreatePort(MessageHandler* handler); | 30 static Dart_Port CreatePort(MessageHandler* handler); |
31 | 31 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 static intptr_t capacity_; | 90 static intptr_t capacity_; |
91 static intptr_t used_; | 91 static intptr_t used_; |
92 static intptr_t deleted_; | 92 static intptr_t deleted_; |
93 | 93 |
94 static Random* prng_; | 94 static Random* prng_; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace dart | 97 } // namespace dart |
98 | 98 |
99 #endif // VM_PORT_H_ | 99 #endif // VM_PORT_H_ |
OLD | NEW |