Commit db0a5984 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Fix a shutdown crash when BMO is enabled on Chrome OS.

When web apps are uninstalled and the clear site data option is
selected, the |web_app| object was being accessed after uninstallation
was completed, causing a DCHECK failure. This CL rearranges the call to
clear site data so that its origin is computed before uninstallation.

BUG=1084394

Change-Id: Iab3705096f5658cc30e2aa08c43d56247281cf5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2208156Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770009}
parent 2107a77e
...@@ -134,8 +134,10 @@ void WebAppsChromeOs::Uninstall(const std::string& app_id, ...@@ -134,8 +134,10 @@ void WebAppsChromeOs::Uninstall(const std::string& app_id,
DCHECK(provider()); DCHECK(provider());
DCHECK(provider()->install_finalizer().CanUserUninstallExternalApp(app_id)); DCHECK(provider()->install_finalizer().CanUserUninstallExternalApp(app_id));
auto origin = url::Origin::Create(web_app->launch_url());
provider()->install_finalizer().UninstallExternalAppByUser(app_id, provider()->install_finalizer().UninstallExternalAppByUser(app_id,
base::DoNothing()); base::DoNothing());
web_app = nullptr;
if (!clear_site_data) { if (!clear_site_data) {
// TODO(loyso): Add UMA_HISTOGRAM_ENUMERATION here. // TODO(loyso): Add UMA_HISTOGRAM_ENUMERATION here.
...@@ -152,8 +154,7 @@ void WebAppsChromeOs::Uninstall(const std::string& app_id, ...@@ -152,8 +154,7 @@ void WebAppsChromeOs::Uninstall(const std::string& app_id,
return browser_context; return browser_context;
}, },
base::Unretained(profile())), base::Unretained(profile())),
url::Origin::Create(web_app->launch_url()), origin, kClearCookies, kClearStorage, kClearCache,
kClearCookies, kClearStorage, kClearCache,
kAvoidClosingConnections, base::DoNothing()); kAvoidClosingConnections, base::DoNothing());
} }
......
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