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

Unified Diff: chrome/browser/chromeos/memory/oom_priority_manager.cc

Issue 12211139: Phase out BrowserList::empty() and BrowserList::size(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 7 years, 10 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 | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/memory/oom_priority_manager.cc
diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.cc b/chrome/browser/chromeos/memory/oom_priority_manager.cc
index a0ca959c82b19c86bf7b5bdc0646d82404a22f72..322529924859f66b1d7a0b13c56d48d893d4e65a 100644
--- a/chrome/browser/chromeos/memory/oom_priority_manager.cc
+++ b/chrome/browser/chromeos/memory/oom_priority_manager.cc
@@ -28,7 +28,8 @@
#include "chrome/browser/memory_details.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_iterator.h"
-#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_list_impl.h"
+#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_constants.h"
@@ -528,8 +529,10 @@ void OomPriorityManager::Observe(int type,
// 2) last time a tab was selected
// 3) is the tab currently selected
void OomPriorityManager::AdjustOomPriorities() {
- if (BrowserList::size() == 0)
+ if (chrome::BrowserListImpl::GetInstance(
+ chrome::HOST_DESKTOP_TYPE_ASH)->empty()) {
return;
+ }
// Check for a discontinuity in time caused by the machine being suspended.
if (!last_adjust_time_.is_null()) {
@@ -556,9 +559,11 @@ OomPriorityManager::TabStatsList OomPriorityManager::GetTabStatsOnUIThread() {
TabStatsList stats_list;
stats_list.reserve(32); // 99% of users have < 30 tabs open
bool browser_active = true;
- for (BrowserList::const_reverse_iterator browser_iterator =
- BrowserList::begin_last_active();
- browser_iterator != BrowserList::end_last_active();
+ const chrome::BrowserListImpl* ash_browser_list =
+ chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
+ for (chrome::BrowserListImpl::const_reverse_iterator browser_iterator =
+ ash_browser_list->begin_last_active();
+ browser_iterator != ash_browser_list->end_last_active();
++browser_iterator) {
Browser* browser = *browser_iterator;
bool is_browser_for_app = browser->is_app();
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698