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

Side by Side Diff: sync/sessions/sync_session.cc

Issue 10006046: Abort sync cycles when download step fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retry on migration done responses Created 8 years, 8 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
« no previous file with comments | « sync/sessions/status_controller.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/sessions/sync_session.h" 5 #include "sync/sessions/sync_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 return enabled_groups_with_verified_updates; 228 return enabled_groups_with_verified_updates;
229 } 229 }
230 230
231 namespace { 231 namespace {
232 // Return true if the command in question was attempted and did not complete 232 // Return true if the command in question was attempted and did not complete
233 // successfully. 233 // successfully.
234 // 234 //
235 bool IsError(SyncerError error) { 235 bool IsError(SyncerError error) {
236 return error != UNSET 236 return error != UNSET
237 && error != SYNCER_OK 237 && error != SYNCER_OK;
238 && error != SERVER_RETURN_MIGRATION_DONE;
239 } 238 }
240 } // namespace 239 } // namespace
241 240
242 bool SyncSession::Succeeded() const { 241 bool SyncSession::Succeeded() const {
243 const bool download_updates_error = 242 const bool download_updates_error =
244 IsError(status_controller_->error().last_download_updates_result); 243 IsError(status_controller_->error().last_download_updates_result);
245 const bool post_commit_error = 244 const bool post_commit_error =
246 IsError(status_controller_->error().last_post_commit_result); 245 IsError(status_controller_->error().last_post_commit_result);
247 const bool process_commit_response_error = 246 const bool process_commit_response_error =
248 IsError(status_controller_->error().last_process_commit_response_result); 247 IsError(status_controller_->error().last_process_commit_response_result);
249 return !download_updates_error 248 return !download_updates_error
250 && !post_commit_error 249 && !post_commit_error
251 && !process_commit_response_error; 250 && !process_commit_response_error;
252 } 251 }
253 252
254 } // namespace sessions 253 } // namespace sessions
255 } // namespace browser_sync 254 } // namespace browser_sync
OLDNEW
« no previous file with comments | « sync/sessions/status_controller.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698