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

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

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: Created 4 years, 11 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/lifetime/browser_close_manager.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/tab_manager.cc
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc
index 7124a5c13dc1a74f8caeb87d4c915b63d2f4f2fd..02f5ccf327b90ccec8364e5dc2f7f4fbf039b71e 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -205,19 +205,8 @@ TabStatsList TabManager::GetTabStats() {
TabStatsList stats_list;
stats_list.reserve(32); // 99% of users have < 30 tabs open
- // Go through each window to get all the tabs. Depending on the platform,
- // windows are either native or ash or both. The goal is to make sure to go
- // through them all, starting with the active window first (use
- // chrome::GetActiveDesktop to get the current used type).
- AddTabStats(BrowserList::GetInstance(chrome::GetActiveDesktop()), true,
- &stats_list);
- if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_NATIVE) {
- AddTabStats(BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE),
- false, &stats_list);
- } else if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) {
- AddTabStats(BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH), false,
- &stats_list);
- }
+ // Go through each window to get all the tabs.
+ AddTabStats(BrowserList::GetInstance(), true, &stats_list);
sky 2016/01/27 02:41:44 Can you remove BrowserList as an arg to AddTabStat
scottmg 2016/01/27 18:10:32 Done.
// Sort the collected data so that least desirable to be killed is first, most
// desirable is last.
@@ -460,8 +449,7 @@ void TabManager::UpdateTimerCallback() {
if (g_browser_process->IsShuttingDown())
return;
- if (BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH)->empty() &&
- BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty())
+ if (BrowserList::GetInstance()->empty())
return;
// Check for a discontinuity in time caused by the machine being suspended.
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698