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

Side by Side Diff: chrome/browser/sync/engine/syncer.cc

Issue 9158004: Detect sync server communication errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for review comments Created 8 years, 11 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 #include "chrome/browser/sync/engine/syncer.h" 5 #include "chrome/browser/sync/engine/syncer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 next_step = CLEANUP_DISABLED_TYPES; 137 next_step = CLEANUP_DISABLED_TYPES;
138 break; 138 break;
139 case CLEANUP_DISABLED_TYPES: { 139 case CLEANUP_DISABLED_TYPES: {
140 CleanupDisabledTypesCommand cleanup; 140 CleanupDisabledTypesCommand cleanup;
141 cleanup.Execute(session); 141 cleanup.Execute(session);
142 next_step = DOWNLOAD_UPDATES; 142 next_step = DOWNLOAD_UPDATES;
143 break; 143 break;
144 } 144 }
145 case DOWNLOAD_UPDATES: { 145 case DOWNLOAD_UPDATES: {
146 DownloadUpdatesCommand download_updates; 146 DownloadUpdatesCommand download_updates;
147 download_updates.Execute(session); 147 session->mutable_status_controller()->set_last_download_updates_result(
148 download_updates.Execute(session));
148 next_step = PROCESS_CLIENT_COMMAND; 149 next_step = PROCESS_CLIENT_COMMAND;
149 break; 150 break;
150 } 151 }
151 case PROCESS_CLIENT_COMMAND: { 152 case PROCESS_CLIENT_COMMAND: {
152 ProcessClientCommand(session); 153 ProcessClientCommand(session);
153 next_step = VERIFY_UPDATES; 154 next_step = VERIFY_UPDATES;
154 break; 155 break;
155 } 156 }
156 case VERIFY_UPDATES: { 157 case VERIFY_UPDATES: {
157 VerifyUpdatesCommand verify_updates; 158 VerifyUpdatesCommand verify_updates;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 216
216 next_step = POST_COMMIT_MESSAGE; 217 next_step = POST_COMMIT_MESSAGE;
217 } else { 218 } else {
218 next_step = BUILD_AND_PROCESS_CONFLICT_SETS; 219 next_step = BUILD_AND_PROCESS_CONFLICT_SETS;
219 } 220 }
220 221
221 break; 222 break;
222 } 223 }
223 case POST_COMMIT_MESSAGE: { 224 case POST_COMMIT_MESSAGE: {
224 PostCommitMessageCommand post_commit_command; 225 PostCommitMessageCommand post_commit_command;
225 post_commit_command.Execute(session); 226 session->mutable_status_controller()->set_last_post_commit_result(
227 post_commit_command.Execute(session));
226 next_step = PROCESS_COMMIT_RESPONSE; 228 next_step = PROCESS_COMMIT_RESPONSE;
227 break; 229 break;
228 } 230 }
229 case PROCESS_COMMIT_RESPONSE: { 231 case PROCESS_COMMIT_RESPONSE: {
230 session->mutable_status_controller()->reset_num_conflicting_commits(); 232 session->mutable_status_controller()->reset_num_conflicting_commits();
231 ProcessCommitResponseCommand process_response_command; 233 ProcessCommitResponseCommand process_response_command;
232 process_response_command.Execute(session); 234 session->mutable_status_controller()->
235 set_last_process_commit_response_result(
236 process_response_command.Execute(session));
233 next_step = BUILD_AND_PROCESS_CONFLICT_SETS; 237 next_step = BUILD_AND_PROCESS_CONFLICT_SETS;
234 break; 238 break;
235 } 239 }
236 case BUILD_AND_PROCESS_CONFLICT_SETS: { 240 case BUILD_AND_PROCESS_CONFLICT_SETS: {
237 BuildAndProcessConflictSetsCommand build_process_conflict_sets; 241 BuildAndProcessConflictSetsCommand build_process_conflict_sets;
238 build_process_conflict_sets.Execute(session); 242 build_process_conflict_sets.Execute(session);
239 if (session->status_controller().conflict_sets_built()) 243 if (session->status_controller().conflict_sets_built())
240 next_step = SYNCER_END; 244 next_step = SYNCER_END;
241 else 245 else
242 next_step = RESOLVE_CONFLICTS; 246 next_step = RESOLVE_CONFLICTS;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 entry->Put(SERVER_CTIME, Time()); 352 entry->Put(SERVER_CTIME, Time());
349 entry->Put(SERVER_VERSION, 0); 353 entry->Put(SERVER_VERSION, 0);
350 entry->Put(SERVER_IS_DIR, false); 354 entry->Put(SERVER_IS_DIR, false);
351 entry->Put(SERVER_IS_DEL, false); 355 entry->Put(SERVER_IS_DEL, false);
352 entry->Put(IS_UNAPPLIED_UPDATE, false); 356 entry->Put(IS_UNAPPLIED_UPDATE, false);
353 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); 357 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance());
354 entry->Put(SERVER_POSITION_IN_PARENT, 0); 358 entry->Put(SERVER_POSITION_IN_PARENT, 0);
355 } 359 }
356 360
357 } // namespace browser_sync 361 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/download_updates_command.cc ('k') | chrome/browser/sync/engine/syncer_proto_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698