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/thread.h" | 10 #include "vm/thread.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // ------------ START PortMap API ------------ | 110 // ------------ START PortMap API ------------ |
111 // These functions should only be called from the PortMap. | 111 // These functions should only be called from the PortMap. |
112 | 112 |
113 // Does this message handler correspond to the current isolate? | 113 // Does this message handler correspond to the current isolate? |
114 virtual bool IsCurrentIsolate() const { return false; } | 114 virtual bool IsCurrentIsolate() const { return false; } |
115 | 115 |
116 // Return Isolate to which this message handler corresponds to. | 116 // Return Isolate to which this message handler corresponds to. |
117 virtual Isolate* isolate() const { return NULL; } | 117 virtual Isolate* isolate() const { return NULL; } |
118 | 118 |
119 // Posts a message on this handler's message queue. | 119 // Posts a message on this handler's message queue. |
120 void PostMessage(Message* message); | 120 // If before_events is true, then the message is enqueued before any pending |
| 121 // events, but after any pending isolate library events. |
| 122 void PostMessage(Message* message, bool before_events = false); |
121 | 123 |
122 // Notifies this handler that a port is being closed. | 124 // Notifies this handler that a port is being closed. |
123 void ClosePort(Dart_Port port); | 125 void ClosePort(Dart_Port port); |
124 | 126 |
125 // Notifies this handler that all ports are being closed. | 127 // Notifies this handler that all ports are being closed. |
126 void CloseAllPorts(); | 128 void CloseAllPorts(); |
127 | 129 |
128 // Returns true if the handler is owned by the PortMap. | 130 // Returns true if the handler is owned by the PortMap. |
129 // | 131 // |
130 // This is used to delete handlers when their last live port is closed. | 132 // This is used to delete handlers when their last live port is closed. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 StartCallback start_callback_; | 173 StartCallback start_callback_; |
172 EndCallback end_callback_; | 174 EndCallback end_callback_; |
173 CallbackData callback_data_; | 175 CallbackData callback_data_; |
174 | 176 |
175 DISALLOW_COPY_AND_ASSIGN(MessageHandler); | 177 DISALLOW_COPY_AND_ASSIGN(MessageHandler); |
176 }; | 178 }; |
177 | 179 |
178 } // namespace dart | 180 } // namespace dart |
179 | 181 |
180 #endif // VM_MESSAGE_HANDLER_H_ | 182 #endif // VM_MESSAGE_HANDLER_H_ |
OLD | NEW |