diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-24 12:15:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 13:30:04 +0000 |
commit | b014812705fc80bff0a5c120dfcef88f349816dc (patch) | |
tree | 25a2e2d9fa285f1add86aa333389a839f81a39ae /chromium/components/sync_sessions/tab_node_pool.h | |
parent | 9f4560b1027ae06fdb497023cdcaf91b8511fa74 (diff) | |
download | qtwebengine-chromium-b014812705fc80bff0a5c120dfcef88f349816dc.tar.gz |
BASELINE: Update Chromium to 68.0.3440.125
Change-Id: I23f19369e01f688e496f5bf179abb521ad73874f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/sync_sessions/tab_node_pool.h')
-rw-r--r-- | chromium/components/sync_sessions/tab_node_pool.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/chromium/components/sync_sessions/tab_node_pool.h b/chromium/components/sync_sessions/tab_node_pool.h index 424e5a117ae..e36c84e8935 100644 --- a/chromium/components/sync_sessions/tab_node_pool.h +++ b/chromium/components/sync_sessions/tab_node_pool.h @@ -42,19 +42,19 @@ class TabNodePool { static const int kInvalidTabNodeID; - // Fills |tab_node_id| with a tab node associated with |tab_id|. - // If tab_id is already associated with a tab_node_id, reuses the existing - // association. Otherwise attempts to get the next free tab node and - // associate it with |tab_id|. If none are available, will create a new tab - // node. - // Returns true if a pre-existing tab node could be reused, false if a new one - // had to be created. - bool GetTabNodeForTab(SessionID tab_id, int* tab_node_id); + // Returns the tab node associated with |tab_id| or kInvalidTabNodeID if + // no association existed. + int GetTabNodeIdFromTabId(SessionID tab_id) const; // Returns the tab_id for |tab_node_id| if it is associated else returns an // invalid ID. SessionID GetTabIdFromTabNodeId(int tab_node_id) const; + // Gets the next free tab node (or creates a new one if needed) and associates + // it to |tab_id|. Returns the tab node ID associated to |tab_id|. |tab_id| + // must not be previously associated. + int AssociateWithFreeTabNode(SessionID tab_id); + // Reassociates |tab_node_id| with |tab_id|. If |tab_node_id| is not already // known, it is added to the tab node pool before being associated. void ReassociateTabNode(int tab_node_id, SessionID tab_id); @@ -68,6 +68,11 @@ class TabNodePool { // does not grow too large. void CleanupTabNodes(std::set<int>* deleted_node_ids); + // Deletes all known mappings for |tab_node_id|. As opposed to FreeTab(), it + // does NOT free the node for later reuse. This is used for foreign sessions + // when remote deletions are received. + void DeleteTabNode(int tab_node_id); + // Clear tab pool. void Clear(); @@ -81,6 +86,9 @@ class TabNodePool { // Return full status (no tab nodes are in use). bool Full(); + // Returns tab node IDs for all known (used or free) tab nodes. + std::set<int> GetAllTabNodeIds() const; + private: friend class SyncTabNodePoolTest; using TabNodeIDToTabIDMap = std::map<int, SessionID>; |