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

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

Issue 6104003: sync: use progress markers instead of timestamps during GetUpdates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add an #include for <list> Created 9 years, 11 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 | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/browser/sync/sessions/session_state.h » ('j') | no next file with comments »
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 14fba6e56da4623b58926fe735a3d544b1af3d1b..59a55524bb567ed57e16e0b77b9f64ee7f847b4f 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -260,7 +260,6 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
}
break;
}
- GetUpdatedTimestamp();
SignalStateCompleteWithNextState(FULLY_SYNCED);
break;
}
@@ -349,7 +348,6 @@ bool ProfileSyncServiceHarness::AwaitSyncCycleCompletion(
}
} else {
// Client is already synced; don't wait.
- GetUpdatedTimestamp();
return true;
}
}
@@ -475,11 +473,15 @@ bool ProfileSyncServiceHarness::MatchesOtherClient(
other_types.end(),
inserter(intersection_types,
intersection_types.begin()));
- if (intersection_types.empty()) {
- return true;
+ for (syncable::ModelTypeSet::iterator i = intersection_types.begin();
+ i != intersection_types.end();
+ ++i) {
+ if (!partner->IsSynced() ||
+ partner->GetUpdatedTimestamp(*i) != GetUpdatedTimestamp(*i)) {
+ return false;
+ }
}
- return partner->IsSynced() &&
- partner->GetUpdatedTimestamp() == GetUpdatedTimestamp();
+ return true;
}
const SyncSessionSnapshot*
@@ -569,10 +571,11 @@ void ProfileSyncServiceHarness::DisableSyncForAllDatatypes() {
"Client " << id_;
}
-int64 ProfileSyncServiceHarness::GetUpdatedTimestamp() {
+std::string ProfileSyncServiceHarness::GetUpdatedTimestamp(
+ syncable::ModelType model_type) {
const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
DCHECK(snap != NULL) << "GetUpdatedTimestamp(): Sync snapshot is NULL.";
- return snap->max_local_timestamp;
+ return snap->download_progress_markers[model_type];
}
void ProfileSyncServiceHarness::LogClientInfo(std::string message) {
@@ -580,7 +583,8 @@ void ProfileSyncServiceHarness::LogClientInfo(std::string message) {
const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
if (snap) {
VLOG(1) << "Client " << id_ << ": " << message
- << ": max_local_timestamp: " << snap->max_local_timestamp
+ << ": num_updates_downloaded : "
+ << snap->syncer_status.num_updates_downloaded
<< ", has_more_to_sync: " << snap->has_more_to_sync
<< ", unsynced_count: " << snap->unsynced_count
<< ", num_conflicting_updates: " << snap->num_conflicting_updates
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/browser/sync/sessions/session_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698