OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "sync/engine/build_commit_command.h" | 5 #include "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> |
11 | 11 |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "sync/engine/syncer_proto_util.h" | 13 #include "sync/engine/syncer_proto_util.h" |
14 #include "sync/protocol/bookmark_specifics.pb.h" | 14 #include "sync/protocol/bookmark_specifics.pb.h" |
15 #include "sync/protocol/sync.pb.h" | 15 #include "sync/protocol/sync.pb.h" |
16 #include "sync/sessions/ordered_commit_set.h" | 16 #include "sync/sessions/ordered_commit_set.h" |
17 #include "sync/sessions/sync_session.h" | 17 #include "sync/sessions/sync_session.h" |
18 #include "sync/syncable/directory.h" | 18 #include "sync/syncable/directory.h" |
19 #include "sync/syncable/mutable_entry.h" | 19 #include "sync/syncable/mutable_entry.h" |
20 #include "sync/syncable/syncable_changes_version.h" | 20 #include "sync/syncable/syncable_changes_version.h" |
21 #include "sync/syncable/syncable_proto_util.h" | 21 #include "sync/syncable/syncable_proto_util.h" |
22 #include "sync/syncable/write_transaction.h" | 22 #include "sync/syncable/syncable_write_transaction.h" |
23 #include "sync/util/time.h" | 23 #include "sync/util/time.h" |
24 | 24 |
25 // TODO(vishwath): Remove this include after node positions have | 25 // TODO(vishwath): Remove this include after node positions have |
26 // shifted to completely using Ordinals. | 26 // shifted to completely using Ordinals. |
27 // See http://crbug.com/145412 . | 27 // See http://crbug.com/145412 . |
28 #include "sync/internal_api/public/base/node_ordinal.h" | 28 #include "sync/internal_api/public/base/node_ordinal.h" |
29 | 29 |
30 using std::set; | 30 using std::set; |
31 using std::string; | 31 using std::string; |
32 using std::vector; | 32 using std::vector; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 if (delta <= static_cast<uint64>(GetGap()*2)) | 260 if (delta <= static_cast<uint64>(GetGap()*2)) |
261 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate. | 261 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate. |
262 else if (lo == GetFirstPosition()) | 262 else if (lo == GetFirstPosition()) |
263 return hi - GetGap(); // Extend range just before successor. | 263 return hi - GetGap(); // Extend range just before successor. |
264 else | 264 else |
265 return lo + GetGap(); // Use or extend range just after predecessor. | 265 return lo + GetGap(); // Use or extend range just after predecessor. |
266 } | 266 } |
267 | 267 |
268 | 268 |
269 } // namespace syncer | 269 } // namespace syncer |
OLD | NEW |