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

Unified Diff: chrome/browser/sync/sessions/session_state.h

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/sessions/session_state.h
diff --git a/chrome/browser/sync/sessions/session_state.h b/chrome/browser/sync/sessions/session_state.h
index 72bcb007d61dc27434cf87e8e5538ed540578448..44fc59ce377f827711e726e75cc117608b5cc32d 100644
--- a/chrome/browser/sync/sessions/session_state.h
+++ b/chrome/browser/sync/sessions/session_state.h
@@ -161,22 +161,13 @@ struct SyncSessionSnapshot {
const bool retry_scheduled;
};
-// Tracks progress of conflicts and their resolution using conflict sets.
+// Tracks progress of conflicts and their resolution.
Nicolas Zea 2012/02/01 19:16:19 resolutions
rlarocque 2012/02/02 00:32:56 Done.
class ConflictProgress {
public:
explicit ConflictProgress(bool* dirty_flag);
~ConflictProgress();
- // Various iterators, size, and retrieval functions for conflict sets.
- IdToConflictSetMap::const_iterator IdToConflictSetBegin() const;
- IdToConflictSetMap::const_iterator IdToConflictSetEnd() const;
- IdToConflictSetMap::size_type IdToConflictSetSize() const;
- IdToConflictSetMap::const_iterator IdToConflictSetFind(
- const syncable::Id& the_id) const;
- const ConflictSet* IdToConflictSetGet(const syncable::Id& the_id);
- std::set<ConflictSet*>::const_iterator ConflictSetsBegin() const;
- std::set<ConflictSet*>::const_iterator ConflictSetsEnd() const;
- std::set<ConflictSet*>::size_type ConflictSetsSize() const;
- bool HasSimpleConflictItem(const syncable::Id& id) const;
+
+ bool HasSimpleConflictItem(const syncable::Id &id) const;
// Various mutators for tracking commit conflicts.
void AddConflictingItemById(const syncable::Id& the_id);
@@ -187,24 +178,28 @@ class ConflictProgress {
// Mutators for nonblocking conflicting items (see description below).
void AddNonblockingConflictingItemById(const syncable::Id& the_id);
- void EraseNonblockingConflictingItemById(const syncable::Id& the_id);
int NonblockingConflictingItemsSize() const {
return nonblocking_conflicting_item_ids_.size();
}
- void MergeSets(const syncable::Id& set1, const syncable::Id& set2);
- void CleanupSets();
+ void AddHierarchyConflictingItemById(const syncable::Id& id);
+ int HierarchyConflictingItemsSize() const {
+ return hierarchy_conflicting_item_ids_.size();
+ }
private:
- // TODO(sync): move away from sets if it makes more sense.
+ // Conflicts that occur when an local and server changes collide, minus
Nicolas Zea 2012/02/01 19:16:19 remove an
rlarocque 2012/02/02 00:32:56 Done.
+ // the nonblocking and hierarchy conflicts.
std::set<syncable::Id> conflicting_item_ids_;
- std::map<syncable::Id, ConflictSet*> id_to_conflict_set_;
- std::set<ConflictSet*> conflict_sets_;
// Nonblocking conflicts are not processed by the conflict resolver, but
// they will be processed in the APPLY_UDPATES_TO_RESOLVE_CONFLICTS step.
std::set<syncable::Id> nonblocking_conflicting_item_ids_;
+ // Hiearchy conflicts are updates that would violate tree invariants if
+ // they were applied.
+ std::set<syncable::Id> hierarchy_conflicting_item_ids_;
rlarocque 2012/01/31 19:12:17 I'm not sure this is the right thing to do. I dec
Nicolas Zea 2012/02/01 19:16:19 I prefer C, probably by adding an extra parameter
rlarocque 2012/02/02 00:32:56 Minor point: If we're going with option C, I'd pre
+
// Whether a conflicting item was added or removed since
// the last call to reset_progress_changed(), if any. In practice this
// points to StatusController::is_dirty_.

Powered by Google App Engine
This is Rietveld 408576698