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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 ASSERT(msg_queue != NULL); | 1395 ASSERT(msg_queue != NULL); |
1396 msg_queue->SendQueuedMsgs(); | 1396 msg_queue->SendQueuedMsgs(); |
1397 msg_queue->SendExceptionEvent(exception, stack_trace); | 1397 msg_queue->SendExceptionEvent(exception, stack_trace); |
1398 msg_queue->MessageLoop(); | 1398 msg_queue->MessageLoop(); |
1399 Dart_ExitScope(); | 1399 Dart_ExitScope(); |
1400 } | 1400 } |
1401 | 1401 |
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 DebuggerConnectionHandler::WaitForConnection(); |
| 1406 Dart_EnterScope(); |
1405 if (kind == kCreated) { | 1407 if (kind == kCreated) { |
1406 DebuggerConnectionHandler::WaitForConnection(); | |
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(); | |
1411 } else { | 1410 } else { |
1412 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); | 1411 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); |
1413 if (msg_queue != NULL) { | 1412 if (msg_queue != NULL) { |
1414 DebuggerConnectionHandler::WaitForConnection(); | |
1415 Dart_EnterScope(); | |
1416 msg_queue->SendQueuedMsgs(); | 1413 msg_queue->SendQueuedMsgs(); |
1417 msg_queue->SendIsolateEvent(isolate_id, kind); | 1414 msg_queue->SendIsolateEvent(isolate_id, kind); |
1418 if (kind == kInterrupted) { | 1415 if (kind == kInterrupted) { |
1419 msg_queue->MessageLoop(); | 1416 msg_queue->MessageLoop(); |
1420 } else { | 1417 } else { |
1421 ASSERT(kind == kShutdown); | 1418 ASSERT(kind == kShutdown); |
1422 RemoveIsolateMsgQueue(isolate_id); | 1419 RemoveIsolateMsgQueue(isolate_id); |
1423 } | 1420 } |
1424 Dart_ExitScope(); | |
1425 } | 1421 } |
1426 // If there is no receive message queue, do not wait for a connection, and | |
1427 // ignore the message. | |
1428 } | 1422 } |
| 1423 Dart_ExitScope(); |
1429 } | 1424 } |
1430 | 1425 |
1431 } // namespace bin | 1426 } // namespace bin |
1432 } // namespace dart | 1427 } // namespace dart |
OLD | NEW |