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

Unified Diff: chrome/browser/sessions/tab_loader.cc

Issue 2935183002: [TabMetrics] Add signals that mark the start and end of session restore. (Closed)
Patch Set: DCHECK() directly on GetTabManager() and eliminate a variable 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
« no previous file with comments | « chrome/browser/sessions/tab_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/tab_loader.cc
diff --git a/chrome/browser/sessions/tab_loader.cc b/chrome/browser/sessions/tab_loader.cc
index 753f4e0493c23ad66dc15e7f1f37a6574ce3f7e1..7e48d5b3ff7306c92f34bbc9bc7580e6f5a4aac0 100644
--- a/chrome/browser/sessions/tab_loader.cc
+++ b/chrome/browser/sessions/tab_loader.cc
@@ -13,6 +13,8 @@
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/resource_coordinator/tab_manager.h"
#include "chrome/browser/sessions/session_restore_stats_collector.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -103,6 +105,7 @@ TabLoader::TabLoader(base::TimeTicks restore_started)
shared_tab_loader_ = this;
this_retainer_ = this;
base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
+ OnSessionRestoreStarted();
fmeawad 2017/06/15 17:55:19 lpy and I thinks that these calls should be inline
}
TabLoader::~TabLoader() {
@@ -110,6 +113,7 @@ TabLoader::~TabLoader() {
DCHECK(shared_tab_loader_ == this);
shared_tab_loader_ = nullptr;
base::MemoryCoordinatorClientRegistry::GetInstance()->Unregister(this);
+ OnSessionRestoreEnded();
}
void TabLoader::StartLoading(const std::vector<RestoredTab>& tabs) {
@@ -313,5 +317,17 @@ void TabLoader::StopLoadingTabs() {
LoadNextTab();
}
+// static
+void TabLoader::OnSessionRestoreStarted() {
+ DCHECK(g_browser_process->GetTabManager());
+ g_browser_process->GetTabManager()->OnSessionRestoreStarted();
+}
+
+// static
+void TabLoader::OnSessionRestoreEnded() {
+ DCHECK(g_browser_process->GetTabManager());
+ g_browser_process->GetTabManager()->OnSessionRestoreEnded();
+}
+
// static
TabLoader* TabLoader::shared_tab_loader_ = nullptr;
« no previous file with comments | « chrome/browser/sessions/tab_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698