|
|
DescriptionFix WebApkInstallService::IsInstallInProgress() crash.
The crash happens in a incognito page when a A2HS banner shows for a
WebApp. It is caused since WebApkInstallServiceFactory didn't implemtent
GetBrowserContextToUse() which returns a nullptr as default. In this CL,
the same pointer of the original browser context is returned for the
incognito page, so calling of WebApkInstallerService::Get() can return an
null-empty instance of WebApkInstallerService.
Crash Stacktrace:
Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD
Stack Quality20%Show frame trust levels
0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&)
0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&)
0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck()
0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck()
0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&)
0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode)
0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask()
0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&)
BUG=679826
Review-Url: https://codereview.chromium.org/2620403002
Cr-Commit-Position: refs/heads/master@{#443293}
Committed: https://chromium.googlesource.com/chromium/src/+/7ff526a78d1d5b3bd4757b66b7557d23e5d8bf0f
Patch Set 1 #Patch Set 2 : Handle the incognito mode. #
Total comments: 6
Patch Set 3 : Returns the same browser context in the incognito mode. #Patch Set 4 #
Messages
Total messages: 35 (21 generated)
Description was changed from ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. BUG=679826 ========== to ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. I guess it is caused by null pointer issue, but I can't reproduce it. Add a null check for WebApkInstallerService::Get() to see whehther the crash will gone. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ==========
Patchset #2 (id:20001) has been deleted
Patchset #1 (id:1) has been deleted
Description was changed from ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. I guess it is caused by null pointer issue, but I can't reproduce it. Add a null check for WebApkInstallerService::Get() to see whehther the crash will gone. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ========== to ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. I guess it is caused by null pointer issue, but I can't reproduce it. Add a null check for WebApkInstallerService::Get() to see whehther the crash will gone. Current link: https://crash.corp.google.com/browse?q=product.name%3D'Chrome_Android'%20AND%... Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ==========
hanxi@chromium.org changed reviewers: + pkotwicz@chromium.org
Hi Peter, could you please take a look? Thanks!
I managed to reproduce the crash locally. I get this crash when I visit tests.peter.sh in an incognito tab. I am confused why we try to show the banner in an incognito tab. You may need to implement WebApkInstallServiceFactory::GetBrowserContextToUse()
Patchset #1 (id:40001) has been deleted
Patchset #2 (id:80001) has been deleted
Description was changed from ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. I guess it is caused by null pointer issue, but I can't reproduce it. Add a null check for WebApkInstallerService::Get() to see whehther the crash will gone. Current link: https://crash.corp.google.com/browse?q=product.name%3D'Chrome_Android'%20AND%... Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ========== to ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. I guess it is caused by null pointer issue, but I can't reproduce it. Add a null check for WebApkInstallerService::Get() to see whehther the crash will gone. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ==========
Description was changed from ========== Fix WebApkInstallService::IsInstallInProgress() crash. This crash happens when either WebAPK isn't enabled or the site isn't WebAPK-compatible. I guess it is caused by null pointer issue, but I can't reproduce it. Add a null check for WebApkInstallerService::Get() to see whehther the crash will gone. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ========== to ========== Fix WebApkInstallService::IsInstallInProgress() crash. It might be caused in incognito mode. Implement WebApkInstallServiceFactory::GetBrowserContextToUse() to fix. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ==========
Patchset #1 (id:60001) has been deleted
Thank you Peter for the suggestion, I added the implementation in. I noticed the incognito crash stacktrace is a little bit different than the crash report, so I kept my previous changes as well, hoping it can catch any other case that can lead to a null WebApkInstallService. PTAL, thanks!
https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... File chrome/browser/android/shortcut_helper.cc (right): https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... chrome/browser/android/shortcut_helper.cc:276: return service != nullptr && service->IsInstallInProgress(manifest_url); This is no longer necessary? https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... File chrome/browser/android/webapk/webapk_install_service_factory.cc (right): https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... chrome/browser/android/webapk/webapk_install_service_factory.cc:38: // The base class's implementation returns nullptr. Are you sure that you want incognito and non-incognito to use different WebApkInstallService instances? This means that it would be possible to start an install from an incognito tab while an install started from a non incognito tab is in progress. I think that you are supposed to return one of chrome/browser/profiles/incognito_helpers.h
PTAL, thanks! https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... File chrome/browser/android/shortcut_helper.cc (right): https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... chrome/browser/android/shortcut_helper.cc:276: return service != nullptr && service->IsInstallInProgress(manifest_url); On 2017/01/12 15:37:42, pkotwicz wrote: > This is no longer necessary? I am just not 100 presents sure whether it is necessary or not, since the stacktrace of the incognito mode crash isn't exactly same as the crash report. But we could give it a try by removing these checks. https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... File chrome/browser/android/webapk/webapk_install_service_factory.cc (right): https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... chrome/browser/android/webapk/webapk_install_service_factory.cc:38: // The base class's implementation returns nullptr. On 2017/01/12 15:37:42, pkotwicz wrote: > Are you sure that you want incognito and non-incognito to use different > WebApkInstallService instances? This means that it would be possible to start an > install from an incognito tab while an install started from a non incognito tab > is in progress. > > I think that you are supposed to return one of > chrome/browser/profiles/incognito_helpers.h Makes sense.
https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... File chrome/browser/android/webapk/webapk_install_service_factory.cc (right): https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... chrome/browser/android/webapk/webapk_install_service_factory.cc:38: // The base class's implementation returns nullptr. I think that you should be using GetBrowserContextRedirectedInIncognito() for the reason described in my previous comment
PTAL, thanks! https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... File chrome/browser/android/webapk/webapk_install_service_factory.cc (right): https://codereview.chromium.org/2620403002/diff/120001/chrome/browser/android... chrome/browser/android/webapk/webapk_install_service_factory.cc:38: // The base class's implementation returns nullptr. On 2017/01/12 15:55:40, pkotwicz wrote: > I think that you should be using GetBrowserContextRedirectedInIncognito() for > the reason described in my previous comment Oops, choose the wrong one.
LGTM
hanxi@chromium.org changed reviewers: + dfalcantara@chromium.org
Hi Dan, I need OWNERS review, could you please take a look? Thanks!
pkotwicz@chromium.org changed reviewers: - dfalcantara@chromium.org
You should clarify your CL description. You should include a description of why the crash was occurring. I don't think that the crash stack is useful in the CL description
The CQ bit was checked by hanxi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Fix WebApkInstallService::IsInstallInProgress() crash. It might be caused in incognito mode. Implement WebApkInstallServiceFactory::GetBrowserContextToUse() to fix. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ========== to ========== Fix WebApkInstallService::IsInstallInProgress() crash. The crash happens in a incognito page when a A2HS banner shows for a WebApp. It is caused since WebApkInstallServiceFactory didn't implemtent GetBrowserContextToUse() which returns a nullptr as default. In this CL, the same pointer of the original browser context is returned for the incognito page, so calling of WebApkInstallerService::Get() can return an null-empty instance of WebApkInstallerService. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ==========
On 2017/01/12 16:49:56, pkotwicz wrote: > You should clarify your CL description. You should include a description of why > the crash was occurring. > > I don't think that the crash stack is useful in the CL description Updated.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
dfalcantara@chromium.org changed reviewers: + dfalcantara@chromium.org
rs lgtm
The CQ bit was checked by hanxi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 160001, "attempt_start_ts": 1484244674873210, "parent_rev": "6d6c1221c00cad25be19f8cf94cc3e0ac0030638", "commit_rev": "7ff526a78d1d5b3bd4757b66b7557d23e5d8bf0f"}
Message was sent while issue was closed.
Description was changed from ========== Fix WebApkInstallService::IsInstallInProgress() crash. The crash happens in a incognito page when a A2HS banner shows for a WebApp. It is caused since WebApkInstallServiceFactory didn't implemtent GetBrowserContextToUse() which returns a nullptr as default. In this CL, the same pointer of the original browser context is returned for the incognito page, so calling of WebApkInstallerService::Get() can return an null-empty instance of WebApkInstallerService. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 ========== to ========== Fix WebApkInstallService::IsInstallInProgress() crash. The crash happens in a incognito page when a A2HS banner shows for a WebApp. It is caused since WebApkInstallServiceFactory didn't implemtent GetBrowserContextToUse() which returns a nullptr as default. In this CL, the same pointer of the original browser context is returned for the incognito page, so calling of WebApkInstallerService::Get() can return an null-empty instance of WebApkInstallerService. Crash Stacktrace: Thread 0 CRASHED [SIGSEGV @ 0x0000000c ] MAGIC SIGNATURE THREAD Stack Quality20%Show frame trust levels 0xd1af55a0 (libmonochrome.so -__tree:878 ) WebApkInstallService::IsInstallInProgress(GURL const&) 0xd1aefe43 (libmonochrome.so -shortcut_helper.cc:273 ) ShortcutHelper::IsWebApkInstalled(content::BrowserContext*, GURL const&, GURL const&) 0xd1a24ea3 (libmonochrome.so -app_banner_manager.cc:244 ) banners::AppBannerManager::PerformInstallableCheck() 0xd1abafd7 (libmonochrome.so -app_banner_manager_android.cc:180 ) banners::AppBannerManagerAndroid::PerformInstallableCheck() 0xd1a25c91 (libmonochrome.so -app_banner_manager.cc:239 ) banners::AppBannerManager::OnDidGetManifest(InstallableData const&) 0xd1a548d5 (libmonochrome.so -callback.h:85 ) InstallableManager::RunCallback(std::__ndk1::pair<InstallableParams, base::Callback<void (InstallableData const&), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> > const&, InstallableStatusCode) 0xd1a54a4d (libmonochrome.so -installable_manager.cc:246 ) InstallableManager::WorkOnTask() 0xd1a54d55 (libmonochrome.so -installable_manager.cc:288 ) InstallableManager::OnDidGetManifest(GURL const&, content::Manifest const&) BUG=679826 Review-Url: https://codereview.chromium.org/2620403002 Cr-Commit-Position: refs/heads/master@{#443293} Committed: https://chromium.googlesource.com/chromium/src/+/7ff526a78d1d5b3bd4757b66b755... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:160001) as https://chromium.googlesource.com/chromium/src/+/7ff526a78d1d5b3bd4757b66b755... |