| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/chrome_process_util.h" | 5 #include "chrome/test/chrome_process_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 ChromeProcessList process_pids(GetRunningChromeProcesses(data_dir)); | 23 ChromeProcessList process_pids(GetRunningChromeProcesses(data_dir)); |
| 24 | 24 |
| 25 std::vector<base::ProcessHandle> handles; | 25 std::vector<base::ProcessHandle> handles; |
| 26 { | 26 { |
| 27 ChromeProcessList::const_iterator it; | 27 ChromeProcessList::const_iterator it; |
| 28 for (it = process_pids.begin(); it != process_pids.end(); ++it) { | 28 for (it = process_pids.begin(); it != process_pids.end(); ++it) { |
| 29 base::ProcessHandle handle; | 29 base::ProcessHandle handle; |
| 30 // Ignore processes for which we can't open the handle. We don't guarantee | 30 // Ignore processes for which we can't open the handle. We don't guarantee |
| 31 // that all processes will terminate, only try to do so. | 31 // that all processes will terminate, only try to do so. |
| 32 if (base::OpenProcessHandle(*it, &handle)) | 32 if (base::OpenPrivilegedProcessHandle(*it, &handle)) |
| 33 handles.push_back(handle); | 33 handles.push_back(handle); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 std::vector<base::ProcessHandle>::const_iterator it; | 37 std::vector<base::ProcessHandle>::const_iterator it; |
| 38 for (it = handles.begin(); it != handles.end(); ++it) | 38 for (it = handles.begin(); it != handles.end(); ++it) |
| 39 base::KillProcess(*it, ResultCodes::TASKMAN_KILL, false); | 39 base::KillProcess(*it, ResultCodes::TASKMAN_KILL, false); |
| 40 | 40 |
| 41 const Time start = Time::Now(); | 41 const Time start = Time::Now(); |
| 42 for (it = handles.begin(); | 42 for (it = handles.begin(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 &filter); | 97 &filter); |
| 98 while ((process_entry = it.NextProcessEntry())) | 98 while ((process_entry = it.NextProcessEntry())) |
| 99 result.push_back(process_entry->pid); | 99 result.push_back(process_entry->pid); |
| 100 } | 100 } |
| 101 #endif | 101 #endif |
| 102 | 102 |
| 103 result.push_back(browser_pid); | 103 result.push_back(browser_pid); |
| 104 | 104 |
| 105 return result; | 105 return result; |
| 106 } | 106 } |
| OLD | NEW |