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

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

Issue 10210009: sync: Loop committing items without downloading updates (v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor loop again, add comments + more Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/sync/sync_ui_util.cc » ('j') | sync/engine/commit.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50eac128a2e697e50ef7a7c9d0c5a23053269d32..e37653a20a35d726cdadb1399f32d5204b2be81b 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -786,10 +786,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");
@@ -992,8 +993,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: "
« no previous file with comments | « no previous file | chrome/browser/sync/sync_ui_util.cc » ('j') | sync/engine/commit.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698