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

Unified Diff: runtime/bin/main.cc

Issue 237113002: SIGQUIT toggles VM service HTTP server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 440bcccf0bcdcd53e4fd1a2b72de13662e32d5a8..1c593cac6ad2040131278907b2b29c08c0eb0ab1 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -65,12 +65,14 @@ static bool has_compile_all = false;
static bool has_print_script = false;
+static const char* DEFAULT_VM_SERVICE_SERVER_IP = "127.0.0.1";
+static const int DEFAULT_VM_SERVICE_SERVER_PORT = 8181;
// VM Service options.
static bool start_vm_service = false;
-static const char *vm_service_server_ip = NULL;
-static int vm_service_server_port = -1;
-static const char *DEFAULT_VM_SERVICE_SERVER_IP = "127.0.0.1";
-static const int DEFAULT_VM_SERVICE_SERVER_PORT = 8181;
+static const char* vm_service_server_ip = DEFAULT_VM_SERVICE_SERVER_IP;
+// The 0 port is a magic value which results in the first available port
+// being allocated.
+static int vm_service_server_port = 0;
// The environment provided through the command line using -D options.
static dart::HashMap* environment = NULL;
@@ -1014,8 +1016,7 @@ void main(int argc, char** argv) {
if (!start_debugger) {
DebuggerConnectionHandler::InitForVmService();
}
- ASSERT(vm_service_server_ip != NULL && vm_service_server_port >= 0);
- bool r = VmService::Start(vm_service_server_ip , vm_service_server_port);
+ bool r = VmService::Start(vm_service_server_ip, vm_service_server_port);
if (!r) {
Log::PrintErr("Could not start VM Service isolate %s\n",
VmService::GetErrorMessage());
« no previous file with comments | « no previous file | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698