Chromium Code Reviews| 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 "chrome/browser/sync/syncable/directory_manager.h" | 9 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 10 #include "chrome/browser/sync/syncable/model_type.h" | 10 #include "chrome/browser/sync/syncable/model_type.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool SyncSession::HasMoreToSync() const { | 136 bool SyncSession::HasMoreToSync() const { |
| 137 const StatusController* status = status_controller_.get(); | 137 const StatusController* status = status_controller_.get(); |
| 138 return ((status->commit_ids().size() < status->unsynced_handles().size()) && | 138 return ((status->commit_ids().size() < status->unsynced_handles().size()) && |
| 139 status->syncer_status().num_successful_commits > 0) || | 139 status->syncer_status().num_successful_commits > 0) || |
| 140 status->conflict_sets_built() || | 140 status->conflict_sets_built() || |
| 141 status->conflicts_resolved(); | 141 status->conflicts_resolved(); |
| 142 // Or, we have conflicting updates, but we're making progress on | 142 // Or, we have conflicting updates, but we're making progress on |
| 143 // resolving them... | 143 // resolving them... |
| 144 } | 144 } |
| 145 | |
| 146 bool SyncSession::ExperiencedTransientError() const { | |
| 147 const StatusController* status = status_controller_.get(); | |
| 148 | |
| 149 // In the future, we should be able to report more about the cause of the | |
| 150 // errors and return an enum value. Right now that's not possible because | |
| 151 // our error detection is based on state that can tell us only that an | |
| 152 // error exists, but not much else. | |
| 153 | |
| 154 // We were unable to download all updates, for some unknown reason. | |
| 155 if (status->num_server_changes_remaining() > 0) | |
| 156 return true; | |
| 157 | |
| 158 // Lots of errors could cause this. It is believed all of them are | |
| 159 // transient. | |
|
tim (not reviewing)
2011/09/27 21:20:07
Hm. Don't we increment this for a number of error
rlarocque
2011/09/27 23:42:41
Maybe so. I haven't tracked down all the cases th
| |
| 160 if (status->error().consecutive_errors > 0) | |
| 161 return true; | |
| 162 | |
| 163 return false; | |
| 164 } | |
| 145 | 165 |
| 146 } // namespace sessions | 166 } // namespace sessions |
| 147 } // namespace browser_sync | 167 } // namespace browser_sync |
| OLD | NEW |