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

Unified Diff: chrome/browser/resource_coordinator/tab_manager.h

Issue 2935183002: [TabMetrics] Add signals that mark the start and end of session restore. (Closed)
Patch Set: Change if-check to DCHECK for tab_manager. Created 3 years, 6 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: chrome/browser/resource_coordinator/tab_manager.h
diff --git a/chrome/browser/resource_coordinator/tab_manager.h b/chrome/browser/resource_coordinator/tab_manager.h
index 4b9af621ffb4071e7c608effc8fd2ede6f6b1ec0..2217d38afcb5a5332b58e9ff2ff062d543c49785 100644
--- a/chrome/browser/resource_coordinator/tab_manager.h
+++ b/chrome/browser/resource_coordinator/tab_manager.h
@@ -154,6 +154,12 @@ class TabManager : public TabStripModelObserver {
// the WebContents could be deleted if the user closed the tab.
static int64_t IdFromWebContents(content::WebContents* web_contents);
+ void MarkSessionRestoreStarted() { is_during_session_restore_ = true; }
lpy 2017/06/14 17:23:19 The name is a little bit too verbose, maybe Sessio
ducbui 2017/06/14 17:37:57 I still prefer "MarkSessionRestoreStarted" because
+
+ void MarkSessionRestoreEnded() { is_during_session_restore_ = false; }
+
+ bool IsDuringSessionRestore() const { return is_during_session_restore_; }
lpy 2017/06/14 17:23:19 IsInSessionRestore?
ducbui 2017/06/14 17:37:58 Yes, this name seems better :)
+
private:
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, PurgeBackgroundRenderer);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ActivateTabResetPurgeState);
@@ -366,6 +372,8 @@ class TabManager : public TabStripModelObserver {
// List of observers that will receive notifications on state changes.
base::ObserverList<TabManagerObserver> observers_;
+ bool is_during_session_restore_;
+
// Weak pointer factory used for posting delayed tasks.
base::WeakPtrFactory<TabManager> weak_ptr_factory_;
« no previous file with comments | « no previous file | chrome/browser/resource_coordinator/tab_manager.cc » ('j') | chrome/browser/sessions/tab_loader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698