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

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

Issue 7621085: Server directed error handling backend code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 4 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 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 // The client has been instructed to change its sessions commit 73 // The client has been instructed to change its sessions commit
74 // delay. 74 // delay.
75 virtual void OnReceivedSessionsCommitDelay( 75 virtual void OnReceivedSessionsCommitDelay(
76 const base::TimeDelta& new_delay) = 0; 76 const base::TimeDelta& new_delay) = 0;
77 77
78 // The client needs to cease and desist syncing at once. This occurs when 78 // The client needs to cease and desist syncing at once. This occurs when
79 // the Syncer detects that the backend store has fundamentally changed or 79 // the Syncer detects that the backend store has fundamentally changed or
80 // is a different instance altogether (e.g. swapping from a test instance 80 // is a different instance altogether (e.g. swapping from a test instance
81 // to production, or a global stop syncing operation has wiped the store). 81 // to production, or a global stop syncing operation has wiped the store).
82 // TODO(lipalani) : Replace this function with the one below. This function
83 // stops the current sync cycle and purges the client. In the new model
84 // the former would be done by the |SyncProtocolError| and
85 // the latter(which is an action) would be done in ProfileSyncService
86 // along with the rest of the actions.
82 virtual void OnShouldStopSyncingPermanently() = 0; 87 virtual void OnShouldStopSyncingPermanently() = 0;
83 88
89 // Called for the syncer to respond to the error sent by the server.
90 virtual void OnSyncProtocolError(sessions::SyncSession* session) = 0;
91
84 protected: 92 protected:
85 virtual ~Delegate() {} 93 virtual ~Delegate() {}
86 }; 94 };
87 95
88 SyncSession(SyncSessionContext* context, 96 SyncSession(SyncSessionContext* context,
89 Delegate* delegate, 97 Delegate* delegate,
90 const SyncSourceInfo& source, 98 const SyncSourceInfo& source,
91 const ModelSafeRoutingInfo& routing_info, 99 const ModelSafeRoutingInfo& routing_info,
92 const std::vector<ModelSafeWorker*>& workers); 100 const std::vector<ModelSafeWorker*>& workers);
93 ~SyncSession(); 101 ~SyncSession();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 196
189 private: 197 private:
190 SyncSession* session_; 198 SyncSession* session_;
191 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction); 199 DISALLOW_COPY_AND_ASSIGN(ScopedSetSessionWriteTransaction);
192 }; 200 };
193 201
194 } // namespace sessions 202 } // namespace sessions
195 } // namespace browser_sync 203 } // namespace browser_sync
196 204
197 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ 205 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698