Commit b8552370 authored by Alan Cutter's avatar Alan Cutter Committed by Chromium LUCI CQ

desktop-pwas: Fix missing empty config dir check when loading preinstalled web apps

This CL replaces a check that was accidentally removed by:
https://chromium-review.googlesource.com/c/chromium/src/+/2422022
Specifically the lines:
    const base::FilePath dir = DetermineScanDir(profile_);
    if (dir.empty()) {
      std::move(callback).Run(std::vector<ExternalInstallOptions>());
      return;
    }

Without this check Chrome would attempt to read json files in its own
installation directory on non-Chrome OS platforms.

Bug: 1157424
Change-Id: I351ad24d13c1ce394660f74013d094adef2a02f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2585257
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarGlen Robertson <glenrob@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836532}
parent 56a15a3f
......@@ -313,12 +313,17 @@ void ExternalWebAppManager::LoadConfigs(ConsumeLoadedConfigs callback) {
return;
}
base::FilePath config_dir = GetConfigDir();
if (config_dir.empty()) {
std::move(callback).Run({});
return;
}
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE,
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
base::BindOnce(&LoadConfigsBlocking, GetConfigDir()),
std::move(callback));
base::BindOnce(&LoadConfigsBlocking, config_dir), std::move(callback));
}
void ExternalWebAppManager::ParseConfigs(ConsumeParsedConfigs callback,
......
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