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

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

Issue 2930013005: [Tab Metrics] Measure FP, FCP and FMP for Foreground Tab during Session Restore (Closed)
Patch Set: 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..2df23228baff83c999bd915307b69d6e86a868de 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 StartSessionRestore() { is_during_session_restore_ = true; }
fmeawad 2017/06/09 21:02:54 nit: SessionRestoreStarted since we are not actual
ducbui 2017/06/10 00:40:16 I change the name to MarkSessionRestoreStarted() t
+
+ void EndSessionRestore() { is_during_session_restore_ = false; }
fmeawad 2017/06/09 21:02:54 ditto
ducbui 2017/06/10 00:40:16 Done.
+
+ bool IsDuringSessionRestore() const { return is_during_session_restore_; }
+
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_;

Powered by Google App Engine
This is Rietveld 408576698