From d80f266dd9cb2932a1235c938903d7b8e15e7f3f Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Mon, 20 Mar 2023 15:08:55 -0700 Subject: [PATCH] Call report_failed_launch when VM fails to initialize (#3) This will cause the updater to not recommend that patch again. --- shell/common/BUILD.gn | 2 ++ shell/common/shell.cc | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 19009938162fc..65d1272b9e494 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -150,6 +150,8 @@ source_set("common") { "//third_party/skia", ] + include_dirs = [ "//flutter/updater" ] + if (impeller_supports_rendering) { sources += [ "snapshot_controller_impeller.cc", diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 859a2668c3762..06228ef777a1a 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -41,6 +41,8 @@ #include "third_party/skia/include/utils/SkBase64.h" #include "third_party/tonic/common/log.h" +#include "updater.h" + namespace flutter { constexpr char kSkiaChannel[] = "flutter/skia"; @@ -162,6 +164,9 @@ std::unique_ptr Shell::Create( auto isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); auto vm = DartVMRef::Create(settings, vm_snapshot, isolate_snapshot); FML_CHECK(vm) << "Must be able to initialize the VM."; + if (!vm) { + shorebird_report_failed_launch(); + } // If the settings did not specify an `isolate_snapshot`, fall back to the // one the VM was launched with.