diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-02 02:35:15 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-02 02:35:15 +0000 |
commit | 2a6edab9c655bf0cb32e1172e3a7a745c858e565 (patch) | |
tree | 31e1ccb6082a9c3d2cb33a4c81ec79f25c049ee7 /sync/sessions | |
parent | 12849f68e19b94e3e97fa4276fce61a6aff98ec6 (diff) | |
download | chromium_src-2a6edab9c655bf0cb32e1172e3a7a745c858e565.zip chromium_src-2a6edab9c655bf0cb32e1172e3a7a745c858e565.tar.gz chromium_src-2a6edab9c655bf0cb32e1172e3a7a745c858e565.tar.bz2 |
sync: Don't use ConflictProgress in the resolver
Remove all references to the ConflictProgress struct from the place
where it is needed most: the ConflictResolver. It turns out that the
ConflictResolver's only relevant input is a set of simple conflict IDs,
and it has no need for the rest of the ConflictProgress struct.
This change is a step towards the removal of the ConflictProgress
struct, which will eventually allow us to improve the way that the
syncer handles conflicts.
This commit also cleans up some includes and forward declarations in the
conflict resolver.
BUG=147681
Review URL: https://chromiumcodereview.appspot.com/10989087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r-- | sync/sessions/session_state.cc | 9 | ||||
-rw-r--r-- | sync/sessions/session_state.h | 3 | ||||
-rw-r--r-- | sync/sessions/sync_session.cc | 3 |
3 files changed, 4 insertions, 11 deletions
diff --git a/sync/sessions/session_state.cc b/sync/sessions/session_state.cc index cd99800..015b20c 100644 --- a/sync/sessions/session_state.cc +++ b/sync/sessions/session_state.cc @@ -28,13 +28,8 @@ bool ConflictProgress::HasSimpleConflictItem(const syncable::Id& id) const { return simple_conflicting_item_ids_.count(id) > 0; } -std::set<syncable::Id>::const_iterator -ConflictProgress::SimpleConflictingItemsBegin() const { - return simple_conflicting_item_ids_.begin(); -} -std::set<syncable::Id>::const_iterator -ConflictProgress::SimpleConflictingItemsEnd() const { - return simple_conflicting_item_ids_.end(); +const std::set<syncable::Id>& ConflictProgress::SimpleConflictingItems() const { + return simple_conflicting_item_ids_; } void ConflictProgress::AddSimpleConflictingItemById( diff --git a/sync/sessions/session_state.h b/sync/sessions/session_state.h index 290ecee..eff9591 100644 --- a/sync/sessions/session_state.h +++ b/sync/sessions/session_state.h @@ -33,8 +33,7 @@ class ConflictProgress { // Various mutators for tracking commit conflicts. void AddSimpleConflictingItemById(const syncable::Id& the_id); void EraseSimpleConflictingItemById(const syncable::Id& the_id); - std::set<syncable::Id>::const_iterator SimpleConflictingItemsBegin() const; - std::set<syncable::Id>::const_iterator SimpleConflictingItemsEnd() const; + const std::set<syncable::Id>& SimpleConflictingItems() const; int SimpleConflictingItemsSize() const { return simple_conflicting_item_ids_.size(); } diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc index b7bb5ca..b2be0e5 100644 --- a/sync/sessions/sync_session.cc +++ b/sync/sessions/sync_session.cc @@ -215,8 +215,7 @@ std::set<ModelSafeGroup> SyncSession::GetEnabledGroupsWithConflicts() const { const sessions::ConflictProgress* conflict_progress = status_controller_->GetUnrestrictedConflictProgress(*it); if (conflict_progress && - (conflict_progress->SimpleConflictingItemsBegin() != - conflict_progress->SimpleConflictingItemsEnd())) { + conflict_progress->SimpleConflictingItemsSize() > 0) { enabled_groups_with_conflicts.insert(*it); } } |