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_MESSAGE_HANDLER_H_ | 5 #ifndef VM_MESSAGE_HANDLER_H_ |
6 #define VM_MESSAGE_HANDLER_H_ | 6 #define VM_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include "vm/message.h" | 8 #include "vm/message.h" |
9 #include "vm/thread.h" | 9 #include "vm/thread.h" |
10 #include "vm/thread_pool.h" | 10 #include "vm/thread_pool.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // For example, if this MessageHandler is an isolate, then it is | 62 // For example, if this MessageHandler is an isolate, then it is |
63 // only safe to access it when the MessageHandler is the current | 63 // only safe to access it when the MessageHandler is the current |
64 // isolate. | 64 // isolate. |
65 virtual void CheckAccess(); | 65 virtual void CheckAccess(); |
66 #endif | 66 #endif |
67 | 67 |
68 protected: | 68 protected: |
69 // ------------ START PortMap API ------------ | 69 // ------------ START PortMap API ------------ |
70 // These functions should only be called from the PortMap. | 70 // These functions should only be called from the PortMap. |
71 | 71 |
| 72 // Does this message handler correspond to the current isolate? |
| 73 virtual bool IsCurrentIsolate() const { return false; } |
| 74 |
72 // Posts a message on this handler's message queue. | 75 // Posts a message on this handler's message queue. |
73 void PostMessage(Message* message); | 76 void PostMessage(Message* message); |
74 | 77 |
75 // Notifies this handler that a port is being closed. | 78 // Notifies this handler that a port is being closed. |
76 void ClosePort(Dart_Port port); | 79 void ClosePort(Dart_Port port); |
77 | 80 |
78 // Notifies this handler that all ports are being closed. | 81 // Notifies this handler that all ports are being closed. |
79 void CloseAllPorts(); | 82 void CloseAllPorts(); |
80 | 83 |
81 // Returns true if the handler is owned by the PortMap. | 84 // Returns true if the handler is owned by the PortMap. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 StartCallback start_callback_; | 123 StartCallback start_callback_; |
121 EndCallback end_callback_; | 124 EndCallback end_callback_; |
122 CallbackData callback_data_; | 125 CallbackData callback_data_; |
123 | 126 |
124 DISALLOW_COPY_AND_ASSIGN(MessageHandler); | 127 DISALLOW_COPY_AND_ASSIGN(MessageHandler); |
125 }; | 128 }; |
126 | 129 |
127 } // namespace dart | 130 } // namespace dart |
128 | 131 |
129 #endif // VM_MESSAGE_HANDLER_H_ | 132 #endif // VM_MESSAGE_HANDLER_H_ |
OLD | NEW |