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

Unified Diff: chrome/test/base/chrome_process_util.cc

Issue 868543002: Move OpenProcessHandle to Process::Open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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/test/base/chrome_process_util.cc
diff --git a/chrome/test/base/chrome_process_util.cc b/chrome/test/base/chrome_process_util.cc
index fe6d0c6d48cb0237a0f5669a296178ea95f751d6..282cab0edcce6c8426a34ed9669647bce7722bd6 100644
--- a/chrome/test/base/chrome_process_util.cc
+++ b/chrome/test/base/chrome_process_util.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/process/kill.h"
+#include "base/process/process.h"
#include "base/process/process_iterator.h"
#include "base/time/time.h"
#include "chrome/common/chrome_constants.h"
@@ -49,15 +50,12 @@ std::vector<base::FilePath::StringType> GetRunningHelperExecutableNames() {
void TerminateAllChromeProcesses(const ChromeProcessList& process_pids) {
ChromeProcessList::const_iterator it;
for (it = process_pids.begin(); it != process_pids.end(); ++it) {
- base::ProcessHandle handle;
- if (!base::OpenProcessHandle(*it, &handle)) {
+ base::Process process = base::Process::Open(*it);
+ if (process.IsValid()) {
// Ignore processes for which we can't open the handle. We don't
// guarantee that all processes will terminate, only try to do so.
- continue;
+ base::KillProcess(process.Handle(), content::RESULT_CODE_KILLED, true);
}
-
- base::KillProcess(handle, content::RESULT_CODE_KILLED, true);
- base::CloseProcessHandle(handle);
}
}
« no previous file with comments | « chrome/browser/service_process/service_process_control_browsertest.cc ('k') | chrome/test/perf/perf_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698