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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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? | 72 // Does this message handler correspond to the current isolate? |
73 virtual bool IsCurrentIsolate() const { return false; } | 73 virtual bool IsCurrentIsolate() const { return false; } |
74 | 74 |
| 75 // Return Isolate to which this message handler corresponds to. |
| 76 virtual Isolate* GetIsolate() const { return NULL; } |
| 77 |
75 // Posts a message on this handler's message queue. | 78 // Posts a message on this handler's message queue. |
76 void PostMessage(Message* message); | 79 void PostMessage(Message* message); |
77 | 80 |
78 // Notifies this handler that a port is being closed. | 81 // Notifies this handler that a port is being closed. |
79 void ClosePort(Dart_Port port); | 82 void ClosePort(Dart_Port port); |
80 | 83 |
81 // Notifies this handler that all ports are being closed. | 84 // Notifies this handler that all ports are being closed. |
82 void CloseAllPorts(); | 85 void CloseAllPorts(); |
83 | 86 |
84 // Returns true if the handler is owned by the PortMap. | 87 // Returns true if the handler is owned by the PortMap. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 StartCallback start_callback_; | 126 StartCallback start_callback_; |
124 EndCallback end_callback_; | 127 EndCallback end_callback_; |
125 CallbackData callback_data_; | 128 CallbackData callback_data_; |
126 | 129 |
127 DISALLOW_COPY_AND_ASSIGN(MessageHandler); | 130 DISALLOW_COPY_AND_ASSIGN(MessageHandler); |
128 }; | 131 }; |
129 | 132 |
130 } // namespace dart | 133 } // namespace dart |
131 | 134 |
132 #endif // VM_MESSAGE_HANDLER_H_ | 135 #endif // VM_MESSAGE_HANDLER_H_ |
OLD | NEW |