Commit 2dab220b authored by Giovanni Ortuño Urquidi's avatar Giovanni Ortuño Urquidi Committed by Commit Bot

file-handling: Fix crash in guest sessions

https://crrev.com/c/2360089 added a "IsOffTheRecord" check to fix a crash
in incognito. Unfortunally that introduced a new crash for Guest sessions.
IsOffTheRecord() returns true for both incognito and guest session profile,
which caused guest session to try to use the original login profile which
leads to a crash.

This fixes the issue by excluding guest sessions and only getting the
original profile for incognito mode.

Bug: 1121553
Change-Id: Iface9c78a56de1c44295d503e7090a64cdb471ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377187Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801699}
parent ddd72913
...@@ -146,9 +146,11 @@ void ExecuteWebTask(Profile* profile, ...@@ -146,9 +146,11 @@ void ExecuteWebTask(Profile* profile,
// launched (ie. default handler to open a download from its // launched (ie. default handler to open a download from its
// notification) from Incognito mode. Use the base profile in these // notification) from Incognito mode. Use the base profile in these
// cases (see crbug.com/1111695). // cases (see crbug.com/1111695).
if (profile->IsOffTheRecord()) { if (!apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile)) {
profile = profile->GetOriginalProfile(); profile = profile->GetOriginalProfile();
} }
DCHECK(
apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile));
apps::AppServiceProxy* proxy = apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile); apps::AppServiceProxyFactory::GetForProfile(profile);
......
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