From dd634d349daaa826600c00d5a6c993a33e09a32d Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 10 Jul 2017 15:57:26 -0700 Subject: [PATCH] Revert "Allow SIGQUIT to toggle the vm-service server a la command line Dart. (#3857)" (#3859) This reverts commit d67b614a29fe9dc112ddc0b60b6eb685c1f55eb1. Fuchsia TO-370 --- runtime/dart_init.cc | 15 +++++++-------- runtime/dart_service_isolate.cc | 18 +----------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc index 17a83d7cfddcb..b07e4d490f354 100644 --- a/runtime/dart_init.cc +++ b/runtime/dart_init.cc @@ -195,16 +195,15 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, DartUI::InitForIsolate(); DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); const Settings& settings = Settings::Get(); - std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; - intptr_t port = -1; if (settings.enable_observatory) { - port = settings.observatory_port; + std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; + const intptr_t port = settings.observatory_port; + const bool disable_websocket_origin_check = false; + const bool service_isolate_booted = DartServiceIsolate::Startup( + ip, port, tonic::DartState::HandleLibraryTag, + IsRunningPrecompiledCode(), disable_websocket_origin_check, error); + FTL_CHECK(service_isolate_booted) << error; } - const bool disable_websocket_origin_check = false; - const bool service_isolate_booted = DartServiceIsolate::Startup( - ip, port, tonic::DartState::HandleLibraryTag, - IsRunningPrecompiledCode(), disable_websocket_origin_check, error); - FTL_CHECK(service_isolate_booted) << error; if (g_service_isolate_hook) g_service_isolate_hook(IsRunningPrecompiledCode()); diff --git a/runtime/dart_service_isolate.cc b/runtime/dart_service_isolate.cc index ab2412599089a..8d1300c1e8fb0 100644 --- a/runtime/dart_service_isolate.cc +++ b/runtime/dart_service_isolate.cc @@ -160,7 +160,7 @@ bool DartServiceIsolate::Startup(std::string server_ip, // port when the HTTP server is started. server_port = 0; } - // Set the HTTP server's port. + // Set the HTTP's servers port. result = Dart_SetField(library, Dart_NewStringFromCString("_port"), Dart_NewInteger(server_port)); SHUTDOWN_ON_ERROR(result); @@ -171,22 +171,6 @@ bool DartServiceIsolate::Startup(std::string server_ip, Dart_SetField(library, Dart_NewStringFromCString("_originCheckDisabled"), Dart_NewBoolean(disable_origin_check)); SHUTDOWN_ON_ERROR(result); - - // Get _getWatchSignalInternal from dart:io. - Dart_Handle dart_io_str = Dart_NewStringFromCString("dart:io"); - SHUTDOWN_ON_ERROR(dart_io_str); - Dart_Handle io_lib = Dart_LookupLibrary(dart_io_str); - SHUTDOWN_ON_ERROR(io_lib); - Dart_Handle function_name = - Dart_NewStringFromCString("_getWatchSignalInternal"); - SHUTDOWN_ON_ERROR(function_name); - Dart_Handle signal_watch = Dart_Invoke(io_lib, function_name, 0, NULL); - SHUTDOWN_ON_ERROR(signal_watch); - Dart_Handle field_name = Dart_NewStringFromCString("_signalWatch"); - SHUTDOWN_ON_ERROR(field_name); - result = Dart_SetField(library, field_name, signal_watch); - SHUTDOWN_ON_ERROR(field_name); - return true; }