Commit daf8de60 authored by manukh's avatar manukh Committed by Commit Bot

[omnibox] [entity-latency] Fix crashes on incotnito & guest profiles.

On creation (and ominbox changes), the omnibox attempts to wakeup the
current profile's BitmapFetcherService by invoking
BitmapFetcherService::WakeupDecoder. But incognito and guest profiles do
not have a BitmapFetcherService, resulting in calling WakeupDecoder on a
nullptr and crashing. The recent CL crrev.com/c/2348328 introduced this
wakeup call.

This CL adds a prior null check. Other usages of BitmapFetcherService
don't require a null check as they're conditioned on the existence of
omnibox images which requires a non-incognito/guest profile.

Bug: 1115108, 1128282
Change-Id: If0c21b6743182dfb7e5ab1d3f75fc7da6ee0bad1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411655
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807134}
parent 2ba65b0e
......@@ -472,8 +472,10 @@ void ChromeOmniboxClient::WakeupDecoder() {
omnibox::kEntitySuggestionsReduceLatency,
OmniboxFieldTrial::kEntitySuggestionsReduceLatencyDecoderWakeupParam,
false)) {
BitmapFetcherServiceFactory::GetForBrowserContext(profile_)
->WakeupDecoder();
if (auto* service =
BitmapFetcherServiceFactory::GetForBrowserContext(profile_)) {
service->WakeupDecoder();
}
}
}
......
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