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

Unified Diff: components/sync_sessions/synced_session.h

Issue 1877083002: [Sync] Moved tab_node_id tracking to session object and improved foreign session garbage collection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing comment for zea. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/sync_sessions/synced_session.h
diff --git a/components/sync_sessions/synced_session.h b/components/sync_sessions/synced_session.h
index 5e9d7ba48fc902a6b19aed4cdb01e9edd7c99dd4..d9696dcb9e5588e44974b5c9ec045e1fa6e1d509 100644
--- a/components/sync_sessions/synced_session.h
+++ b/components/sync_sessions/synced_session.h
@@ -6,6 +6,7 @@
#define COMPONENTS_SYNC_SESSIONS_SYNCED_SESSION_H_
#include <map>
+#include <set>
#include <string>
#include "base/macros.h"
@@ -51,13 +52,25 @@ struct SyncedSession {
// Type of device this session is from.
DeviceType device_type;
- // Last time this session was modified remotely.
+ // Last time this session was modified remotely. This is the max of the header
+ // and all children tab mtimes.
base::Time modified_time;
// Map of windows that make up this session. Windowws are owned by the session
// itself and free'd on destruction.
SyncedWindowMap windows;
+ // A tab node id is part of the identifier for the sync tab objects. Tab node
+ // ids are not used for interacting with the model/browser tabs. However, when
+ // when we want to delete a foreign session, we use these values to inform
+ // sync which tabs to delete. We are extracting these tab node ids from
+ // individual session (tab, not header) specifics, but store them here in the
+ // SyncedSession during runtime. We do this because tab node ids may be reused
+ // for different tabs, and tracking which tab id is currently associated with
+ // each tab node id is both difficult and unnecessary. See comments at
+ // SyncedSessionTracker::GetTabImpl for a concrete example of id reuse.
+ std::set<int> tab_node_ids;
+
// Converts the DeviceType enum value to a string. This is used
// in the NTP handler for foreign sessions for matching session
// types to an icon style.
« no previous file with comments | « components/sync_sessions/sessions_sync_manager.cc ('k') | components/sync_sessions/synced_session_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698