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

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

Issue 7861013: Fix the false-positive detection of commit errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't treat MIGRATION_DONE as an error Created 9 years, 2 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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698