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

Unified Diff: runtime/bin/dbg_connection.cc

Issue 271153002: Add pause/resume for isolates in vmservice/observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.cc
diff --git a/runtime/bin/dbg_connection.cc b/runtime/bin/dbg_connection.cc
index 0d92133ac1812917da9890a63e3cf9ff300d9f90..3695e2abac36911f2adb5a485f455ee9d26c0619 100644
--- a/runtime/bin/dbg_connection.cc
+++ b/runtime/bin/dbg_connection.cc
@@ -297,11 +297,18 @@ void DebuggerConnectionHandler::CloseDbgConnection() {
}
+// The vm service relies on certain debugger functionality.
+void DebuggerConnectionHandler::InitForVmService() {
+ MonitorLocker ml(handler_lock_);
+ DbgMsgQueueList::Initialize();
+}
+
+
int DebuggerConnectionHandler::StartHandler(const char* address,
int port_number) {
ASSERT(handler_lock_ != NULL);
MonitorLocker ml(handler_lock_);
- if (listener_fd_ != -1) {
+ if (IsListening()) {
// The debugger connection handler was already started.
return Socket::GetPort(listener_fd_);
}
@@ -333,6 +340,11 @@ int DebuggerConnectionHandler::StartHandler(const char* address,
void DebuggerConnectionHandler::WaitForConnection() {
ASSERT(handler_lock_ != NULL);
MonitorLocker ml(handler_lock_);
+ if (!IsListening()) {
+ // If we are only running the vm service, don't wait for
+ // connections.
+ return;
+ }
while (!IsConnected()) {
dart::Monitor::WaitResult res = ml.Wait();
ASSERT(res == dart::Monitor::kNotified);
@@ -350,6 +362,11 @@ void DebuggerConnectionHandler::SendMsg(int debug_fd, dart::TextBuffer* msg) {
void DebuggerConnectionHandler::BroadcastMsg(dart::TextBuffer* msg) {
ASSERT(handler_lock_ != NULL);
MonitorLocker ml(handler_lock_);
+ if (!IsListening()) {
+ // If we are only running the vm service, don't try to broadcast
+ // to debugger clients.
+ return;
+ }
// TODO(asiva): Once we support connection to multiple debuggers
// we need to send the message to all of them.
ASSERT(singleton_handler != NULL);
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698