From 7489deea9247fbf3a96e6edd979f8e6cfe363189 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 8 Sep 2016 16:35:30 -0700 Subject: [PATCH] Remove the enable_observatory instance variable from blink::Settings. (flutter/engine#3011) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We used to be able to toggle observatory via a command line flag. But now, we enable or disable observatory based on the Flutter product mode. This also allows us to fix an issue where the —non-interactive flags was being hijacked by the Dart initialization logic to enable or disable observatory. However this flag was orignally meant for the standalone runner to launch either to run tests or to run a full graphics enabled window on the desktop. --- engine/src/flutter/common/settings.h | 1 - engine/src/flutter/runtime/dart_init.cc | 17 ++++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/engine/src/flutter/common/settings.h b/engine/src/flutter/common/settings.h index 7fe3f9b8bd..e3901b92cd 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -13,7 +13,6 @@ namespace blink { struct Settings { - bool enable_observatory = false; // Port on target will be auto selected by the OS. A message will be printed // on the target with the port after it has been selected. uint32_t observatory_port = 0; diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index e14970ecec..2546b37cc2 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -203,15 +203,14 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, DartMojoInternal::InitForIsolate(); DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); const Settings& settings = Settings::Get(); - if (settings.enable_observatory) { - std::string ip = "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; - } + + std::string ip = "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; if (g_service_isolate_hook) g_service_isolate_hook(IsRunningPrecompiledCode());