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/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/message.h" | 9 #include "vm/message.h" |
10 #include "vm/os_thread.h" | 10 #include "vm/os_thread.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 virtual void MessageNotify(Message::Priority priority); | 177 virtual void MessageNotify(Message::Priority priority); |
178 | 178 |
179 // Handles a single message. Provided by subclass. | 179 // Handles a single message. Provided by subclass. |
180 // | 180 // |
181 // Returns true on success. | 181 // Returns true on success. |
182 virtual bool HandleMessage(Message* message) = 0; | 182 virtual bool HandleMessage(Message* message) = 0; |
183 | 183 |
184 virtual void NotifyPauseOnStart() {} | 184 virtual void NotifyPauseOnStart() {} |
185 virtual void NotifyPauseOnExit() {} | 185 virtual void NotifyPauseOnExit() {} |
186 | 186 |
| 187 // TODO(iposva): Set a local field before entering MessageHandler methods. |
| 188 Thread* thread() const { return Thread::Current(); } |
| 189 |
187 private: | 190 private: |
188 friend class PortMap; | 191 friend class PortMap; |
189 friend class MessageHandlerTestPeer; | 192 friend class MessageHandlerTestPeer; |
190 friend class MessageHandlerTask; | 193 friend class MessageHandlerTask; |
191 | 194 |
192 // Called by MessageHandlerTask to process our task queue. | 195 // Called by MessageHandlerTask to process our task queue. |
193 void TaskCallback(); | 196 void TaskCallback(); |
194 | 197 |
195 // Dequeue the next message. Prefer messages from the oob_queue_ to | 198 // Dequeue the next message. Prefer messages from the oob_queue_ to |
196 // messages from the queue_. | 199 // messages from the queue_. |
(...skipping 21 matching lines...) Expand all Loading... |
218 StartCallback start_callback_; | 221 StartCallback start_callback_; |
219 EndCallback end_callback_; | 222 EndCallback end_callback_; |
220 CallbackData callback_data_; | 223 CallbackData callback_data_; |
221 | 224 |
222 DISALLOW_COPY_AND_ASSIGN(MessageHandler); | 225 DISALLOW_COPY_AND_ASSIGN(MessageHandler); |
223 }; | 226 }; |
224 | 227 |
225 } // namespace dart | 228 } // namespace dart |
226 | 229 |
227 #endif // VM_MESSAGE_HANDLER_H_ | 230 #endif // VM_MESSAGE_HANDLER_H_ |
OLD | NEW |