Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2400)

Unified Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 10038041: sync: Loop committing items without downloading updates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index d7bdb1c14124f60198b9043c02ff27bbfc7652ed..2560aaa1e78ae3cf98599ca3dfc21d0e989238c7 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -784,10 +784,11 @@ bool ProfileSyncServiceHarness::IsFullySynced() {
return false;
}
const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
- // snap->unsynced_count == 0 is a fairly reliable indicator of whether or not
- // our timestamp is in sync with the server.
- bool is_fully_synced = IsDataSyncedImpl(snap) &&
- snap->unsynced_count == 0;
+ // If we didn't try to commit anything in the previous cycle, there's a
+ // good chance that we're now fully up to date.
+ bool is_fully_synced =
+ (snap->errors.last_post_commit_result == browser_sync::UNSET)
+ && IsDataSyncedImpl(snap);
DVLOG(1) << GetClientInfoString(
is_fully_synced ? "IsFullySynced: true" : "IsFullySynced: false");
@@ -993,8 +994,6 @@ std::string ProfileSyncServiceHarness::GetClientInfoString(
<< snap->has_more_to_sync
<< ", has_unsynced_items: "
<< service()->HasUnsyncedItems()
- << ", unsynced_count: "
- << snap->unsynced_count
<< ", encryption conflicts: "
<< snap->num_encryption_conflicts
<< ", hierarchy conflicts: "

Powered by Google App Engine
This is Rietveld 408576698