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/lockers.h" | 8 #include "bin/lockers.h" |
9 #include "bin/thread.h" | 9 #include "bin/thread.h" |
10 #include "bin/utils.h" | 10 #include "bin/utils.h" |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 | 1402 |
1403 void DbgMsgQueueList::IsolateEventHandler(Dart_IsolateId isolate_id, | 1403 void DbgMsgQueueList::IsolateEventHandler(Dart_IsolateId isolate_id, |
1404 Dart_IsolateEvent kind) { | 1404 Dart_IsolateEvent kind) { |
1405 if (kind == kCreated) { | 1405 if (kind == kCreated) { |
1406 DebuggerConnectionHandler::WaitForConnection(); | 1406 DebuggerConnectionHandler::WaitForConnection(); |
1407 Dart_EnterScope(); | 1407 Dart_EnterScope(); |
1408 DbgMsgQueue* msg_queue = AddIsolateMsgQueue(isolate_id); | 1408 DbgMsgQueue* msg_queue = AddIsolateMsgQueue(isolate_id); |
1409 msg_queue->SendIsolateEvent(isolate_id, kind); | 1409 msg_queue->SendIsolateEvent(isolate_id, kind); |
1410 Dart_ExitScope(); | 1410 Dart_ExitScope(); |
1411 } else { | 1411 } else { |
| 1412 DebuggerConnectionHandler::WaitForConnection(); |
1412 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); | 1413 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); |
1413 if (msg_queue != NULL) { | 1414 ASSERT(msg_queue != NULL); |
1414 DebuggerConnectionHandler::WaitForConnection(); | 1415 Dart_EnterScope(); |
1415 Dart_EnterScope(); | 1416 msg_queue->SendQueuedMsgs(); |
1416 msg_queue->SendQueuedMsgs(); | 1417 msg_queue->SendIsolateEvent(isolate_id, kind); |
1417 msg_queue->SendIsolateEvent(isolate_id, kind); | 1418 if (kind == kInterrupted) { |
1418 if (kind == kInterrupted) { | 1419 msg_queue->MessageLoop(); |
1419 msg_queue->MessageLoop(); | 1420 } else { |
1420 } else { | 1421 ASSERT(kind == kShutdown); |
1421 ASSERT(kind == kShutdown); | 1422 RemoveIsolateMsgQueue(isolate_id); |
1422 RemoveIsolateMsgQueue(isolate_id); | |
1423 } | |
1424 Dart_ExitScope(); | |
1425 } | 1423 } |
| 1424 Dart_ExitScope(); |
1426 // If there is no receive message queue, do not wait for a connection, and | 1425 // If there is no receive message queue, do not wait for a connection, and |
1427 // ignore the message. | 1426 // ignore the message. |
1428 } | 1427 } |
1429 } | 1428 } |
1430 | 1429 |
1431 } // namespace bin | 1430 } // namespace bin |
1432 } // namespace dart | 1431 } // namespace dart |
OLD | NEW |