Commit e394070d authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Revert "WebApp: Call RegistryOpenedCallback asynchronously."

This reverts commit 945fcd73.

Reason for revert: Speculative revert for AppControllerPlatformAppBrowserTest.ActivationFocusesBrowserWindow failure. https://ci.chromium.org/p/chromium/builders/ci/Mac10.11%20Tests/50628


Original change's description:
> WebApp: Call RegistryOpenedCallback asynchronously.
> 
> We should break down this synchronous call chain:
> 
> web_app::WebAppSyncBridge::CommitUpdate()
> web_app::ScopedRegistryUpdate::~ScopedRegistryUpdate()
> web_app::WebAppInstallFinalizer::UninstallWebApp()
> web_app::WebAppInstallFinalizer::UninstallWebAppOrRemoveSource()
> web_app::WebAppInstallFinalizer::UninstallExternalWebApp()
> web_app::InstallFinalizer::UninstallExternalWebAppByUrl()
> web_app::PendingAppManagerImpl::UninstallApps()
> web_app::PendingAppManager::SynchronizeInstalledApps()
> web_app::ExternalWebAppManager::OnScanForExternalWebApps()
> web_app::ExternalWebAppManager::ScanForExternalWebApps()
> web_app::ExternalWebAppManager::Start()
> web_app::WebAppProvider::OnRegistryControllerReady()
> web_app::WebAppSyncBridge::OnDatabaseOpened()
> web_app::WebAppDatabase::OnAllMetadataRead()
> syncer::ModelTypeStoreImpl::ReadAllMetadataDone()
> 
> WebAppSyncBridge::OnDatabaseOpened() must not cause immediate
> WebAppSyncBridge::CommitUpdate() on same `this`.
> 
> Bug: 1084939
> Change-Id: Ib32c52780a647a0985418c0f92985f041869f104
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212236
> Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
> Commit-Queue: Alexey Baskakov <loyso@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#771473}

TBR=ericwilligers@chromium.org,loyso@chromium.org

Change-Id: I80600ec60e1f669ca0823caf77ce36a3985d9dbe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1084939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213648Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771485}
parent 39e04e09
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "chrome/browser/web_applications/components/web_app_helpers.h" #include "chrome/browser/web_applications/components/web_app_helpers.h"
#include "chrome/browser/web_applications/components/web_app_utils.h" #include "chrome/browser/web_applications/components/web_app_utils.h"
#include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app.h"
...@@ -415,11 +414,8 @@ void WebAppDatabase::OnAllMetadataRead( ...@@ -415,11 +414,8 @@ void WebAppDatabase::OnAllMetadataRead(
registry.emplace(app_id, std::move(web_app)); registry.emplace(app_id, std::move(web_app));
} }
std::move(callback).Run(std::move(registry), std::move(metadata_batch));
opened_ = true; opened_ = true;
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), std::move(registry),
std::move(metadata_batch)));
} }
void WebAppDatabase::OnDataWritten( void WebAppDatabase::OnDataWritten(
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/containers/flat_set.h" #include "base/containers/flat_set.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/util/type_safety/pass_key.h" #include "base/util/type_safety/pass_key.h"
#include "chrome/browser/web_applications/components/web_app_helpers.h" #include "chrome/browser/web_applications/components/web_app_helpers.h"
#include "chrome/browser/web_applications/components/web_app_utils.h" #include "chrome/browser/web_applications/components/web_app_utils.h"
...@@ -316,11 +315,9 @@ void WebAppSyncBridge::OnDatabaseOpened( ...@@ -316,11 +315,9 @@ void WebAppSyncBridge::OnDatabaseOpened(
change_processor()->ModelReadyToSync(std::move(metadata_batch)); change_processor()->ModelReadyToSync(std::move(metadata_batch));
registrar_->InitRegistry(std::move(registry)); registrar_->InitRegistry(std::move(registry));
std::move(callback).Run();
MaybeInstallAppsInSyncInstall(); MaybeInstallAppsInSyncInstall();
base::SequencedTaskRunnerHandle::Get()->PostTask(FROM_HERE,
std::move(callback));
} }
void WebAppSyncBridge::OnDataWritten(CommitCallback callback, bool success) { void WebAppSyncBridge::OnDataWritten(CommitCallback callback, bool success) {
......
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