OLD | NEW |
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 Loading... |
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 |
OLD | NEW |