| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "bin/dbg_connection.h" | 5 #include "bin/dbg_connection.h" |
| 6 #include "bin/dbg_message.h" | 6 #include "bin/dbg_message.h" |
| 7 #include "bin/dartutils.h" | 7 #include "bin/dartutils.h" |
| 8 #include "bin/thread.h" | 8 #include "bin/thread.h" |
| 9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
| 10 | 10 |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 | 985 |
| 986 void DbgMsgQueueList::RemoveIsolateMsgQueue(Dart_IsolateId isolate_id) { | 986 void DbgMsgQueueList::RemoveIsolateMsgQueue(Dart_IsolateId isolate_id) { |
| 987 MutexLocker ml(&msg_queue_list_lock_); | 987 MutexLocker ml(&msg_queue_list_lock_); |
| 988 if (list_ == NULL) { | 988 if (list_ == NULL) { |
| 989 return; // No items in the list. | 989 return; // No items in the list. |
| 990 } | 990 } |
| 991 DbgMsgQueue* queue = list_; | 991 DbgMsgQueue* queue = list_; |
| 992 if (queue->isolate_id() == isolate_id) { | 992 if (queue->isolate_id() == isolate_id) { |
| 993 list_ = queue->next(); // Remove from list. | 993 list_ = queue->next(); // Remove from list. |
| 994 delete queue; // Delete the message queue. | 994 delete queue; // Delete the message queue. |
| 995 return; |
| 995 } else { | 996 } else { |
| 996 DbgMsgQueue* iterator = queue; | 997 DbgMsgQueue* iterator = queue; |
| 997 queue = queue->next(); | 998 queue = queue->next(); |
| 998 while (queue != NULL) { | 999 while (queue != NULL) { |
| 999 if (queue->isolate_id() != isolate_id) { | 1000 if (queue->isolate_id() == isolate_id) { |
| 1000 iterator->set_next(queue->next()); // Remove from list. | 1001 iterator->set_next(queue->next()); // Remove from list. |
| 1001 delete queue; // Delete the message queue. | 1002 delete queue; // Delete the message queue. |
| 1002 break; | 1003 return; |
| 1003 } | 1004 } |
| 1004 iterator = queue; | 1005 iterator = queue; |
| 1005 queue = queue->next(); | 1006 queue = queue->next(); |
| 1006 } | 1007 } |
| 1007 } | 1008 } |
| 1009 UNREACHABLE(); |
| 1008 } | 1010 } |
| 1009 | 1011 |
| 1010 | 1012 |
| 1011 void DbgMsgQueueList::BptResolvedHandler(Dart_IsolateId isolate_id, | 1013 void DbgMsgQueueList::BptResolvedHandler(Dart_IsolateId isolate_id, |
| 1012 intptr_t bp_id, | 1014 intptr_t bp_id, |
| 1013 Dart_Handle url, | 1015 Dart_Handle url, |
| 1014 intptr_t line_number) { | 1016 intptr_t line_number) { |
| 1015 ASSERT(Dart_GetIsolate(isolate_id) == Dart_CurrentIsolate()); | 1017 ASSERT(Dart_GetIsolate(isolate_id) == Dart_CurrentIsolate()); |
| 1016 Dart_EnterScope(); | 1018 Dart_EnterScope(); |
| 1017 dart::TextBuffer msg(128); | 1019 dart::TextBuffer msg(128); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 msg_queue->SendIsolateEvent(isolate_id, kind); | 1073 msg_queue->SendIsolateEvent(isolate_id, kind); |
| 1072 if (kind == kInterrupted) { | 1074 if (kind == kInterrupted) { |
| 1073 msg_queue->HandleMessages(); | 1075 msg_queue->HandleMessages(); |
| 1074 } else { | 1076 } else { |
| 1075 ASSERT(kind == kShutdown); | 1077 ASSERT(kind == kShutdown); |
| 1076 RemoveIsolateMsgQueue(isolate_id); | 1078 RemoveIsolateMsgQueue(isolate_id); |
| 1077 } | 1079 } |
| 1078 } | 1080 } |
| 1079 Dart_ExitScope(); | 1081 Dart_ExitScope(); |
| 1080 } | 1082 } |
| OLD | NEW |