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

Side by Side Diff: chrome/browser/sync/engine/build_commit_command.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/engine/build_commit_command.h" 5 #include "chrome/browser/sync/engine/build_commit_command.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } else { 197 } else {
198 position_block = std::make_pair( 198 position_block = std::make_pair(
199 FindAnchorPosition(syncable::PREV_ID, meta_entry), 199 FindAnchorPosition(syncable::PREV_ID, meta_entry),
200 FindAnchorPosition(syncable::NEXT_ID, meta_entry)); 200 FindAnchorPosition(syncable::NEXT_ID, meta_entry));
201 } 201 }
202 position_block.first = InterpolatePosition(position_block.first, 202 position_block.first = InterpolatePosition(position_block.first,
203 position_block.second); 203 position_block.second);
204 204
205 position_map[id] = position_block; 205 position_map[id] = position_block;
206 sync_entry->set_position_in_parent(position_block.first); 206 sync_entry->set_position_in_parent(position_block.first);
207 DVLOG(1) << "Setting server position for entry "
208 << meta_entry.Get(syncable::ID)
209 << " from "
210 << meta_entry.Get(syncable::SERVER_POSITION_IN_PARENT)
211 << " to " << position_block.first;
207 } 212 }
208 SetEntrySpecifics(&meta_entry, sync_entry); 213 SetEntrySpecifics(&meta_entry, sync_entry);
209 } 214 }
210 } 215 }
211 session->mutable_status_controller()-> 216 session->mutable_status_controller()->
212 mutable_commit_message()->CopyFrom(message); 217 mutable_commit_message()->CopyFrom(message);
213 218
214 return SYNCER_OK; 219 return SYNCER_OK;
215 } 220 }
216 221
(...skipping 29 matching lines...) Expand all
246 if (delta <= static_cast<uint64>(GetGap()*2)) 251 if (delta <= static_cast<uint64>(GetGap()*2))
247 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate. 252 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate.
248 else if (lo == GetFirstPosition()) 253 else if (lo == GetFirstPosition())
249 return hi - GetGap(); // Extend range just before successor. 254 return hi - GetGap(); // Extend range just before successor.
250 else 255 else
251 return lo + GetGap(); // Use or extend range just after predecessor. 256 return lo + GetGap(); // Use or extend range just after predecessor.
252 } 257 }
253 258
254 259
255 } // namespace browser_sync 260 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/conflict_resolver.cc » ('j') | chrome/browser/sync/engine/get_commit_ids_command.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698