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

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

Issue 2962773002: [Tab Metrics] Added TabManager.SessionRestore.SwitchToTab UMA. (Closed)
Patch Set: Remove gratuitous TODOs 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..f5a66ba96ca7c0dd4a5dd21515f3a0d3a97b8b2d 100644
--- a/chrome/browser/resource_coordinator/tab_manager.cc
+++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -829,6 +829,9 @@ void TabManager::ActiveTabChanged(content::WebContents* old_contents,
// Re-setting time-to-purge every time a tab becomes inactive.
GetWebContentsData(old_contents)
->set_time_to_purge(GetTimeToPurge(min_time_to_purge_));
+ // If |old_contents| isn't set, we didn't switch from anything, so don't
+ // record it.
zhenw 2017/06/29 15:44:00 nit: The comment here is describing the case where
shaseley 2017/06/29 16:20:50 Done, I changed the comment.
+ RecordSwitchToTab(new_contents);
}
}
@@ -943,4 +946,12 @@ std::vector<TabManager::BrowserInfo> TabManager::GetBrowserInfoList() const {
return browser_info_list;
}
+void TabManager::RecordSwitchToTab(content::WebContents* contents) const {
+ if (is_session_restore_loading_tabs_) {
+ UMA_HISTOGRAM_ENUMERATION("TabManager.SessionRestore.SwitchToTab",
+ GetWebContentsData(contents)->tab_loading_state(),
+ TAB_LOADING_STATE_MAX);
+ }
+}
+
} // namespace resource_coordinator
« no previous file with comments | « chrome/browser/resource_coordinator/tab_manager.h ('k') | chrome/browser/resource_coordinator/tab_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698