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

Unified Diff: chrome/browser/process_singleton_browsertest.cc

Issue 999033003: Remove uses of KillProcess() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/browser/process_singleton_browsertest.cc
diff --git a/chrome/browser/process_singleton_browsertest.cc b/chrome/browser/process_singleton_browsertest.cc
index 8700737ce33a82e446930ba30e6b9cb7d698bdf3..0ecd9aeb61b1d5d61a40f3d6dee698e3f028803b 100644
--- a/chrome/browser/process_singleton_browsertest.cc
+++ b/chrome/browser/process_singleton_browsertest.cc
@@ -16,7 +16,6 @@
#include "base/files/scoped_temp_dir.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
-#include "base/process/kill.h"
#include "base/process/launch.h"
#include "base/process/process.h"
#include "base/process/process_iterator.h"
@@ -160,7 +159,7 @@ class ProcessSingletonTest : public InProcessBrowserTest {
// flaky wait. Instead, we kill all descendants of the main process after we
// killed it, relying on the fact that we can still get the parent id of a
// child process, even when the parent dies.
- void KillProcessTree(base::ProcessHandle process_handle) {
+ void KillProcessTree(const base::Process& process) {
class ProcessTreeFilter : public base::ProcessFilter {
public:
explicit ProcessTreeFilter(base::ProcessId parent_pid) {
@@ -176,11 +175,11 @@ class ProcessSingletonTest : public InProcessBrowserTest {
}
private:
mutable std::set<base::ProcessId> ancestor_pids_;
- } process_tree_filter(base::GetProcId(process_handle));
+ } process_tree_filter(process.Pid());
// Start by explicitly killing the main process we know about...
static const int kExitCode = 42;
- EXPECT_TRUE(base::KillProcess(process_handle, kExitCode, true /* wait */));
+ EXPECT_TRUE(process.Terminate(kExitCode, true /* wait */));
cpu_(ooo_6.6-7.5) 2015/03/17 20:36:31 woa, Terminate is a const method?
rvargas (doing something else) 2015/03/17 22:40:53 Yes. I added const when adding the second argument
// Then loop until we can't find any of its descendant.
// But don't try more than kNbTries times...
@@ -303,7 +302,7 @@ IN_PROC_BROWSER_TEST_F(ProcessSingletonTest, MAYBE_StartupRaceCondition) {
// But we let the last loop turn finish so that we can properly
// kill all remaining processes. Starting with this one...
if (chrome_starters_[starter_index]->process_.IsValid()) {
- KillProcessTree(chrome_starters_[starter_index]->process_.Handle());
+ KillProcessTree(chrome_starters_[starter_index]->process_);
}
}
pending_starters.erase(pending_starters.begin() + done_index);
@@ -314,7 +313,7 @@ IN_PROC_BROWSER_TEST_F(ProcessSingletonTest, MAYBE_StartupRaceCondition) {
size_t last_index = pending_starters.front();
pending_starters.clear();
if (chrome_starters_[last_index]->process_.IsValid()) {
- KillProcessTree(chrome_starters_[last_index]->process_.Handle());
+ KillProcessTree(chrome_starters_[last_index]->process_);
chrome_starters_[last_index]->done_event_.Wait();
}
}

Powered by Google App Engine
This is Rietveld 408576698