Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ | 5 #ifndef COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ |
| 6 #define COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ | 6 #define COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 bool GetTabNodeFromLocalTabId(SessionID::id_type tab_id, int* tab_node_id); | 167 bool GetTabNodeFromLocalTabId(SessionID::id_type tab_id, int* tab_node_id); |
| 168 | 168 |
| 169 // Returns whether |tab_node_id| refers to a valid tab node that is associated | 169 // Returns whether |tab_node_id| refers to a valid tab node that is associated |
| 170 // with a tab. | 170 // with a tab. |
| 171 bool IsLocalTabNodeAssociated(int tab_node_id); | 171 bool IsLocalTabNodeAssociated(int tab_node_id); |
| 172 | 172 |
| 173 // Reassociates the tab denoted by |tab_node_id| with a new tab id, preserving | 173 // Reassociates the tab denoted by |tab_node_id| with a new tab id, preserving |
| 174 // any previous SessionTab object the node was associated with. This is useful | 174 // any previous SessionTab object the node was associated with. This is useful |
| 175 // on restart when sync needs to reassociate tabs from a previous session with | 175 // on restart when sync needs to reassociate tabs from a previous session with |
| 176 // newly restored tabs (and can be used in conjunction with PutTabInWindow). | 176 // newly restored tabs (and can be used in conjunction with PutTabInWindow). |
| 177 // If |new_tab_id| is already associated with a tab object, that tab will be | |
| 178 // overwritten. | |
|
skym
2017/05/04 20:07:20
Did you mean to newline so early here?
Nicolas Zea
2017/05/04 23:36:15
Done.
| |
| 179 // Reassociating a tab with a node it is already mapped to will have no | |
| 180 // effect. | |
| 177 void ReassociateLocalTab(int tab_node_id, SessionID::id_type new_tab_id); | 181 void ReassociateLocalTab(int tab_node_id, SessionID::id_type new_tab_id); |
| 178 | 182 |
| 179 // **** Methods for querying/manipulating overall state ****. | 183 // **** Methods for querying/manipulating overall state ****. |
| 180 | 184 |
| 181 // Free the memory for all dynamically allocated objects and clear the | 185 // Free the memory for all dynamically allocated objects and clear the |
| 182 // tracking structures. | 186 // tracking structures. |
| 183 void Clear(); | 187 void Clear(); |
| 184 | 188 |
| 185 bool Empty() const { | 189 bool Empty() const { |
| 186 return synced_tab_map_.empty() && synced_session_map_.empty(); | 190 return synced_tab_map_.empty() && synced_session_map_.empty(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 | 252 |
| 249 // Pool of used/available sync nodes associated with local tabs. | 253 // Pool of used/available sync nodes associated with local tabs. |
| 250 TabNodePool local_tab_pool_; | 254 TabNodePool local_tab_pool_; |
| 251 | 255 |
| 252 DISALLOW_COPY_AND_ASSIGN(SyncedSessionTracker); | 256 DISALLOW_COPY_AND_ASSIGN(SyncedSessionTracker); |
| 253 }; | 257 }; |
| 254 | 258 |
| 255 } // namespace sync_sessions | 259 } // namespace sync_sessions |
| 256 | 260 |
| 257 #endif // COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ | 261 #endif // COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ |
| OLD | NEW |