OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ |
6 #define CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ | 6 #define CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 22 matching lines...) Expand all Loading... |
33 explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes); | 33 explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes); |
34 ~OrderedCommitSet(); | 34 ~OrderedCommitSet(); |
35 | 35 |
36 bool HaveCommitItem(const int64 metahandle) const { | 36 bool HaveCommitItem(const int64 metahandle) const { |
37 return inserted_metahandles_.count(metahandle) > 0; | 37 return inserted_metahandles_.count(metahandle) > 0; |
38 } | 38 } |
39 | 39 |
40 void AddCommitItem(const int64 metahandle, const syncable::Id& commit_id, | 40 void AddCommitItem(const int64 metahandle, const syncable::Id& commit_id, |
41 syncable::ModelType type); | 41 syncable::ModelType type); |
42 | 42 |
| 43 void Clear(); |
| 44 |
43 const std::vector<syncable::Id>& GetAllCommitIds() const { | 45 const std::vector<syncable::Id>& GetAllCommitIds() const { |
44 return commit_ids_; | 46 return commit_ids_; |
45 } | 47 } |
46 | 48 |
47 // Return the Id at index |position| in this OrderedCommitSet. Note that | 49 // Return the Id at index |position| in this OrderedCommitSet. Note that |
48 // the index uniquely identifies the same logical item in each of: | 50 // the index uniquely identifies the same logical item in each of: |
49 // 1) this OrderedCommitSet | 51 // 1) this OrderedCommitSet |
50 // 2) the CommitRequest sent to the server | 52 // 2) the CommitRequest sent to the server |
51 // 3) the list of EntryResponse objects in the CommitResponse. | 53 // 3) the list of EntryResponse objects in the CommitResponse. |
52 // These together allow re-association of the pre-commit Id with the | 54 // These together allow re-association of the pre-commit Id with the |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 std::vector<syncable::ModelType> types_; | 111 std::vector<syncable::ModelType> types_; |
110 | 112 |
111 browser_sync::ModelSafeRoutingInfo routes_; | 113 browser_sync::ModelSafeRoutingInfo routes_; |
112 }; | 114 }; |
113 | 115 |
114 } // namespace sessions | 116 } // namespace sessions |
115 } // namespace browser_sync | 117 } // namespace browser_sync |
116 | 118 |
117 #endif // CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ | 119 #endif // CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ |
118 | 120 |
OLD | NEW |