From 4d7272446d69d8803b00d3547bc22e52bbc24037 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Thu, 17 Mar 2016 09:44:54 -0700 Subject: [PATCH] Auto select Observatory port on Android and iOS simulators --- sky/engine/core/script/dart_init.cc | 2 +- sky/engine/public/platform/sky_settings.h | 4 +++- sky/shell/shell.cc | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sky/engine/core/script/dart_init.cc b/sky/engine/core/script/dart_init.cc index 6261f87da3b..d087c7ca580 100644 --- a/sky/engine/core/script/dart_init.cc +++ b/sky/engine/core/script/dart_init.cc @@ -360,7 +360,7 @@ void InitDartVM() { Vector args; args.append(kDartProfilingArgs, arraysize(kDartProfilingArgs)); - + if (!IsRunningPrecompiledCode()) { // The version of the VM setup to run precompiled code does not recognize // the mirrors or the background compilation flags. They are never enabled. diff --git a/sky/engine/public/platform/sky_settings.h b/sky/engine/public/platform/sky_settings.h index 12a4e1f0a37..fe7558f58b1 100644 --- a/sky/engine/public/platform/sky_settings.h +++ b/sky/engine/public/platform/sky_settings.h @@ -11,7 +11,9 @@ namespace blink { struct SkySettings { bool enable_observatory = false; - uint32_t observatory_port = 8181; + // 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; bool start_paused = false; bool enable_dart_checked_mode = false; diff --git a/sky/shell/shell.cc b/sky/shell/shell.cc index 1aa9c09a87f..8cdc2d25704 100644 --- a/sky/shell/shell.cc +++ b/sky/shell/shell.cc @@ -110,7 +110,8 @@ void Shell::InitStandalone(std::string icu_data_path) { settings.observatory_port = port; } else { LOG(INFO) - << "Observatory port specified was malformed. Will default to 8181"; + << "Observatory port specified was malformed. Will default to " + << settings.observatory_port; } } settings.start_paused = command_line.HasSwitch(switches::kStartPaused);