| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // Defines ChangeReorderBuffer, which can be used to sort a list of item | 5 // Defines ChangeReorderBuffer, which can be used to sort a list of item |
| 6 // actions to achieve the ordering constraint required by the SyncObserver | 6 // actions to achieve the ordering constraint required by the SyncObserver |
| 7 // interface of the SyncAPI. | 7 // interface of the SyncAPI. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_SYNC_ENGINE_CHANGE_REORDER_BUFFER_H_ | 9 #ifndef CHROME_BROWSER_SYNC_ENGINE_CHANGE_REORDER_BUFFER_H_ |
| 10 #define CHROME_BROWSER_SYNC_ENGINE_CHANGE_REORDER_BUFFER_H_ | 10 #define CHROME_BROWSER_SYNC_ENGINE_CHANGE_REORDER_BUFFER_H_ |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // all siblings under a parent will appear in the output, even if they | 32 // all siblings under a parent will appear in the output, even if they |
| 33 // are not explicitly pushed. The sibling order will be preserved in | 33 // are not explicitly pushed. The sibling order will be preserved in |
| 34 // the output list -- items will appear before their sibling-order | 34 // the output list -- items will appear before their sibling-order |
| 35 // successors. | 35 // successors. |
| 36 // (d) When there are no changes to the sibling order under a parent node, | 36 // (d) When there are no changes to the sibling order under a parent node, |
| 37 // the sibling order is not necessarily preserved in the output for | 37 // the sibling order is not necessarily preserved in the output for |
| 38 // its children. | 38 // its children. |
| 39 class ChangeReorderBuffer { | 39 class ChangeReorderBuffer { |
| 40 public: | 40 public: |
| 41 typedef SyncManager::ChangeRecord ChangeRecord; | 41 typedef SyncManager::ChangeRecord ChangeRecord; |
| 42 typedef SyncManager::ExtraChangeRecordData ExtraChangeRecordData; | 42 typedef SyncManager::ExtraPasswordChangeRecordData ExtraChangeRecordData; |
| 43 | 43 |
| 44 ChangeReorderBuffer(); | 44 ChangeReorderBuffer(); |
| 45 ~ChangeReorderBuffer(); | 45 ~ChangeReorderBuffer(); |
| 46 | 46 |
| 47 // Insert an item, identified by the metahandle |id|, into the reorder | 47 // Insert an item, identified by the metahandle |id|, into the reorder |
| 48 // buffer. This item will appear in the output list as an ACTION_ADD | 48 // buffer. This item will appear in the output list as an ACTION_ADD |
| 49 // ChangeRecord. | 49 // ChangeRecord. |
| 50 void PushAddedItem(int64 id) { | 50 void PushAddedItem(int64 id) { |
| 51 operations_[id] = OP_ADD; | 51 operations_[id] = OP_ADD; |
| 52 } | 52 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 // Stores type-specific extra data per-ID. | 114 // Stores type-specific extra data per-ID. |
| 115 ExtraDataMap extra_data_; | 115 ExtraDataMap extra_data_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(ChangeReorderBuffer); | 117 DISALLOW_COPY_AND_ASSIGN(ChangeReorderBuffer); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace sync_api | 120 } // namespace sync_api |
| 121 | 121 |
| 122 #endif // CHROME_BROWSER_SYNC_ENGINE_CHANGE_REORDER_BUFFER_H_ | 122 #endif // CHROME_BROWSER_SYNC_ENGINE_CHANGE_REORDER_BUFFER_H_ |
| OLD | NEW |