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

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

Issue 7861013: Fix the false-positive detection of commit errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another attempt at detecting errors Created 9 years, 2 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.cc ('k') | chrome/browser/sync/profile_sync_service_harness.cc » ('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.h
diff --git a/chrome/browser/sync/profile_sync_service_harness.h b/chrome/browser/sync/profile_sync_service_harness.h
index f7075ab3b56558d66b27a9b9725184a138045059..3812528541935da1ee49fe70fca26ca574904b3a 100644
--- a/chrome/browser/sync/profile_sync_service_harness.h
+++ b/chrome/browser/sync/profile_sync_service_harness.h
@@ -76,9 +76,17 @@ class ProfileSyncServiceHarness
// the wait was successful.
bool AwaitSyncRestart();
- // Blocks the caller until this harness has completed a single sync cycle
+ // Block the caller until this harness has completed a single sync cycle
// since the previous one. Returns true if a sync cycle has completed.
- bool AwaitSyncCycleCompletion(const std::string& reason);
+ bool AwaitDataSyncCompletion(const std::string& reason);
+
+ // Blocks the caller until this harness has completed as many sync cycles as
+ // are required to ensure its progress marker matches the latest available on
+ // the server.
+ //
+ // Note: When other clients are committing changes this will not be reliable.
+ // Use one of the sync cycle functions to handle those cases.
+ bool AwaitFullSyncCompletion(const std::string& reason);
// Blocks the caller until sync has been disabled for this client. Returns
// true if sync is disabled.
@@ -189,8 +197,11 @@ class ProfileSyncServiceHarness
// The sync client is waiting for the first sync cycle to complete.
WAITING_FOR_INITIAL_SYNC,
- // The sync client is waiting for an ongoing sync cycle to complete.
- WAITING_FOR_SYNC_TO_FINISH,
+ // The sync client is waiting for data to be synced.
+ WAITING_FOR_DATA_SYNC,
+
+ // The sync client is waiting for data and progress markers to be synced.
+ WAITING_FOR_FULL_SYNC,
// The sync client anticipates incoming updates leading to a new sync cycle.
WAITING_FOR_UPDATES,
@@ -265,8 +276,20 @@ class ProfileSyncServiceHarness
bool AwaitStatusChangeWithTimeout(int timeout_milliseconds,
const std::string& reason);
+ // A helper for implementing IsDataSynced() and IsFullySynced()
+ bool IsDataSyncedImpl(const browser_sync::sessions::SyncSessionSnapshot*);
+
// Returns true if the sync client has no unsynced items.
- bool IsSynced();
+ bool IsDataSynced();
+
+ // Returns true if the sync client has no unsynced items and its progress
+ // markers are believed to be up to date.
+ //
+ // Although we can't detect when commits from other clients invalidate our
+ // local progress markers, we do know when our own commits have invalidated
+ // our timestmaps. This check returns true when this client has, to the best
+ // of its knowledge, downloaded the latest progress markers.
+ bool IsFullySynced();
// Returns true if there is a backend migration in progress.
bool HasPendingBackendMigration();
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698