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

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

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. Created 9 years, 4 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 is_share_useable, 113 is_share_useable,
114 initial_sync_ended, 114 initial_sync_ended,
115 download_progress_markers, 115 download_progress_markers,
116 HasMoreToSync(), 116 HasMoreToSync(),
117 delegate_->IsSyncingCurrentlySilenced(), 117 delegate_->IsSyncingCurrentlySilenced(),
118 status_controller_->unsynced_handles().size(), 118 status_controller_->unsynced_handles().size(),
119 status_controller_->TotalNumBlockingConflictingItems(), 119 status_controller_->TotalNumBlockingConflictingItems(),
120 status_controller_->TotalNumConflictingItems(), 120 status_controller_->TotalNumConflictingItems(),
121 status_controller_->did_commit_items(), 121 status_controller_->did_commit_items(),
122 source_, 122 source_,
123 dir->GetEntriesCount()); 123 dir->GetEntriesCount(),
124 status_controller_->sync_start_time());
124 } 125 }
125 126
126 SyncSourceInfo SyncSession::TestAndSetSource() { 127 SyncSourceInfo SyncSession::TestAndSetSource() {
127 SyncSourceInfo old_source = source_; 128 SyncSourceInfo old_source = source_;
128 source_ = SyncSourceInfo( 129 source_ = SyncSourceInfo(
129 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, 130 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION,
130 source_.types); 131 source_.types);
131 return old_source; 132 return old_source;
132 } 133 }
133 134
134 bool SyncSession::HasMoreToSync() const { 135 bool SyncSession::HasMoreToSync() const {
135 const StatusController* status = status_controller_.get(); 136 const StatusController* status = status_controller_.get();
136 return ((status->commit_ids().size() < status->unsynced_handles().size()) && 137 return ((status->commit_ids().size() < status->unsynced_handles().size()) &&
137 status->syncer_status().num_successful_commits > 0) || 138 status->syncer_status().num_successful_commits > 0) ||
138 status->conflict_sets_built() || 139 status->conflict_sets_built() ||
139 status->conflicts_resolved(); 140 status->conflicts_resolved();
140 // Or, we have conflicting updates, but we're making progress on 141 // Or, we have conflicting updates, but we're making progress on
141 // resolving them... 142 // resolving them...
142 } 143 }
143 144
144 } // namespace sessions 145 } // namespace sessions
145 } // namespace browser_sync 146 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/status_controller_unittest.cc ('k') | chrome/browser/sync/test_profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698