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

Unified Diff: sync/sessions/sync_session.h

Issue 10537032: [Sync] Fix sync scheduler/session logic determining successful commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 8 years, 6 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 | « sync/engine/syncer.cc ('k') | sync/sessions/sync_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session.h
diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h
index 1dfe78cfd1cb3fe20577360aa8b35e014a29a936..0d78d212ccf277b134dc7d135a529aa37fc88cd1 100644
--- a/sync/sessions/sync_session.h
+++ b/sync/sessions/sync_session.h
@@ -112,7 +112,7 @@ class SyncSession {
// engine again.
bool HasMoreToSync() const;
- // Returns true if there we did not detect any errors in this session.
+ // Returns true if we completely ran the session without errors.
//
// There are many errors that could prevent a sync cycle from succeeding.
// These include invalid local state, inability to contact the server,
@@ -126,8 +126,14 @@ class SyncSession {
// This function also returns false if SyncShare has not been called on this
// session yet, or if ResetTransientState() has been called on this session
// since the last call to SyncShare.
+ //
+ // Note: this method ignore Sync Protocol and Client Actionable errors.
bool Succeeded() const;
+ // Returns true if we reached the server successfully and the server did not
+ // return any error codes. Returns false if no connection was attempted.
+ bool SuccessfullyReachServer() const;
rlarocque 2012/06/06 19:32:32 SuccessfullyReachedServer()?
Nicolas Zea 2012/06/06 20:36:15 Done.
+
// Collects all state pertaining to how and why |s| originated and unions it
// with corresponding state in |this|, leaving |s| unchanged. Allows |this|
// to take on the responsibilities |s| had (e.g. certain data types) in the
@@ -176,6 +182,9 @@ class SyncSession {
// Returns the set of enabled groups that have verified updates.
std::set<ModelSafeGroup> GetEnabledGroupsWithVerifiedUpdates() const;
+ // Mark the session has having finished all the sync steps it needed.
+ void SetFinished();
+
private:
// Extend the encapsulation boundary to utilities for internal member
// assignments. This way, the scope of these actions is explicit, they can't
@@ -213,6 +222,9 @@ class SyncSession {
// |routing_info_|.
std::set<ModelSafeGroup> enabled_groups_;
+ // Whether this session has reached its last step or not.
+ bool finished_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSession);
};
« no previous file with comments | « sync/engine/syncer.cc ('k') | sync/sessions/sync_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698