| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 SyncSessionsClient* const sessions_client_; | 212 SyncSessionsClient* const sessions_client_; |
| 213 | 213 |
| 214 // The mapping of tab/window to their SessionTab/SessionWindow objects. | 214 // The mapping of tab/window to their SessionTab/SessionWindow objects. |
| 215 // The SessionTab/SessionWindow objects referred to may be owned either by the | 215 // The SessionTab/SessionWindow objects referred to may be owned either by the |
| 216 // session in the |synced_session_map_| or be temporarily unmapped and live in | 216 // session in the |synced_session_map_| or be temporarily unmapped and live in |
| 217 // the |unmapped_tabs_|/|unmapped_windows_| collections. | 217 // the |unmapped_tabs_|/|unmapped_windows_| collections. |
| 218 // | 218 // |
| 219 // Map: session tag -> (tab/window -> SessionTab*/SessionWindow*) | 219 // Map: session tag -> (tab/window -> SessionTab*/SessionWindow*) |
| 220 std::map<std::string, std::map<SessionID::id_type, sessions::SessionTab*>> | 220 std::map<std::string, std::map<SessionID::id_type, sessions::SessionTab*>> |
| 221 synced_tab_map_; | 221 synced_tab_map_; |
| 222 std::map<std::string, std::map<SessionID::id_type, sessions::SessionWindow*>> | 222 std::map<std::string, std::map<SessionID::id_type, SyncedSessionWindow*>> |
| 223 synced_window_map_; | 223 synced_window_map_; |
| 224 | 224 |
| 225 // The collection that owns the SyncedSessions, and transitively, all of the | 225 // The collection that owns the SyncedSessions, and transitively, all of the |
| 226 // windows and tabs they contain. | 226 // windows and tabs they contain. |
| 227 // | 227 // |
| 228 // Map: session tag -> owned SyncedSession | 228 // Map: session tag -> owned SyncedSession |
| 229 std::map<std::string, std::unique_ptr<SyncedSession>> synced_session_map_; | 229 std::map<std::string, std::unique_ptr<SyncedSession>> synced_session_map_; |
| 230 | 230 |
| 231 // The collection of tabs/windows not owned by a SyncedSession. This is the | 231 // The collection of tabs/windows not owned by a SyncedSession. This is the |
| 232 // case either because 1. (in the case of tabs) they were newly created by | 232 // case either because 1. (in the case of tabs) they were newly created by |
| 233 // GetTab() and not yet added to a session, or 2. they were removed from their | 233 // GetTab() and not yet added to a session, or 2. they were removed from their |
| 234 // owning session by a call to ResetSessionTracking() and not yet added back. | 234 // owning session by a call to ResetSessionTracking() and not yet added back. |
| 235 // | 235 // |
| 236 // Map: session tag -> (tab/window id -> owned SessionTab/SessionWindow) | 236 // Map: session tag -> (tab/window id -> owned SessionTab/SessionWindow) |
| 237 std::map<std::string, | 237 std::map<std::string, |
| 238 std::map<SessionID::id_type, std::unique_ptr<sessions::SessionTab>>> | 238 std::map<SessionID::id_type, std::unique_ptr<sessions::SessionTab>>> |
| 239 unmapped_tabs_; | 239 unmapped_tabs_; |
| 240 std::map< | 240 std::map<std::string, |
| 241 std::string, | 241 std::map<SessionID::id_type, std::unique_ptr<SyncedSessionWindow>>> |
| 242 std::map<SessionID::id_type, std::unique_ptr<sessions::SessionWindow>>> | |
| 243 unmapped_windows_; | 242 unmapped_windows_; |
| 244 | 243 |
| 245 // The tag for this machine's local session, so we can distinguish the foreign | 244 // The tag for this machine's local session, so we can distinguish the foreign |
| 246 // sessions. | 245 // sessions. |
| 247 std::string local_session_tag_; | 246 std::string local_session_tag_; |
| 248 | 247 |
| 249 // Pool of used/available sync nodes associated with local tabs. | 248 // Pool of used/available sync nodes associated with local tabs. |
| 250 TabNodePool local_tab_pool_; | 249 TabNodePool local_tab_pool_; |
| 251 | 250 |
| 252 DISALLOW_COPY_AND_ASSIGN(SyncedSessionTracker); | 251 DISALLOW_COPY_AND_ASSIGN(SyncedSessionTracker); |
| 253 }; | 252 }; |
| 254 | 253 |
| 255 } // namespace sync_sessions | 254 } // namespace sync_sessions |
| 256 | 255 |
| 257 #endif // COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ | 256 #endif // COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_TRACKER_H_ |
| OLD | NEW |