| 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_DRIVER_TAB_NODE_POOL_H_ | 5 #ifndef COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_TAB_NODE_POOL_H_ | 6 #define COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "components/sessions/core/session_id.h" | 13 #include "components/sessions/core/session_id.h" |
| 14 #include "sync/api/sync_change_processor.h" | 14 #include "sync/api/sync_change_processor.h" |
| 15 | 15 |
| 16 namespace syncer { | 16 namespace syncer { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 // restart. Nodes are only unassociated temporarily while the | 34 // restart. Nodes are only unassociated temporarily while the |
| 35 // model associator figures out which tabs belong to which | 35 // model associator figures out which tabs belong to which |
| 36 // nodes. Eventually any remaining unassociated nodes are | 36 // nodes. Eventually any remaining unassociated nodes are |
| 37 // freed. | 37 // freed. |
| 38 // 3. Free : Sync node is unused. | 38 // 3. Free : Sync node is unused. |
| 39 | 39 |
| 40 class TabNodePool { | 40 class TabNodePool { |
| 41 public: | 41 public: |
| 42 TabNodePool(); | 42 TabNodePool(); |
| 43 ~TabNodePool(); | 43 ~TabNodePool(); |
| 44 enum InvalidTab { | 44 enum InvalidTab { kInvalidTabID = -1 }; |
| 45 kInvalidTabID = -1 | |
| 46 }; | |
| 47 | 45 |
| 48 // If free nodes > kFreeNodesHighWatermark, delete all free nodes until | 46 // If free nodes > kFreeNodesHighWatermark, delete all free nodes until |
| 49 // free nodes <= kFreeNodesLowWatermark. | 47 // free nodes <= kFreeNodesLowWatermark. |
| 50 static const size_t kFreeNodesLowWatermark; | 48 static const size_t kFreeNodesLowWatermark; |
| 51 | 49 |
| 52 // Maximum limit of FreeNodes allowed on the client. | 50 // Maximum limit of FreeNodes allowed on the client. |
| 53 static const size_t kFreeNodesHighWatermark; | 51 static const size_t kFreeNodesHighWatermark; |
| 54 | 52 |
| 55 static const int kInvalidTabNodeID; | 53 static const int kInvalidTabNodeID; |
| 56 | 54 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 152 |
| 155 // The machine tag associated with this tab pool. Used in the title of new | 153 // The machine tag associated with this tab pool. Used in the title of new |
| 156 // sync nodes. | 154 // sync nodes. |
| 157 std::string machine_tag_; | 155 std::string machine_tag_; |
| 158 | 156 |
| 159 DISALLOW_COPY_AND_ASSIGN(TabNodePool); | 157 DISALLOW_COPY_AND_ASSIGN(TabNodePool); |
| 160 }; | 158 }; |
| 161 | 159 |
| 162 } // namespace browser_sync | 160 } // namespace browser_sync |
| 163 | 161 |
| 164 #endif // COMPONENTS_SYNC_DRIVER_TAB_NODE_POOL_H_ | 162 #endif // COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ |
| OLD | NEW |