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

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

Issue 10937028: Do not discard selected tab (Closed) Base URL: http://git.chromium.org/chromium/src.git@new
Patch Set: handle active tab Created 8 years, 3 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/chromeos/oom_priority_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/oom_priority_manager.cc
diff --git a/chrome/browser/chromeos/oom_priority_manager.cc b/chrome/browser/chromeos/oom_priority_manager.cc
index b41a512bd984b0574c1d097c6e424c81c368ffc4..7ff877d33a0af362d57d7ea8e19352cfe3db01c4 100644
--- a/chrome/browser/chromeos/oom_priority_manager.cc
+++ b/chrome/browser/chromeos/oom_priority_manager.cc
@@ -230,8 +230,8 @@ bool OomPriorityManager::DiscardTabById(int64 target_web_contents_id) {
Browser* browser = *browser_iterator;
TabStripModel* model = browser->tab_strip_model();
for (int idx = 0; idx < model->count(); idx++) {
- // Can't discard tabs that are already discarded.
- if (model->IsTabDiscarded(idx))
+ // Can't discard tabs that are already discarded or active.
+ if (model->IsTabDiscarded(idx) || (model->active_index() == idx))
continue;
WebContents* web_contents = model->GetTabContentsAt(idx)->web_contents();
int64 web_contents_id = IdFromTabContents(web_contents);
« no previous file with comments | « no previous file | chrome/browser/chromeos/oom_priority_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698