| 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 #include "components/sync_sessions/tab_node_pool.h" | 5 #include "components/sync_sessions/tab_node_pool.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "components/sync/api/sync_change.h" | 10 #include "components/sync/api/sync_change.h" |
| 11 #include "components/sync/api/sync_data.h" | 11 #include "components/sync/api/sync_data.h" |
| 12 #include "components/sync/base/model_type.h" | 12 #include "components/sync/base/model_type.h" |
| 13 #include "components/sync/protocol/session_specifics.pb.h" | 13 #include "components/sync/protocol/session_specifics.pb.h" |
| 14 #include "components/sync/protocol/sync.pb.h" | 14 #include "components/sync/protocol/sync.pb.h" |
| 15 | 15 |
| 16 namespace browser_sync { | 16 namespace sync_sessions { |
| 17 | 17 |
| 18 const size_t TabNodePool::kFreeNodesLowWatermark = 25; | 18 const size_t TabNodePool::kFreeNodesLowWatermark = 25; |
| 19 const size_t TabNodePool::kFreeNodesHighWatermark = 100; | 19 const size_t TabNodePool::kFreeNodesHighWatermark = 100; |
| 20 | 20 |
| 21 TabNodePool::TabNodePool() : max_used_tab_node_id_(kInvalidTabNodeID) {} | 21 TabNodePool::TabNodePool() : max_used_tab_node_id_(kInvalidTabNodeID) {} |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 // We start vending tab node IDs at 0. | 24 // We start vending tab node IDs at 0. |
| 25 const int TabNodePool::kInvalidTabNodeID = -1; | 25 const int TabNodePool::kInvalidTabNodeID = -1; |
| 26 | 26 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool TabNodePool::Full() { | 174 bool TabNodePool::Full() { |
| 175 return nodeid_tabid_map_.empty(); | 175 return nodeid_tabid_map_.empty(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void TabNodePool::SetMachineTag(const std::string& machine_tag) { | 178 void TabNodePool::SetMachineTag(const std::string& machine_tag) { |
| 179 machine_tag_ = machine_tag; | 179 machine_tag_ = machine_tag; |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace browser_sync | 182 } // namespace sync_sessions |
| OLD | NEW |