WebApp: Fix DCHECK in WebAppInstallFinalizer::FinalizeFallbackInstallAfterSync
We have a logical race: 1) The bookmark app object arrives from the server. It doesn't create any registry entries but only enqueues full web application installation (loading url, manifest, icons etc). It gets queued 1st. 2) The web app object arrives from the server. It immediately creates |is_in_sync_install| web app placeholder with all the sync data committed to in-memory registry and leveldb database. Then it enqueues full web application installation (loading url, manifest, icons etc). It gets queued 2nd. 3) The bookmark app task finishes full install first with a success. |FinalizeInstall| overwrites the |is_in_sync_install| web app placeholder with real data from the web site. WebAppInstallManager proceeds to next task in the queue. 4) The web app task fails to load the url. It tries to do a fallback install: it does |FinalizeFallbackInstallAfterSync| instead of |FinalizeInstall|. DCHECK fails because the web app entry was overwritten at step 3. This is tested in SyncRace_InstallBookmarkAppFullThenWebAppFallback unit test. In next CLs: Fix other races and scenarios. Add unit tests. Bug: 1084392 Change-Id: I7196e74e289bfa516a0ca4e455084a7ea6ca8932 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2208790 Commit-Queue: Alexey Baskakov <loyso@chromium.org> Reviewed-by:Alan Cutter <alancutter@chromium.org> Reviewed-by:
Eric Willigers <ericwilligers@chromium.org> Cr-Commit-Position: refs/heads/master@{#770067}
Showing
Please register or sign in to comment