OLD | NEW |
---|---|
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/sessions/sync_session.h" | 5 #include "chrome/browser/sync/sessions/sync_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/sync/syncable/directory_manager.h" | 10 #include "chrome/browser/sync/syncable/directory_manager.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 if (update_progress && | 226 if (update_progress && |
227 (update_progress->VerifiedUpdatesBegin() != | 227 (update_progress->VerifiedUpdatesBegin() != |
228 update_progress->VerifiedUpdatesEnd())) { | 228 update_progress->VerifiedUpdatesEnd())) { |
229 enabled_groups_with_verified_updates.insert(*it); | 229 enabled_groups_with_verified_updates.insert(*it); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 return enabled_groups_with_verified_updates; | 233 return enabled_groups_with_verified_updates; |
234 } | 234 } |
235 | 235 |
236 namespace { | |
237 // Return true if the command in question was attempted and did not complete | |
238 // successfully. | |
239 // | |
240 bool IsError(SyncerError error) { | |
241 return error != UNSET && error != SYNCER_OK; | |
242 } | |
243 } // namespace | |
244 | |
245 bool SyncSession::Succeeded() const { | |
246 bool download_updates_error = | |
tim (not reviewing)
2012/01/10 17:17:34
nit - these 3 bools could be const.
rlarocque
2012/01/10 20:40:56
Done.
| |
247 IsError(status_controller_->error().download_updates_result); | |
248 bool post_commit_error = | |
249 IsError(status_controller_->error().post_commit_result); | |
250 bool process_commit_response_error = | |
251 IsError(status_controller_->error().process_commit_response_result); | |
252 return !download_updates_error | |
253 && !post_commit_error | |
254 && !process_commit_response_error; | |
255 } | |
236 | 256 |
237 } // namespace sessions | 257 } // namespace sessions |
238 } // namespace browser_sync | 258 } // namespace browser_sync |
OLD | NEW |