DescriptionFix a DCHECK failure in AppBannerManager when adding to homescreen from devtools.
If the desktop browser is opened to a banner-eligible PWA, and then
"Add to homescreen" is run from the Devtools "Application" tab, a DCHECK
failure in HostContentSettingsMap is triggered. The cause of this is a
null validated_url; this variable is usually set in
AppBannerManager::DidFinishLoad, but this will not run since banners are
disabled by default on desktop and triggering add to homescreen manually
creates the AppBannerManager after DidFinishLoad is run.
This CL fixes the issue by manually setting the validated_url when the
banner pipeline begins if it is null. This bug should only manifest
itself in this exact instance; enabling banners via
chrome://flags#enable-add-to-shelf ensures that the AppBannerManager is
created.
BUG=None
TEST=Disable "Add to shelf" in chrome://flags in a desktop Chrome
instance. Navigate to a banner-eligible site, open Devtools, and trigger
"Add to homescreen" from the "Application" tab. No crash should happen
and the add to shelf banner should be seen.
Committed: https://crrev.com/25c5044ae450e344a0cb828507618139dcc009d3
Cr-Commit-Position: refs/heads/master@{#423665}
Patch Set 1 #
Messages
Total messages: 12 (7 generated)
|