OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SESSIONS_TAB_NODE_POOL_H_ | 5 #ifndef COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ |
6 #define COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ | 6 #define COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Return empty status (all tab nodes are in use). | 118 // Return empty status (all tab nodes are in use). |
119 bool Empty() const; | 119 bool Empty() const; |
120 | 120 |
121 // Return full status (no tab nodes are in use). | 121 // Return full status (no tab nodes are in use). |
122 bool Full(); | 122 bool Full(); |
123 | 123 |
124 void SetMachineTag(const std::string& machine_tag); | 124 void SetMachineTag(const std::string& machine_tag); |
125 | 125 |
126 private: | 126 private: |
127 friend class SyncTabNodePoolTest; | 127 friend class SyncTabNodePoolTest; |
128 typedef std::map<int, SessionID::id_type> TabNodeIDToTabIDMap; | 128 using TabNodeIDToTabIDMap = std::map<int, SessionID::id_type>; |
129 | 129 |
130 // Adds |tab_node_id| to free node pool. | 130 // Adds |tab_node_id| to free node pool. |
131 // |change_output| *must* be provided. It is the TabNodePool's link to | 131 // |change_output| *must* be provided. It is the TabNodePool's link to |
132 // the SyncChange pipeline that exists in the caller's context. | 132 // the SyncChange pipeline that exists in the caller's context. |
133 // See FreeTabNode for more detail. | 133 // See FreeTabNode for more detail. |
134 void FreeTabNodeInternal(int tab_node_id, | 134 void FreeTabNodeInternal(int tab_node_id, |
135 syncer::SyncChangeList* change_output); | 135 syncer::SyncChangeList* change_output); |
136 | 136 |
137 // Stores mapping of node ids associated with tab_ids, these are the used | 137 // Stores mapping of node ids associated with tab_ids, these are the used |
138 // nodes of tab node pool. | 138 // nodes of tab node pool. |
(...skipping 16 matching lines...) Expand all Loading... |
155 // The machine tag associated with this tab pool. Used in the title of new | 155 // The machine tag associated with this tab pool. Used in the title of new |
156 // sync nodes. | 156 // sync nodes. |
157 std::string machine_tag_; | 157 std::string machine_tag_; |
158 | 158 |
159 DISALLOW_COPY_AND_ASSIGN(TabNodePool); | 159 DISALLOW_COPY_AND_ASSIGN(TabNodePool); |
160 }; | 160 }; |
161 | 161 |
162 } // namespace sync_sessions | 162 } // namespace sync_sessions |
163 | 163 |
164 #endif // COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ | 164 #endif // COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ |
OLD | NEW |