Chromium Code Reviews| Index: chrome/browser/ui/webui/task_manager_handler.cc |
| diff --git a/chrome/browser/ui/webui/task_manager_handler.cc b/chrome/browser/ui/webui/task_manager_handler.cc |
| index 0423ea05a142fea84877c7b6bc77ec9f51e10bea..685de82cbf8ef9d63a9860a1ae8ae833acf7a1e0 100644 |
| --- a/chrome/browser/ui/webui/task_manager_handler.cc |
| +++ b/chrome/browser/ui/webui/task_manager_handler.cc |
| @@ -307,8 +307,8 @@ void TaskManagerHandler::Init() { |
| } |
| void TaskManagerHandler::RegisterMessages() { |
| - web_ui_->RegisterMessageCallback("killProcess", |
| - base::Bind(&TaskManagerHandler::HandleKillProcess, |
| + web_ui_->RegisterMessageCallback("killProcesses", |
| + base::Bind(&TaskManagerHandler::HandleKillProcesses, |
| base::Unretained(this))); |
| web_ui_->RegisterMessageCallback("inspect", |
| base::Bind(&TaskManagerHandler::HandleInspect, |
| @@ -341,19 +341,23 @@ static int parseIndex(const Value* value) { |
| return index; |
| } |
| -void TaskManagerHandler::HandleKillProcess(const ListValue* indexes) { |
| - for (ListValue::const_iterator i = indexes->begin(); |
| - i != indexes->end(); i++) { |
| - int index = parseIndex(*i); |
| - if (index == -1) |
| - continue; |
| +void TaskManagerHandler::HandleKillProcesses(const ListValue* indexes) { |
| + for (int resource_index = 0; resource_index < model_->ResourceCount(); |
|
James Hawkins
2011/12/13 17:44:22
Is there not a better way to do this? It seems li
yoshiki
2011/12/14 09:06:47
I changed to use unique_id to determine the proces
|
| + ++resource_index) { |
| + int resource_pid = model_->GetProcessId(resource_index); |
| - int resource_index = model_->GetResourceIndexForGroup(index, 0); |
| - if (resource_index == -1) |
| - continue; |
| + for (ListValue::const_iterator i = indexes->begin(); i != indexes->end(); |
| + ++i) { |
| + int pid = parseIndex(*i); |
| + if (pid == -1) |
| + continue; |
| - LOG(INFO) << "kill PID:" << model_->GetResourceProcessId(resource_index); |
| - task_manager_->KillProcess(resource_index); |
| + if (resource_pid == pid) { |
| + LOG(INFO) << "kill PID:" << pid; |
|
James Hawkins
2011/12/13 17:44:22
Remove log spam.
yoshiki
2011/12/14 09:06:47
Done.
|
| + task_manager_->KillProcess(resource_index); |
| + break; |
| + } |
| + } |
| } |
| } |