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 #ifndef COMPONENTS_SYNC_SYNCABLE_CHANGE_REORDER_BUFFER_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_CHANGE_REORDER_BUFFER_H_ |
6 #define COMPONENTS_SYNC_SYNCABLE_CHANGE_REORDER_BUFFER_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_CHANGE_REORDER_BUFFER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Output a reordered list of changes to |changes| using the items | 60 // Output a reordered list of changes to |changes| using the items |
61 // that were pushed into the reorder buffer. |sync_trans| is used to | 61 // that were pushed into the reorder buffer. |sync_trans| is used to |
62 // determine the ordering. Returns true if successful, or false if | 62 // determine the ordering. Returns true if successful, or false if |
63 // an error was encountered. | 63 // an error was encountered. |
64 bool GetAllChangesInTreeOrder(const BaseTransaction* sync_trans, | 64 bool GetAllChangesInTreeOrder(const BaseTransaction* sync_trans, |
65 ImmutableChangeRecordList* changes) | 65 ImmutableChangeRecordList* changes) |
66 WARN_UNUSED_RESULT; | 66 WARN_UNUSED_RESULT; |
67 | 67 |
68 private: | 68 private: |
69 class Traversal; | 69 class Traversal; |
70 typedef std::map<int64_t, ChangeRecord::Action> OperationMap; | 70 using OperationMap = std::map<int64_t, ChangeRecord::Action>; |
71 typedef std::map<int64_t, sync_pb::EntitySpecifics> SpecificsMap; | 71 using SpecificsMap = std::map<int64_t, sync_pb::EntitySpecifics>; |
72 typedef std::map<int64_t, linked_ptr<ExtraPasswordChangeRecordData>> | 72 using ExtraDataMap = |
73 ExtraDataMap; | 73 std::map<int64_t, linked_ptr<ExtraPasswordChangeRecordData>>; |
74 | 74 |
75 // Stores the items that have been pushed into the buffer, and the type of | 75 // Stores the items that have been pushed into the buffer, and the type of |
76 // operation that was associated with them. | 76 // operation that was associated with them. |
77 OperationMap operations_; | 77 OperationMap operations_; |
78 | 78 |
79 // Stores entity-specific ChangeRecord data per-ID. | 79 // Stores entity-specific ChangeRecord data per-ID. |
80 SpecificsMap specifics_; | 80 SpecificsMap specifics_; |
81 | 81 |
82 // Stores type-specific extra data per-ID. | 82 // Stores type-specific extra data per-ID. |
83 ExtraDataMap extra_data_; | 83 ExtraDataMap extra_data_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(ChangeReorderBuffer); | 85 DISALLOW_COPY_AND_ASSIGN(ChangeReorderBuffer); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace syncer | 88 } // namespace syncer |
89 | 89 |
90 #endif // COMPONENTS_SYNC_SYNCABLE_CHANGE_REORDER_BUFFER_H_ | 90 #endif // COMPONENTS_SYNC_SYNCABLE_CHANGE_REORDER_BUFFER_H_ |
OLD | NEW |