Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Side by Side Diff: runtime/bin/dbg_message.cc

Issue 1406013004: Fixes shutdown crashes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
1413 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); 1412 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id);
1414 ASSERT(msg_queue != NULL);
1415 Dart_EnterScope();
1416 msg_queue->SendQueuedMsgs();
1417 msg_queue->SendIsolateEvent(isolate_id, kind);
1418 if (kind == kInterrupted) {
1419 msg_queue->MessageLoop();
1420 } else {
1421 ASSERT(kind == kShutdown);
1422 RemoveIsolateMsgQueue(isolate_id);
1423 }
1424 Dart_ExitScope();
1425 // If there is no receive message queue, do not wait for a connection, and 1413 // If there is no receive message queue, do not wait for a connection, and
1426 // ignore the message. 1414 // ignore the message.
1415 if (msg_queue != NULL) {
zra 2015/10/26 20:51:10 The vm isolate does not have a debug message queue
1416 DebuggerConnectionHandler::WaitForConnection();
1417 Dart_EnterScope();
1418 msg_queue->SendQueuedMsgs();
1419 msg_queue->SendIsolateEvent(isolate_id, kind);
1420 if (kind == kInterrupted) {
1421 msg_queue->MessageLoop();
1422 } else {
1423 ASSERT(kind == kShutdown);
1424 RemoveIsolateMsgQueue(isolate_id);
1425 }
1426 Dart_ExitScope();
1427 }
1427 } 1428 }
1428 } 1429 }
1429 1430
1430 } // namespace bin 1431 } // namespace bin
1431 } // namespace dart 1432 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698