Commit 830edbed authored by kinuko@chromium.org's avatar kinuko@chromium.org

SyncFS: Fix when to call OnSyncIdle()

Without this fix demoted changes are not correctly promoted

BUG=330116, 240165
TEST=manual with logging (update - delete conflict)
R=nhiroki@chromium.org, tzik@chromium.org

Review URL: https://codereview.chromium.org/119793002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242059 0039d316-1c4b-4281-b951-d872f2087c98
parent 07c0806f
......@@ -93,14 +93,15 @@ void SyncProcessRunner::ScheduleIfNotRunning() {
void SyncProcessRunner::OnChangesUpdated(
int64 pending_changes) {
DCHECK_GE(pending_changes, 0);
if (pending_changes_ != pending_changes) {
int64 old_pending_changes = pending_changes_;
pending_changes_ = pending_changes;
if (old_pending_changes != pending_changes) {
if (pending_changes == 0)
sync_service()->OnSyncIdle();
util::Log(logging::LOG_VERBOSE, FROM_HERE,
"[%s] pending_changes updated: %" PRId64,
name_.c_str(), pending_changes);
}
pending_changes_ = pending_changes;
Schedule();
}
......
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