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

Unified Diff: sync/sessions/sync_session.cc

Issue 10933075: FYI: Remove PerModelSafeGroupState + move ConflictResolution (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session.cc
diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc
index b7bb5ca3c7f40bcf4410fb6e657d87304ad42cc1..1258ae4ecb2663105110a8aaeb638aa72891b2a1 100644
--- a/sync/sessions/sync_session.cc
+++ b/sync/sessions/sync_session.cc
@@ -145,13 +145,6 @@ void SyncSession::RebaseRoutingInfoWithLatest(const SyncSession& session) {
enabled_groups_ = ComputeEnabledGroups(routing_info_, workers_);
}
-void SyncSession::PrepareForAnotherSyncCycle() {
- finished_ = false;
- source_.updates_source =
- sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION;
- status_controller_.reset(new StatusController(routing_info_));
-}
-
SyncSessionSnapshot SyncSession::TakeSnapshot() const {
syncable::Directory* dir = context_->directory();
@@ -177,12 +170,12 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
is_share_useable,
initial_sync_ended,
download_progress_markers,
- HasMoreToSync(),
+ false, // FIXME: clean up.
delegate_->IsSyncingCurrentlySilenced(),
- status_controller_->TotalNumEncryptionConflictingItems(),
- status_controller_->TotalNumHierarchyConflictingItems(),
- status_controller_->TotalNumSimpleConflictingItems(),
- status_controller_->TotalNumServerConflictingItems(),
+ status_controller_->num_encryption_conflicts(),
+ status_controller_->num_hierarchy_conflicts(),
+ 0, // FIXME: clean up.
+ status_controller_->num_server_conflicts(),
source_,
context_->notifications_enabled(),
dir->GetEntriesCount(),
@@ -198,49 +191,10 @@ void SyncSession::SendEventNotification(SyncEngineEvent::EventCause cause) {
context()->NotifyListeners(event);
}
-bool SyncSession::HasMoreToSync() const {
- const StatusController* status = status_controller_.get();
- return status->conflicts_resolved();
-}
-
const std::set<ModelSafeGroup>& SyncSession::GetEnabledGroups() const {
return enabled_groups_;
}
-std::set<ModelSafeGroup> SyncSession::GetEnabledGroupsWithConflicts() const {
- const std::set<ModelSafeGroup>& enabled_groups = GetEnabledGroups();
- std::set<ModelSafeGroup> enabled_groups_with_conflicts;
- for (std::set<ModelSafeGroup>::const_iterator it =
- enabled_groups.begin(); it != enabled_groups.end(); ++it) {
- const sessions::ConflictProgress* conflict_progress =
- status_controller_->GetUnrestrictedConflictProgress(*it);
- if (conflict_progress &&
- (conflict_progress->SimpleConflictingItemsBegin() !=
- conflict_progress->SimpleConflictingItemsEnd())) {
- enabled_groups_with_conflicts.insert(*it);
- }
- }
- return enabled_groups_with_conflicts;
-}
-
-std::set<ModelSafeGroup>
- SyncSession::GetEnabledGroupsWithVerifiedUpdates() const {
- const std::set<ModelSafeGroup>& enabled_groups = GetEnabledGroups();
- std::set<ModelSafeGroup> enabled_groups_with_verified_updates;
- for (std::set<ModelSafeGroup>::const_iterator it =
- enabled_groups.begin(); it != enabled_groups.end(); ++it) {
- const UpdateProgress* update_progress =
- status_controller_->GetUnrestrictedUpdateProgress(*it);
- if (update_progress &&
- (update_progress->VerifiedUpdatesBegin() !=
- update_progress->VerifiedUpdatesEnd())) {
- enabled_groups_with_verified_updates.insert(*it);
- }
- }
-
- return enabled_groups_with_verified_updates;
-}
-
namespace {
// Returns false iff one of the command results had an error.
« no previous file with comments | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698