OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/sessions/session_state.h" | 5 #include "chrome/browser/sync/sessions/session_state.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 base::JSONWriter::Write(value.get(), true, &json); | 180 base::JSONWriter::Write(value.get(), true, &json); |
181 return json; | 181 return json; |
182 } | 182 } |
183 | 183 |
184 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} | 184 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} |
185 | 185 |
186 ConflictProgress::~ConflictProgress() { | 186 ConflictProgress::~ConflictProgress() { |
187 CleanupSets(); | 187 CleanupSets(); |
188 } | 188 } |
189 | 189 |
| 190 bool ConflictProgress::HasSimpleConflictItem(const syncable::Id& id) const { |
| 191 return conflicting_item_ids_.count(id) > 0 && |
| 192 (IdToConflictSetFind(id) == IdToConflictSetEnd()); |
| 193 } |
| 194 |
190 IdToConflictSetMap::const_iterator ConflictProgress::IdToConflictSetFind( | 195 IdToConflictSetMap::const_iterator ConflictProgress::IdToConflictSetFind( |
191 const syncable::Id& the_id) const { | 196 const syncable::Id& the_id) const { |
192 return id_to_conflict_set_.find(the_id); | 197 return id_to_conflict_set_.find(the_id); |
193 } | 198 } |
194 | 199 |
195 IdToConflictSetMap::const_iterator | 200 IdToConflictSetMap::const_iterator |
196 ConflictProgress::IdToConflictSetBegin() const { | 201 ConflictProgress::IdToConflictSetBegin() const { |
197 return id_to_conflict_set_.begin(); | 202 return id_to_conflict_set_.begin(); |
198 } | 203 } |
199 | 204 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 390 |
386 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) | 391 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) |
387 : conflict_progress(dirty_flag) { | 392 : conflict_progress(dirty_flag) { |
388 } | 393 } |
389 | 394 |
390 PerModelSafeGroupState::~PerModelSafeGroupState() { | 395 PerModelSafeGroupState::~PerModelSafeGroupState() { |
391 } | 396 } |
392 | 397 |
393 } // namespace sessions | 398 } // namespace sessions |
394 } // namespace browser_sync | 399 } // namespace browser_sync |
OLD | NEW |