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

Side by Side Diff: chrome/browser/sync/sessions/session_state.cc

Issue 8922015: [Sync] Don't commit items with predecessors/parents in conflict. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments. Add racy test case 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 base::JSONWriter::Write(value.get(), true, &json); 183 base::JSONWriter::Write(value.get(), true, &json);
184 return json; 184 return json;
185 } 185 }
186 186
187 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} 187 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {}
188 188
189 ConflictProgress::~ConflictProgress() { 189 ConflictProgress::~ConflictProgress() {
190 CleanupSets(); 190 CleanupSets();
191 } 191 }
192 192
193 bool ConflictProgress::HasSimpleConflictItem(const syncable::Id& id) const {
194 return conflicting_item_ids_.count(id) > 0 &&
195 (IdToConflictSetFind(id) == IdToConflictSetEnd());
196 }
197
193 IdToConflictSetMap::const_iterator ConflictProgress::IdToConflictSetFind( 198 IdToConflictSetMap::const_iterator ConflictProgress::IdToConflictSetFind(
194 const syncable::Id& the_id) const { 199 const syncable::Id& the_id) const {
195 return id_to_conflict_set_.find(the_id); 200 return id_to_conflict_set_.find(the_id);
196 } 201 }
197 202
198 IdToConflictSetMap::const_iterator 203 IdToConflictSetMap::const_iterator
199 ConflictProgress::IdToConflictSetBegin() const { 204 ConflictProgress::IdToConflictSetBegin() const {
200 return id_to_conflict_set_.begin(); 205 return id_to_conflict_set_.begin();
201 } 206 }
202 207
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 393
389 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) 394 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag)
390 : conflict_progress(dirty_flag) { 395 : conflict_progress(dirty_flag) {
391 } 396 }
392 397
393 PerModelSafeGroupState::~PerModelSafeGroupState() { 398 PerModelSafeGroupState::~PerModelSafeGroupState() {
394 } 399 }
395 400
396 } // namespace sessions 401 } // namespace sessions
397 } // namespace browser_sync 402 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698