Commit 158c453d authored by Jesse McKenna's avatar Jesse McKenna Committed by Commit Bot

desktop-pwas: only update launcher if path exists

This change skips attempting PWA launcher update if the launcher path
does not exist.

Chrome updates PWA launchers by iterating over a list of enabled
bookmark apps. It determines each app's expected launcher path and
attempts to update it. This fails if the launcher path does not exist.

This change saves time spent attempting update when it's not
necessary, and should reduce noise in the WebApp.Launcher.UpdateResult
metric.

Bug: 1123064
Change-Id: Ibb30bb054ad338b84f8fe6ab66f919d800755ce4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382752Reviewed-by: default avatarDavid Bienvenu <davidbienvenu@chromium.org>
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Cr-Commit-Position: refs/heads/master@{#802849}
parent fdae24c2
......@@ -144,7 +144,8 @@ void UpdatePwaLaunchers(std::vector<base::FilePath> launcher_paths) {
// Make a hardlink or copy of |latest_version_path|, and replace the current
// launcher with it.
ReplaceLauncherWithLatestVersion(path, latest_version_path, old_path);
if (base::PathExists(path))
ReplaceLauncherWithLatestVersion(path, latest_version_path, old_path);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment