@@ -235,55 +235,33 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
235235 settings.executable_name = command_line.argv0 ();
236236 }
237237
238- // Enable the VM Service
239- settings.enable_vm_service =
240- !command_line.HasOption (FlagForSwitch (Switch::DisableVMService)) &&
241- // TODO(bkonyi): remove once flutter_tools no longer uses this option.
242- // See https://github.com/dart-lang/sdk/issues/50233
238+ // Enable Observatory
239+ settings.enable_observatory =
243240 !command_line.HasOption (FlagForSwitch (Switch::DisableObservatory));
244241
245- // Enable mDNS VM Service Publication
246- settings.enable_vm_service_publication =
247- !command_line.HasOption (
248- FlagForSwitch (Switch::DisableVMServicePublication)) &&
249- !command_line.HasOption (
250- FlagForSwitch (Switch::DisableObservatoryPublication));
251-
252- // Set VM Service Host
253- if (command_line.HasOption (FlagForSwitch (Switch::DeviceVMServiceHost))) {
254- command_line.GetOptionValue (FlagForSwitch (Switch::DeviceVMServiceHost),
255- &settings.vm_service_host );
256- } else if (command_line.HasOption (
257- FlagForSwitch (Switch::DeviceObservatoryHost))) {
258- // TODO(bkonyi): remove once flutter_tools no longer uses this option.
259- // See https://github.com/dart-lang/sdk/issues/50233
242+ // Enable mDNS Observatory Publication
243+ settings.enable_observatory_publication = !command_line.HasOption (
244+ FlagForSwitch (Switch::DisableObservatoryPublication));
245+
246+ // Set Observatory Host
247+ if (command_line.HasOption (FlagForSwitch (Switch::DeviceObservatoryHost))) {
260248 command_line.GetOptionValue (FlagForSwitch (Switch::DeviceObservatoryHost),
261- &settings.vm_service_host );
249+ &settings.observatory_host );
262250 }
263- // Default the VM Service port based on --ipv6 if not set.
264- if (settings.vm_service_host .empty ()) {
265- settings.vm_service_host =
251+ // Default the observatory port based on --ipv6 if not set.
252+ if (settings.observatory_host .empty ()) {
253+ settings.observatory_host =
266254 command_line.HasOption (FlagForSwitch (Switch::IPv6)) ? " ::1"
267255 : " 127.0.0.1" ;
268256 }
269257
270- // Set VM Service Port
271- if (command_line.HasOption (FlagForSwitch (Switch::DeviceVMServicePort))) {
272- if (!GetSwitchValue (command_line, Switch::DeviceVMServicePort,
273- &settings.vm_service_port )) {
274- FML_LOG (INFO)
275- << " VM Service port specified was malformed. Will default to "
276- << settings.vm_service_port ;
277- }
278- } else if (command_line.HasOption (
279- FlagForSwitch (Switch::DeviceObservatoryPort))) {
280- // TODO(bkonyi): remove once flutter_tools no longer uses this option.
281- // See https://github.com/dart-lang/sdk/issues/50233
258+ // Set Observatory Port
259+ if (command_line.HasOption (FlagForSwitch (Switch::DeviceObservatoryPort))) {
282260 if (!GetSwitchValue (command_line, Switch::DeviceObservatoryPort,
283- &settings.vm_service_port )) {
261+ &settings.observatory_port )) {
284262 FML_LOG (INFO)
285- << " VM Service port specified was malformed. Will default to "
286- << settings.vm_service_port ;
263+ << " Observatory port specified was malformed. Will default to "
264+ << settings.observatory_port ;
287265 }
288266 }
289267
0 commit comments