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 #include "vm/message_handler.h" | 5 #include "vm/message_handler.h" |
6 | 6 |
7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
8 #include "vm/lockers.h" | 8 #include "vm/lockers.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Some callers want to process only one normal message and then quit. At | 238 // Some callers want to process only one normal message and then quit. At |
239 // the same time it is OK to process multiple OOB messages. | 239 // the same time it is OK to process multiple OOB messages. |
240 if ((saved_priority == Message::kNormalPriority) && | 240 if ((saved_priority == Message::kNormalPriority) && |
241 !allow_multiple_normal_messages) { | 241 !allow_multiple_normal_messages) { |
242 // We processed one normal message. Allow no more. | 242 // We processed one normal message. Allow no more. |
243 allow_normal_messages = false; | 243 allow_normal_messages = false; |
244 } | 244 } |
245 | 245 |
246 // Reevaluate the minimum allowable priority. The paused state | 246 // Reevaluate the minimum allowable priority. The paused state |
247 // may have changed as part of handling the message. We may also | 247 // may have changed as part of handling the message. We may also |
248 // have encountered an error during message processsing. | 248 // have encountered an error during message processing. |
249 // | 249 // |
250 // Even if we encounter an error, we still process pending OOB | 250 // Even if we encounter an error, we still process pending OOB |
251 // messages so that we don't lose the message notification. | 251 // messages so that we don't lose the message notification. |
252 min_priority = (((max_status == kOK) && allow_normal_messages && !paused()) | 252 min_priority = (((max_status == kOK) && allow_normal_messages && !paused()) |
253 ? Message::kNormalPriority | 253 ? Message::kNormalPriority |
254 : Message::kOOBPriority); | 254 : Message::kOOBPriority); |
255 message = DequeueMessage(min_priority); | 255 message = DequeueMessage(min_priority); |
256 } | 256 } |
257 return max_status; | 257 return max_status; |
258 } | 258 } |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 handler_->oob_message_handling_allowed_ = false; | 586 handler_->oob_message_handling_allowed_ = false; |
587 } | 587 } |
588 | 588 |
589 | 589 |
590 MessageHandler::AcquiredQueues::~AcquiredQueues() { | 590 MessageHandler::AcquiredQueues::~AcquiredQueues() { |
591 ASSERT(handler_ != NULL); | 591 ASSERT(handler_ != NULL); |
592 handler_->oob_message_handling_allowed_ = true; | 592 handler_->oob_message_handling_allowed_ = true; |
593 } | 593 } |
594 | 594 |
595 } // namespace dart | 595 } // namespace dart |
OLD | NEW |