Chromium Code Reviews| 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..b124fbef2f987e2f62b2036b8d6f9fcf74d56ac0 100644 |
| --- a/chrome/browser/sync/engine/update_applicator.cc |
| +++ b/chrome/browser/sync/engine/update_applicator.cc |
| @@ -71,14 +71,18 @@ bool UpdateApplicator::AttemptOneApplication( |
| progress_ = true; |
| application_results_.AddSuccess(entry.Get(syncable::ID)); |
| break; |
| - case CONFLICT: |
| + case CONFLICT_SIMPLE: |
| pointer_++; |
| - application_results_.AddConflict(entry.Get(syncable::ID)); |
| + application_results_.AddSimpleConflict(entry.Get(syncable::ID)); |
| break; |
| case CONFLICT_ENCRYPTION: |
| pointer_++; |
| application_results_.AddEncryptionConflict(entry.Get(syncable::ID)); |
| break; |
| + case CONFLICT_HIERARCHY: |
| + pointer_++; |
| + application_results_.AddHierarchyConflict(entry.Get(syncable::ID)); |
| + break; |
| default: |
| NOTREACHED(); |
| break; |
| @@ -133,7 +137,7 @@ UpdateApplicator::ResultTracker::ResultTracker(size_t num_results) { |
| UpdateApplicator::ResultTracker::~ResultTracker() { |
| } |
| -void UpdateApplicator::ResultTracker::AddConflict(syncable::Id id) { |
| +void UpdateApplicator::ResultTracker::AddSimpleConflict(syncable::Id id) { |
| conflicting_ids_.push_back(id); |
| } |
| @@ -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); |
| } |
| @@ -150,19 +158,27 @@ void UpdateApplicator::ResultTracker::SaveProgress( |
| sessions::UpdateProgress* update_progress) { |
| vector<syncable::Id>::const_iterator i; |
| for (i = conflicting_ids_.begin(); i != conflicting_ids_.end(); ++i) { |
| - conflict_progress->AddConflictingItemById(*i); |
| - update_progress->AddAppliedUpdate(CONFLICT, *i); |
| + conflict_progress->AddSimpleConflictingItemById(*i); |
| + update_progress->AddAppliedUpdate(CONFLICT_SIMPLE, *i); |
| } |
| for (i = encryption_conflict_ids_.begin(); |
| i != encryption_conflict_ids_.end(); ++i) { |
| // Encryption conflicts should not put the syncer into a stuck state. We |
| // mark as conflict, so that we reattempt to apply updates, but add it to |
| // the list of nonblocking conflicts instead of normal conflicts. |
|
Nicolas Zea
2012/02/02 21:53:41
blocking -> unresolvable
rlarocque
2012/02/03 22:31:15
"Fixed" by removing these comments. This is not t
|
| - conflict_progress->AddNonblockingConflictingItemById(*i); |
| - update_progress->AddAppliedUpdate(CONFLICT, *i); |
| + conflict_progress->AddEncryptionConflictingItemById(*i); |
| + update_progress->AddAppliedUpdate(CONFLICT_ENCRYPTION, *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 |
|
Nicolas Zea
2012/02/02 21:53:41
list of unresolvable conflicts
rlarocque
2012/02/03 22:31:15
See above comment.
|
| + // encryption conflicts. |
| + conflict_progress->AddHierarchyConflictingItemById(*i); |
| + update_progress->AddAppliedUpdate(CONFLICT_HIERARCHY, *i); |
| } |
| for (i = successful_ids_.begin(); i != successful_ids_.end(); ++i) { |
| - conflict_progress->EraseConflictingItemById(*i); |
| + conflict_progress->EraseSimpleConflictingItemById(*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 { |