OLD | NEW |
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 "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/internal_api/public/util/time.h" |
14 #include "sync/protocol/bookmark_specifics.pb.h" | 15 #include "sync/protocol/bookmark_specifics.pb.h" |
15 #include "sync/protocol/sync.pb.h" | 16 #include "sync/protocol/sync.pb.h" |
16 #include "sync/sessions/ordered_commit_set.h" | 17 #include "sync/sessions/ordered_commit_set.h" |
17 #include "sync/sessions/sync_session.h" | 18 #include "sync/sessions/sync_session.h" |
18 #include "sync/syncable/directory.h" | 19 #include "sync/syncable/directory.h" |
19 #include "sync/syncable/mutable_entry.h" | 20 #include "sync/syncable/mutable_entry.h" |
20 #include "sync/syncable/syncable_changes_version.h" | 21 #include "sync/syncable/syncable_changes_version.h" |
21 #include "sync/syncable/syncable_proto_util.h" | 22 #include "sync/syncable/syncable_proto_util.h" |
22 #include "sync/syncable/write_transaction.h" | 23 #include "sync/syncable/write_transaction.h" |
23 #include "sync/util/time.h" | |
24 | 24 |
25 using std::set; | 25 using std::set; |
26 using std::string; | 26 using std::string; |
27 using std::vector; | 27 using std::vector; |
28 | 28 |
29 namespace syncer { | 29 namespace syncer { |
30 | 30 |
31 using sessions::SyncSession; | 31 using sessions::SyncSession; |
32 using syncable::Entry; | 32 using syncable::Entry; |
33 using syncable::IS_DEL; | 33 using syncable::IS_DEL; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 if (delta <= static_cast<uint64>(GetGap()*2)) | 255 if (delta <= static_cast<uint64>(GetGap()*2)) |
256 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate. | 256 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate. |
257 else if (lo == GetFirstPosition()) | 257 else if (lo == GetFirstPosition()) |
258 return hi - GetGap(); // Extend range just before successor. | 258 return hi - GetGap(); // Extend range just before successor. |
259 else | 259 else |
260 return lo + GetGap(); // Use or extend range just after predecessor. | 260 return lo + GetGap(); // Use or extend range just after predecessor. |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 } // namespace syncer | 264 } // namespace syncer |
OLD | NEW |