| 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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 ASSERT(Dart_GetIsolate(isolate_id) == Dart_CurrentIsolate()); | 990 ASSERT(Dart_GetIsolate(isolate_id) == Dart_CurrentIsolate()); |
| 991 return GetIsolateMsgQueueLocked(isolate_id); | 991 return GetIsolateMsgQueueLocked(isolate_id); |
| 992 } | 992 } |
| 993 | 993 |
| 994 | 994 |
| 995 DbgMsgQueue* DbgMsgQueueList::GetIsolateMsgQueueLocked(Dart_IsolateId id) { | 995 DbgMsgQueue* DbgMsgQueueList::GetIsolateMsgQueueLocked(Dart_IsolateId id) { |
| 996 if (list_ == NULL) { | 996 if (list_ == NULL) { |
| 997 return NULL; // No items in the list. | 997 return NULL; // No items in the list. |
| 998 } | 998 } |
| 999 | 999 |
| 1000 // TODO(asiva): Remove once debug wire protocol has isolate id. | |
| 1001 // For now we return the first item in the list as we are only supporting | |
| 1002 // debugging of a single isolate. | |
| 1003 if (id == ILLEGAL_ISOLATE_ID) { | |
| 1004 return list_; | |
| 1005 } | |
| 1006 | |
| 1007 // Find message queue corresponding to isolate id. | 1000 // Find message queue corresponding to isolate id. |
| 1008 DbgMsgQueue* iterator = list_; | 1001 DbgMsgQueue* iterator = list_; |
| 1009 while (iterator != NULL && iterator->isolate_id() != id) { | 1002 while (iterator != NULL && iterator->isolate_id() != id) { |
| 1010 iterator = iterator->next(); | 1003 iterator = iterator->next(); |
| 1011 } | 1004 } |
| 1012 return iterator; | 1005 return iterator; |
| 1013 } | 1006 } |
| 1014 | 1007 |
| 1015 | 1008 |
| 1016 void DbgMsgQueueList::RemoveIsolateMsgQueue(Dart_IsolateId isolate_id) { | 1009 void DbgMsgQueueList::RemoveIsolateMsgQueue(Dart_IsolateId isolate_id) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 msg_queue->SendIsolateEvent(isolate_id, kind); | 1092 msg_queue->SendIsolateEvent(isolate_id, kind); |
| 1100 if (kind == kInterrupted) { | 1093 if (kind == kInterrupted) { |
| 1101 msg_queue->HandleMessages(); | 1094 msg_queue->HandleMessages(); |
| 1102 } else { | 1095 } else { |
| 1103 ASSERT(kind == kShutdown); | 1096 ASSERT(kind == kShutdown); |
| 1104 RemoveIsolateMsgQueue(isolate_id); | 1097 RemoveIsolateMsgQueue(isolate_id); |
| 1105 } | 1098 } |
| 1106 } | 1099 } |
| 1107 Dart_ExitScope(); | 1100 Dart_ExitScope(); |
| 1108 } | 1101 } |
| OLD | NEW |