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

Side by Side Diff: chrome/browser/sync/sessions/sync_session.h

Issue 9036003: Avoid useless SYNC_CYCLE_CONTINUATION sync cycle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A class representing an attempt to synchronize the local syncable data 5 // A class representing an attempt to synchronize the local syncable data
6 // store with a sync server. A SyncSession instance is passed as a stateful 6 // store with a sync server. A SyncSession instance is passed as a stateful
7 // bundle to and from various SyncerCommands with the goal of converging the 7 // bundle to and from various SyncerCommands with the goal of converging the
8 // client view of data with that of the server. The commands twiddle with 8 // client view of data with that of the server. The commands twiddle with
9 // session status in response to events and hiccups along the way, set and 9 // session status in response to events and hiccups along the way, set and
10 // query session progress with regards to conflict resolution and applying 10 // query session progress with regards to conflict resolution and applying
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // Builds a thread-safe and read-only copy of the current session state. 105 // Builds a thread-safe and read-only copy of the current session state.
106 SyncSessionSnapshot TakeSnapshot() const; 106 SyncSessionSnapshot TakeSnapshot() const;
107 107
108 // Builds and sends a snapshot to the session context's listeners. 108 // Builds and sends a snapshot to the session context's listeners.
109 void SendEventNotification(SyncEngineEvent::EventCause cause); 109 void SendEventNotification(SyncEngineEvent::EventCause cause);
110 110
111 // Returns true if this session contains data that should go through the sync 111 // Returns true if this session contains data that should go through the sync
112 // engine again. 112 // engine again.
113 bool HasMoreToSync() const; 113 bool HasMoreToSync() const;
114 114
115 // Returns true if this session experienced an error that could possibly go
116 // away on its own. This suggests a good course of action would be to try
117 // again later.
118 //
119 // Returns false if the session has not been used in a call to SyncShare, or
120 // if no error was detected, or if at all recorded errors were non-transient.
121 bool ExperiencedTransientError() const;
122
123 // Returns true if this session completed without experiencing any sort of
124 // errors.
125 //
126 // Returns false if SyncShare has not been called on this session yet, or
127 // if ResetTransientState() has been called on this session since the last
128 // call to SyncShare.
129 bool Succeeded() const;
130
115 // Collects all state pertaining to how and why |s| originated and unions it 131 // Collects all state pertaining to how and why |s| originated and unions it
116 // with corresponding state in |this|, leaving |s| unchanged. Allows |this| 132 // with corresponding state in |this|, leaving |s| unchanged. Allows |this|
117 // to take on the responsibilities |s| had (e.g. certain data types) in the 133 // to take on the responsibilities |s| had (e.g. certain data types) in the
118 // next SyncShare operation using |this|, rather than needed two separate 134 // next SyncShare operation using |this|, rather than needed two separate
119 // sessions. 135 // sessions.
120 void Coalesce(const SyncSession& session); 136 void Coalesce(const SyncSession& session);
121 137
122 // Compares the routing_info_, workers and payload map with the passed in 138 // Compares the routing_info_, workers and payload map with the passed in
123 // session. Purges types from the above 3 which are not in session. Useful 139 // session. Purges types from the above 3 which are not in session. Useful
124 // to update the sync session when the user has disabled some types from 140 // to update the sync session when the user has disabled some types from
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 236
221 private: 237 private:
222 SyncSession* session_; 238 SyncSession* session_;
223 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); 239 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction);
224 }; 240 };
225 241
226 } // namespace sessions 242 } // namespace sessions
227 } // namespace browser_sync 243 } // namespace browser_sync
228 244
229 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ 245 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/status_controller.cc ('k') | chrome/browser/sync/sessions/sync_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698