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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 int Size() const { | 71 int Size() const { |
72 return commit_ids_.size(); | 72 return commit_ids_.size(); |
73 } | 73 } |
74 | 74 |
75 // Returns true iff any of the commit ids added to this set have model type | 75 // Returns true iff any of the commit ids added to this set have model type |
76 // BOOKMARKS. | 76 // BOOKMARKS. |
77 bool HasBookmarkCommitId() const; | 77 bool HasBookmarkCommitId() const; |
78 | 78 |
| 79 void Append(const OrderedCommitSet& other); |
79 void AppendReverse(const OrderedCommitSet& other); | 80 void AppendReverse(const OrderedCommitSet& other); |
80 void Truncate(size_t max_size); | 81 void Truncate(size_t max_size); |
81 | 82 |
82 void operator=(const OrderedCommitSet& other); | 83 void operator=(const OrderedCommitSet& other); |
83 private: | 84 private: |
84 // A set of CommitIdProjections associated with particular ModelSafeGroups. | 85 // A set of CommitIdProjections associated with particular ModelSafeGroups. |
85 typedef std::map<browser_sync::ModelSafeGroup, Projection> Projections; | 86 typedef std::map<browser_sync::ModelSafeGroup, Projection> Projections; |
86 | 87 |
87 // Helper container for return value of GetCommitItemAt. | 88 // Helper container for return value of GetCommitItemAt. |
88 struct CommitItem { | 89 struct CommitItem { |
(...skipping 20 matching lines...) Expand all Loading... |
109 std::vector<syncable::ModelType> types_; | 110 std::vector<syncable::ModelType> types_; |
110 | 111 |
111 browser_sync::ModelSafeRoutingInfo routes_; | 112 browser_sync::ModelSafeRoutingInfo routes_; |
112 }; | 113 }; |
113 | 114 |
114 } // namespace sessions | 115 } // namespace sessions |
115 } // namespace browser_sync | 116 } // namespace browser_sync |
116 | 117 |
117 #endif // CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ | 118 #endif // CHROME_BROWSER_SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ |
118 | 119 |
OLD | NEW |