Commit 46e0a622 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Fix status counters in chrome://sync-internals

The regression was introduced in
https://chromium-review.googlesource.com/1160229 which overlooked the
fact that the UI makes assumptions about when it's notified about the
results (i.e. no synchronous reply expected).

There are cleaner alternatives to the proposed fix, but it seems most
conservative to go back to the previous implementation by partially
reverting the offending patch.

Bug: None
Change-Id: I81d82d27234666d407708b1ccd366e493784e9c5
Reviewed-on: https://chromium-review.googlesource.com/1169045
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581880}
parent 1405bbcf
......@@ -26,6 +26,7 @@
#include "components/signin/core/browser/account_info.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_metrics.h"
#include "components/sync/base/bind_to_task_runner.h"
#include "components/sync/base/cryptographer.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/base/report_unrecoverable_error.h"
......@@ -1714,9 +1715,13 @@ std::unique_ptr<base::Value> ProfileSyncService::GetTypeStatusMap() {
dtc_iter->second->state()));
if (dtc_iter->second->state() !=
syncer::DataTypeController::NOT_RUNNING) {
dtc_iter->second->GetStatusCounters(base::BindRepeating(
&ProfileSyncService::OnDatatypeStatusCounterUpdated,
base::Unretained(this)));
// We use BindToCurrentSequence() to make sure observers (i.e.
// |type_debug_info_observers_|) are not notified synchronously, which
// the UI code (chrome://sync-internals) doesn't handle well.
dtc_iter->second->GetStatusCounters(
BindToCurrentSequence(base::BindRepeating(
&ProfileSyncService::OnDatatypeStatusCounterUpdated,
base::Unretained(this))));
}
}
......
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