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

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

Issue 2930013005: [Tab Metrics] Measure FP, FCP and FMP for Foreground Tab during Session Restore (Closed)
Patch Set: Prune cases where a tab is loaded only after user switches to it. 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/sessions/tab_loader.cc
diff --git a/chrome/browser/sessions/tab_loader.cc b/chrome/browser/sessions/tab_loader.cc
index 753f4e0493c23ad66dc15e7f1f37a6574ce3f7e1..7fcb263b7782c14525a35daff50bb49e56a964f4 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,11 @@ TabLoader::TabLoader(base::TimeTicks restore_started)
shared_tab_loader_ = this;
this_retainer_ = this;
base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
+
+ resource_coordinator::TabManager* tab_manager =
+ g_browser_process->GetTabManager();
+ if (tab_manager)
+ tab_manager->MarkSessionRestoreStarted();
chrisha 2017/06/15 19:44:56 This will fail if their are multiple session resto
}
TabLoader::~TabLoader() {
@@ -110,6 +117,11 @@ TabLoader::~TabLoader() {
DCHECK(shared_tab_loader_ == this);
shared_tab_loader_ = nullptr;
base::MemoryCoordinatorClientRegistry::GetInstance()->Unregister(this);
+
+ resource_coordinator::TabManager* tab_manager =
+ g_browser_process->GetTabManager();
+ if (tab_manager)
+ tab_manager->MarkSessionRestoreEnded();
}
void TabLoader::StartLoading(const std::vector<RestoredTab>& tabs) {

Powered by Google App Engine
This is Rietveld 408576698