Skip to content

Commit

Permalink
Revert "Allow SIGQUIT to toggle the vm-service server a la command li…
Browse files Browse the repository at this point in the history
…ne Dart. (flutter#3857)" (flutter#3859)

This reverts commit d67b614.

Fuchsia TO-370
  • Loading branch information
rmacnak-google authored Jul 10, 2017
1 parent d67b614 commit dd634d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
15 changes: 7 additions & 8 deletions runtime/dart_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
18 changes: 1 addition & 17 deletions runtime/dart_service_isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit dd634d3

Please sign in to comment.