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

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

Issue 2930013005: [Tab Metrics] Measure FP, FCP and FMP for Foreground Tab during Session Restore (Closed)
Patch Set: Reset the initial-foreground-tab-changed flag for each session restore. 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.cc
diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc
index 122f6bd73eb70bc170bab67c512cbc4fa47f4678..c3f3e401874e16a89bd840d1f292f607201dc125 100644
--- a/chrome/browser/resource_coordinator/tab_manager.cc
+++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -162,6 +162,7 @@ TabManager::TabManager()
browser_tab_strip_tracker_(this, nullptr, nullptr),
test_tick_clock_(nullptr),
is_session_restore_loading_tabs_(false),
+ initial_session_restore_foreground_tab_changed_(false),
weak_ptr_factory_(this) {
#if defined(OS_CHROMEOS)
delegate_.reset(new TabManagerDelegate(weak_ptr_factory_.GetWeakPtr()));
@@ -507,6 +508,9 @@ int64_t TabManager::IdFromWebContents(WebContents* web_contents) {
void TabManager::OnSessionRestoreStartedLoadingTabs() {
DCHECK(!is_session_restore_loading_tabs_);
is_session_restore_loading_tabs_ = true;
+
+ // Needs to reset this flag for each session restore.
+ initial_session_restore_foreground_tab_changed_ = false;
}
void TabManager::OnSessionRestoreFinishedLoadingTabs() {
@@ -830,6 +834,10 @@ void TabManager::ActiveTabChanged(content::WebContents* old_contents,
GetWebContentsData(old_contents)
->set_time_to_purge(GetTimeToPurge(min_time_to_purge_));
}
+
+ if (old_contents && !initial_session_restore_foreground_tab_changed_) {
+ initial_session_restore_foreground_tab_changed_ = true;
+ }
}
void TabManager::TabInsertedAt(TabStripModel* tab_strip_model,

Powered by Google App Engine
This is Rietveld 408576698