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

Unified Diff: sync/sessions/sync_session.h

Issue 10917234: sync: make scheduling logic and job ownership more obvious. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eof Created 8 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 | « sync/sessions/session_state_unittest.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 93d7f4161c3f2e745c30bb219d2d3cd9dcff7bfd..4026e88aa9b602ba1f4e17899729ad7799d0691e 100644
--- a/sync/sessions/sync_session.h
+++ b/sync/sessions/sync_session.h
@@ -112,25 +112,11 @@ class SyncSession {
// engine again.
bool HasMoreToSync() const;
- // 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,
- // inability to authenticate with the server, and server errors. What they
- // have in common is that the we either need to take some action and then
- // retry the sync cycle or, in the case of transient errors, retry after some
- // backoff timer has expired. Most importantly, the SyncScheduler should not
- // assume that the original action that triggered the sync cycle (ie. a nudge
- // or a notification) has been properly serviced.
- //
- // 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.
- 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 SuccessfullyReachedServer() const;
+ // Returns true if we reached the server. Note that "reaching the server"
+ // here means that from an HTTP perspective, we succeeded (HTTP 200). The
+ // server **MAY** have returned a sync protocol error.
+ // See SERVER_RETURN_* in the SyncerError enum for values.
+ bool DidReachServer() const;
// Collects all state pertaining to how and why |s| originated and unions it
// with corresponding state in |this|, leaving |s| unchanged. Allows |this|
@@ -139,11 +125,13 @@ class SyncSession {
// sessions.
void Coalesce(const SyncSession& session);
- // Compares the routing_info_, workers and payload map with the passed in
- // session. Purges types from the above 3 which are not in session. Useful
+ // Compares the routing_info_, workers and payload map with those passed in.
+ // Purges types from the above 3 which are not present in latest. Useful
// to update the sync session when the user has disabled some types from
// syncing.
- void RebaseRoutingInfoWithLatest(const SyncSession& session);
+ void RebaseRoutingInfoWithLatest(
+ const ModelSafeRoutingInfo& routing_info,
+ const std::vector<ModelSafeWorker*>& workers);
// Should be called any time |this| is being re-used in a new call to
// SyncShare (e.g., HasMoreToSync returned true).
@@ -177,9 +165,6 @@ class SyncSession {
// Returns the set of enabled groups that have conflicts.
std::set<ModelSafeGroup> GetEnabledGroupsWithConflicts() 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
@@ -217,10 +202,6 @@ class SyncSession {
// |routing_info_|.
std::set<ModelSafeGroup> enabled_groups_;
- // Whether this session has reached its last step or not. Gets reset on each
- // new cycle (via PrepareForAnotherSyncCycle).
- bool finished_;
-
DISALLOW_COPY_AND_ASSIGN(SyncSession);
};
« no previous file with comments | « sync/sessions/session_state_unittest.cc ('k') | sync/sessions/sync_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698