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

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

Issue 2935183002: [TabMetrics] Add signals that mark the start and end of session restore. (Closed)
Patch Set: Use OnSessionRestore[Started,Ended]() directly in TabLoader. 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 9ce446cfd721ac2a23a6c8128224e1b70016d080..c3080fa1a1e5f93df1161cefc752203fb4e75052 100644
--- a/chrome/browser/resource_coordinator/tab_manager.cc
+++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -136,6 +136,7 @@ TabManager::TabManager()
#endif
browser_tab_strip_tracker_(this, nullptr, nullptr),
test_tick_clock_(nullptr),
+ in_session_restore_(false),
weak_ptr_factory_(this) {
#if defined(OS_CHROMEOS)
delegate_.reset(new TabManagerDelegate(weak_ptr_factory_.GetWeakPtr()));
@@ -475,6 +476,16 @@ int64_t TabManager::IdFromWebContents(WebContents* web_contents) {
return reinterpret_cast<int64_t>(web_contents);
}
+void TabManager::OnSessionRestoreStarted() {
+ DCHECK(!in_session_restore_);
+ in_session_restore_ = true;
+}
+
+void TabManager::OnSessionRestoreEnded() {
+ DCHECK(in_session_restore_);
+ in_session_restore_ = false;
+}
+
///////////////////////////////////////////////////////////////////////////////
// TabManager, private:

Powered by Google App Engine
This is Rietveld 408576698