Commit 842da49b authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

Reland "[Sync] Use forwarding delegate for PRINTERS sync"

This is a reland of 5a3884b6.
The original patch has been reverted because it caused flakiness in
ChromeLauncherControllerWithArcTest.Arc* tests. Since the real underlying
issue 966561 has been fixed in the mean-time, it should be safe to reland.

Original change's description:
> [Sync] Use forwarding delegate for PRINTERS sync
>
> Printers sync runs on the UI thread but so far uses a proxy delegate
> that posts tasks from UI thread to UI thread.
>
> This CL simplifies that and employs a forwarding delegate that runs
> tasks synchronously. After this CL, all data types running on the UI
> thread will have forwarding delegates.
>
> Bug: 867801
> Change-Id: I08e261323a9caa816899dd924f09ecdee69ec936
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621907
> Commit-Queue: Jan Krcal <jkrcal@chromium.org>
> Auto-Submit: Jan Krcal <jkrcal@chromium.org>
> Reviewed-by: Mikel Astiz <mastiz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#661732}

TBR=mastiz@chromium.org

Bug: 867801
Change-Id: I653d746337b860570447abdd74532b288161f203
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796807Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695561}
parent 19eb6004
......@@ -322,18 +322,8 @@ ProfileSyncComponentsFactoryImpl::CreateCommonDataTypeControllers(
#if defined(OS_CHROMEOS)
if (!disabled_types.Has(syncer::PRINTERS)) {
// TODO(crbug.com/867801) This still uses a proxy delegate even though the
// model lives on the UI thread. Switching to forwarding delegate causes
// cryptic test failures on chromeos. Fix that and switch to the forwarding
// delegate.
controllers.push_back(std::make_unique<ModelTypeController>(
syncer::PRINTERS,
std::make_unique<syncer::ProxyModelTypeControllerDelegate>(
ui_thread_,
base::BindRepeating(&browser_sync::BrowserSyncClient::
GetControllerDelegateForModelType,
base::Unretained(sync_client_),
syncer::PRINTERS))));
controllers.push_back(
CreateModelTypeControllerForModelRunningOnUIThread(syncer::PRINTERS));
}
if (!disabled_types.Has(syncer::WIFI_CONFIGURATIONS) &&
base::FeatureList::IsEnabled(switches::kSyncWifiConfigurations)) {
......
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