Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Side by Side Diff: components/sync_sessions/tab_node_pool.h

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)
Patch Set: use base:MakeUnique, alphabetize Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
(...skipping 14 matching lines...) Expand all
25 // tab_tag = StringPrintf("%s %d", local_session_tag, tab_node_id); 25 // tab_tag = StringPrintf("%s %d", local_session_tag, tab_node_id);
26 // 26 //
27 // A sync node can be in one of the two states: 27 // A sync node can be in one of the two states:
28 // 1. Associated : Sync node is used and associated with a tab. 28 // 1. Associated : Sync node is used and associated with a tab.
29 // 2. Free : Sync node is unused. 29 // 2. Free : Sync node is unused.
30 30
31 class TabNodePool { 31 class TabNodePool {
32 public: 32 public:
33 TabNodePool(); 33 TabNodePool();
34 ~TabNodePool(); 34 ~TabNodePool();
35 enum InvalidTab { kInvalidTabID = -1 };
36 35
37 // If free nodes > kFreeNodesHighWatermark, delete all free nodes until 36 // If free nodes > kFreeNodesHighWatermark, delete all free nodes until
38 // free nodes <= kFreeNodesLowWatermark. 37 // free nodes <= kFreeNodesLowWatermark.
39 static const size_t kFreeNodesLowWatermark; 38 static const size_t kFreeNodesLowWatermark;
40 39
41 // Maximum limit of FreeNodes allowed on the client. 40 // Maximum limit of FreeNodes allowed on the client.
42 static const size_t kFreeNodesHighWatermark; 41 static const size_t kFreeNodesHighWatermark;
43 42
44 static const int kInvalidTabNodeID; 43 static const int kInvalidTabNodeID;
45 44
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // The maximum used tab_node id for a sync node. A new sync node will always 110 // The maximum used tab_node id for a sync node. A new sync node will always
112 // be created with max_used_tab_node_id_ + 1. 111 // be created with max_used_tab_node_id_ + 1.
113 int max_used_tab_node_id_; 112 int max_used_tab_node_id_;
114 113
115 DISALLOW_COPY_AND_ASSIGN(TabNodePool); 114 DISALLOW_COPY_AND_ASSIGN(TabNodePool);
116 }; 115 };
117 116
118 } // namespace sync_sessions 117 } // namespace sync_sessions
119 118
120 #endif // COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_ 119 #endif // COMPONENTS_SYNC_SESSIONS_TAB_NODE_POOL_H_
OLDNEW
« no previous file with comments | « components/sync_sessions/synced_tab_delegate.h ('k') | components/sync_sessions/tab_node_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698