| 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> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "components/sessions/core/session_id.h" | 15 #include "components/sessions/core/session_id.h" |
| 16 #include "components/sync/api/sync_change_processor.h" | 16 #include "components/sync/api/sync_change_processor.h" |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 class SyncChangeProcessor; | 19 class SyncChangeProcessor; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace browser_sync { | 22 namespace sync_sessions { |
| 23 | 23 |
| 24 // A pool for managing free/used tab sync nodes for the *local* session. | 24 // A pool for managing free/used tab sync nodes for the *local* session. |
| 25 // Performs lazy creation of sync nodes when necessary. | 25 // Performs lazy creation of sync nodes when necessary. |
| 26 // Note: We make use of the following "id's" | 26 // Note: We make use of the following "id's" |
| 27 // - a tab_id: created by session service, unique to this client | 27 // - a tab_id: created by session service, unique to this client |
| 28 // - a tab_node_id: the id for a particular sync tab node. This is used | 28 // - a tab_node_id: the id for a particular sync tab node. This is used |
| 29 // to generate the sync tab node tag through: | 29 // to generate the sync tab node tag through: |
| 30 // tab_tag = StringPrintf("%s_%ui", local_session_tag, tab_node_id); | 30 // tab_tag = StringPrintf("%s_%ui", local_session_tag, tab_node_id); |
| 31 // | 31 // |
| 32 // A sync node can be in one of the three states: | 32 // A sync node can be in one of the three states: |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // be created with max_used_tab_node_id_ + 1. | 152 // be created with max_used_tab_node_id_ + 1. |
| 153 int max_used_tab_node_id_; | 153 int max_used_tab_node_id_; |
| 154 | 154 |
| 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 browser_sync | 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 |