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

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

Issue 1644773003: Remove BrowserIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host-desktop-1
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
Index: chrome/browser/memory/tab_manager.cc
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc
index ebcbe6400fda1cba478954593af32cfbf1ce6742..a26a9eea69aae1156e621775f46e6f9da4c7615c 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -36,7 +36,6 @@
#include "chrome/browser/memory/tab_manager_web_contents_data.h"
#include "chrome/browser/profiles/profile.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/host_desktop.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
@@ -91,8 +90,7 @@ int64_t IdFromWebContents(WebContents* web_contents) {
int FindTabStripModelById(int64_t target_web_contents_id,
TabStripModel** model) {
DCHECK(model);
- for (chrome::BrowserIterator it; !it.done(); it.Next()) {
- Browser* browser = *it;
+ for (auto* browser : *BrowserList::GetInstance()) {
TabStripModel* local_model = browser->tab_strip_model();
for (int idx = 0; idx < local_model->count(); idx++) {
WebContents* web_contents = local_model->GetWebContentsAt(idx);
@@ -393,8 +391,8 @@ void TabManager::PurgeBrowserMemory() {
int TabManager::GetTabCount() const {
int tab_count = 0;
- for (chrome::BrowserIterator it; !it.done(); it.Next())
- tab_count += it->tab_strip_model()->count();
+ for (auto* browser : *BrowserList::GetInstance())
+ tab_count += browser->tab_strip_model()->count();
return tab_count;
}
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager_browsertest.cc ('k') | chrome/browser/metrics/first_web_contents_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698