diff options
author | rvargas <rvargas@chromium.org> | 2015-03-31 21:10:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-01 04:11:15 +0000 |
commit | f8d789c4558c7575f4d388d44730d18fdf15772c (patch) | |
tree | 54807f725d613c10d0026a98cedb89189bef1a06 /chromeos | |
parent | d65edb7b2d228497056e18100c882f7cf7d59c36 (diff) | |
download | chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.zip chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.tar.gz chromium_src-f8d789c4558c7575f4d388d44730d18fdf15772c.tar.bz2 |
Remove uses of KillProcess.
BUG=417532
Review URL: https://codereview.chromium.org/1035323002
Cr-Commit-Position: refs/heads/master@{#323179}
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/process_proxy/process_proxy.cc | 5 | ||||
-rw-r--r-- | chromeos/process_proxy/process_proxy_unittest.cc | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/chromeos/process_proxy/process_proxy.cc b/chromeos/process_proxy/process_proxy.cc index 8ce37ef..7551caa 100644 --- a/chromeos/process_proxy/process_proxy.cc +++ b/chromeos/process_proxy/process_proxy.cc @@ -12,8 +12,8 @@ #include "base/files/file_util.h" #include "base/logging.h" #include "base/posix/eintr_wrapper.h" -#include "base/process/kill.h" #include "base/process/launch.h" +#include "base/process/process.h" #include "base/threading/thread.h" #include "third_party/cros_system_api/switches/chrome_switches.h" @@ -144,7 +144,8 @@ void ProcessProxy::Close() { callback_ = ProcessOutputCallback(); callback_runner_ = NULL; - base::KillProcess(pid_, 0, true /* wait */); + base::Process process = base::Process::DeprecatedGetProcessFromHandle(pid_); + process.Terminate(0, true /* wait */); // TODO(tbarzic): What if this fails? StopWatching(); diff --git a/chromeos/process_proxy/process_proxy_unittest.cc b/chromeos/process_proxy/process_proxy_unittest.cc index e6b9c46..97c7495 100644 --- a/chromeos/process_proxy/process_proxy_unittest.cc +++ b/chromeos/process_proxy/process_proxy_unittest.cc @@ -10,6 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/process/kill.h" +#include "base/process/process.h" #include "base/threading/thread.h" #include "chromeos/process_proxy/process_proxy_registry.h" @@ -132,7 +133,9 @@ class RegistryNotifiedOnProcessExitTestRunner : public TestRunner { output_received_ = true; EXPECT_EQ(type, "stdout"); EXPECT_EQ(output, "p"); - base::KillProcess(pid_, 0 , true); + base::Process process = + base::Process::DeprecatedGetProcessFromHandle(pid_); + process.Terminate(0, true); return; } EXPECT_EQ("exit", type); @@ -197,8 +200,11 @@ class ProcessProxyTest : public testing::Test { base::TerminationStatus status = base::GetTerminationStatus(pid_, NULL); EXPECT_NE(base::TERMINATION_STATUS_STILL_RUNNING, status); - if (status == base::TERMINATION_STATUS_STILL_RUNNING) - base::KillProcess(pid_, 0, true); + if (status == base::TERMINATION_STATUS_STILL_RUNNING) { + base::Process process = + base::Process::DeprecatedGetProcessFromHandle(pid_); + process.Terminate(0, true); + } base::MessageLoop::current()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |