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

Unified Diff: chrome/browser/sync/engine/update_applicator.cc

Issue 9305001: sync: Remove the remaining conflict sets code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional comments Created 8 years, 11 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
Index: chrome/browser/sync/engine/update_applicator.cc
diff --git a/chrome/browser/sync/engine/update_applicator.cc b/chrome/browser/sync/engine/update_applicator.cc
index e44083cf69e1a0e3d8b6cfa7584a3948ad6b920a..15e12e43b4fb9bf1138a99ccbb7dcd6c0c54d9c3 100644
--- a/chrome/browser/sync/engine/update_applicator.cc
+++ b/chrome/browser/sync/engine/update_applicator.cc
@@ -79,6 +79,10 @@ bool UpdateApplicator::AttemptOneApplication(
pointer_++;
application_results_.AddEncryptionConflict(entry.Get(syncable::ID));
break;
+ case HIERARCHY_CONFLICT:
+ pointer_++;
+ application_results_.AddHierarchyConflict(entry.Get(syncable::ID));
+ break;
default:
NOTREACHED();
break;
@@ -141,6 +145,10 @@ void UpdateApplicator::ResultTracker::AddEncryptionConflict(syncable::Id id) {
encryption_conflict_ids_.push_back(id);
}
+void UpdateApplicator::ResultTracker::AddHierarchyConflict(syncable::Id id) {
+ hierarchy_conflict_ids_.push_back(id);
+}
+
void UpdateApplicator::ResultTracker::AddSuccess(syncable::Id id) {
successful_ids_.push_back(id);
}
@@ -161,6 +169,14 @@ void UpdateApplicator::ResultTracker::SaveProgress(
conflict_progress->AddNonblockingConflictingItemById(*i);
update_progress->AddAppliedUpdate(CONFLICT, *i);
}
+ for (i = hierarchy_conflict_ids_.begin();
+ i != hierarchy_conflict_ids_.end(); ++i) {
+ // There's nothing we can do locally to make progress on these conflicts.
+ // We add them to the list of non-blocking conflicts, along with the
+ // encryption conflicts.
+ conflict_progress->AddHierarchyConflictingItemById(*i);
+ update_progress->AddAppliedUpdate(CONFLICT, *i);
+ }
for (i = successful_ids_.begin(); i != successful_ids_.end(); ++i) {
conflict_progress->EraseConflictingItemById(*i);
update_progress->AddAppliedUpdate(SUCCESS, *i);
@@ -170,6 +186,7 @@ void UpdateApplicator::ResultTracker::SaveProgress(
void UpdateApplicator::ResultTracker::ClearConflicts() {
conflicting_ids_.clear();
encryption_conflict_ids_.clear();
+ hierarchy_conflict_ids_.clear();
}
bool UpdateApplicator::ResultTracker::no_conflicts() const {

Powered by Google App Engine
This is Rietveld 408576698