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

Unified Diff: chrome/browser/sync/sessions2/sessions_sync_manager.h

Issue 81923003: sync: add garbage collection to SessionsSyncManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: chrome/browser/sync/sessions2/sessions_sync_manager.h
diff --git a/chrome/browser/sync/sessions2/sessions_sync_manager.h b/chrome/browser/sync/sessions2/sessions_sync_manager.h
index 5ed9c78fdc4b625ac2609ca62f6811fb1ec9a855..722710494effff91e8d81212338f4e4654cb5a0d 100644
--- a/chrome/browser/sync/sessions2/sessions_sync_manager.h
+++ b/chrome/browser/sync/sessions2/sessions_sync_manager.h
@@ -151,6 +151,12 @@ class SessionsSyncManager : public syncer::SyncableService,
FaviconCache* GetFaviconCache();
+ // Triggers garbage collection of stale sessions (as defined by
+ // |stale_session_threshold_days_|). This is called automatically every
+ // time we start up (via AssociateModels) and when new sessions data is
+ // downloaded (sync cycles complete).
+ void DoGarbageCollection();
+
private:
// Keep all the links to local tab data in one place. A tab_node_id and tab
// must be passed at creation. The tab_node_id is not mutable, although
@@ -335,6 +341,10 @@ class SessionsSyncManager : public syncer::SyncableService,
// client.
int local_session_header_node_id_;
+ // Number of days without activity after which we consider a session to be
+ // stale and a candidate for garbage collection.
+ size_t stale_session_threshold_days_;
+
scoped_ptr<LocalEventRouter> local_event_router_;
DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager);

Powered by Google App Engine
This is Rietveld 408576698