Chromium Code Reviews| 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..ba7be8e6d656bf3b77de8719ba0cc1268d78e4ba 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); |
| + MarkSessionRestoreStarted(); |
| } |
| TabLoader::~TabLoader() { |
| @@ -110,6 +113,7 @@ TabLoader::~TabLoader() { |
| DCHECK(shared_tab_loader_ == this); |
| shared_tab_loader_ = nullptr; |
| base::MemoryCoordinatorClientRegistry::GetInstance()->Unregister(this); |
| + MarkSessionRestoreEnded(); |
| } |
| void TabLoader::StartLoading(const std::vector<RestoredTab>& tabs) { |
| @@ -313,5 +317,21 @@ void TabLoader::StopLoadingTabs() { |
| LoadNextTab(); |
| } |
| +// static |
| +void TabLoader::MarkSessionRestoreStarted() { |
| + resource_coordinator::TabManager* tab_manager = |
| + g_browser_process->GetTabManager(); |
| + if (tab_manager) |
|
fmeawad
2017/06/14 15:34:58
Can this be a DCHECK instead?
Similar to here mayb
fmeawad
2017/06/14 16:20:56
This is why we put the DCHECK, if the check is alw
ducbui
2017/06/14 16:24:18
Is the usage of TabLoader limited to only tab-mana
ducbui
2017/06/14 16:47:39
The TabLoader is not compiled on Android and on Ch
|
| + tab_manager->MarkSessionRestoreStarted(); |
| +} |
| + |
| +// static |
| +void TabLoader::MarkSessionRestoreEnded() { |
| + resource_coordinator::TabManager* tab_manager = |
| + g_browser_process->GetTabManager(); |
| + if (tab_manager) |
| + tab_manager->MarkSessionRestoreEnded(); |
| +} |
| + |
| // static |
| TabLoader* TabLoader::shared_tab_loader_ = nullptr; |