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

Unified Diff: chrome/browser/ui/task_manager/task_manager_table_model.cc

Issue 2202563003: Fix bug avi found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tm_stl_util
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/task_manager/task_manager_table_model.cc
diff --git a/chrome/browser/ui/task_manager/task_manager_table_model.cc b/chrome/browser/ui/task_manager/task_manager_table_model.cc
index 76108a6c87a9428c5e79df3f0f4887d327263834..d7bbcd82dd3582092e32e7e0dd34026d871e3e3f 100644
--- a/chrome/browser/ui/task_manager/task_manager_table_model.cc
+++ b/chrome/browser/ui/task_manager/task_manager_table_model.cc
@@ -562,17 +562,20 @@ int TaskManagerTableModel::CompareValues(int row1,
void TaskManagerTableModel::GetRowsGroupRange(int row_index,
int* out_start,
int* out_length) {
+ base::ProcessId process_id =
afakhry 2016/08/01 20:53:53 const
+ observed_task_manager()->GetProcessId(tasks_[row_index]);
int i = row_index;
- for ( ; i >= 0; --i) {
- if (IsTaskFirstInGroup(i))
- break;
+ int limit = row_index + 1;
+ while (i > 0 &&
+ observed_task_manager()->GetProcessId(tasks_[i - 1]) == process_id) {
+ i--;
afakhry 2016/08/01 20:53:53 ++i?
Avi (use Gerrit) 2016/08/01 20:57:39 --i?
afakhry 2016/08/01 21:02:59 Oops, yes, sorry! :)
+ }
+ while (limit < RowCount() &&
+ observed_task_manager()->GetProcessId(tasks_[limit]) == process_id) {
+ limit++;
afakhry 2016/08/01 20:53:53 ++limit?
}
-
- CHECK_GE(i, 0);
-
*out_start = i;
- *out_length = observed_task_manager()->GetNumberOfTasksOnSameProcess(
- tasks_[row_index]);
+ *out_length = limit - i;
afakhry 2016/08/01 20:53:53 You can ignore the following: :D Hmmm, that's a v
Avi (use Gerrit) 2016/08/01 20:57:39 Yes, I actually thought of Sean's talk. I searched
afakhry 2016/08/01 21:02:59 It's certainly not worth the hassle, that's why I
}
void TaskManagerTableModel::OnTaskAdded(TaskId id) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698