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 // 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_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ | 9 #ifndef SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ |
10 #define CHROME_BROWSER_SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ | 10 #define SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
18 #include "chrome/browser/sync/internal_api/base_transaction.h" | 18 #include "sync/internal_api/base_transaction.h" |
19 #include "chrome/browser/sync/internal_api/change_record.h" | 19 #include "sync/internal_api/change_record.h" |
20 #include "sync/protocol/sync.pb.h" | 20 #include "sync/protocol/sync.pb.h" |
21 | 21 |
22 namespace sync_api { | 22 namespace sync_api { |
23 | 23 |
24 // ChangeReorderBuffer is a utility type which accepts an unordered set | 24 // ChangeReorderBuffer is a utility type which accepts an unordered set |
25 // of changes (via its Push methods), and yields an ImmutableChangeRecordList | 25 // of changes (via its Push methods), and yields an ImmutableChangeRecordList |
26 // (via the GetAllChangesInTreeOrder method) that are in the order that | 26 // (via the GetAllChangesInTreeOrder method) that are in the order that |
27 // the SyncObserver expects them to be. A buffer is initially empty. | 27 // the SyncObserver expects them to be. A buffer is initially empty. |
28 // | 28 // |
29 // The ordering produced by ChangeReorderBuffer is as follows: | 29 // The ordering produced by ChangeReorderBuffer is as follows: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 SpecificsMap specifics_; | 114 SpecificsMap specifics_; |
115 | 115 |
116 // Stores type-specific extra data per-ID. | 116 // Stores type-specific extra data per-ID. |
117 ExtraDataMap extra_data_; | 117 ExtraDataMap extra_data_; |
118 | 118 |
119 DISALLOW_COPY_AND_ASSIGN(ChangeReorderBuffer); | 119 DISALLOW_COPY_AND_ASSIGN(ChangeReorderBuffer); |
120 }; | 120 }; |
121 | 121 |
122 } // namespace sync_api | 122 } // namespace sync_api |
123 | 123 |
124 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ | 124 #endif // SYNC_INTERNAL_API_CHANGE_REORDER_BUFFER_H_ |
OLD | NEW |