summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2015-03-04 14:38:20 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-04 22:39:24 +0000
commit4683e5ee356b1ba60813306ff6cb12de80060143 (patch)
tree93af5589876974f4ad540de19a47fc9f47e78f26 /win8
parent40b0d46d7c7660cb8cb8bfc68df1b233f0811cd3 (diff)
downloadchromium_src-4683e5ee356b1ba60813306ff6cb12de80060143.zip
chromium_src-4683e5ee356b1ba60813306ff6cb12de80060143.tar.gz
chromium_src-4683e5ee356b1ba60813306ff6cb12de80060143.tar.bz2
Remove base::KillProcessById
BUG=417532 Review URL: https://codereview.chromium.org/970943003 Cr-Commit-Position: refs/heads/master@{#319143}
Diffstat (limited to 'win8')
-rw-r--r--win8/delegate_execute/delegate_execute.cc6
-rw-r--r--win8/delegate_execute/delegate_execute_operation.cc8
-rw-r--r--win8/delegate_execute/delegate_execute_operation.h5
3 files changed, 10 insertions, 9 deletions
diff --git a/win8/delegate_execute/delegate_execute.cc b/win8/delegate_execute/delegate_execute.cc
index 0d2bbbb..2574619 100644
--- a/win8/delegate_execute/delegate_execute.cc
+++ b/win8/delegate_execute/delegate_execute.cc
@@ -108,9 +108,9 @@ int RelaunchChrome(const DelegateExecuteOperation& operation) {
AtlTrace("Unexpected release of the relaunch mutex!!\n");
} else if (result == WAIT_TIMEOUT) {
// This could mean that Chrome is hung. Proceed to exterminate.
- DWORD pid = operation.GetParentPid();
- AtlTrace("%ds timeout. Killing Chrome %d\n", kWaitSeconds, pid);
- base::KillProcessById(pid, 0, false);
+ base::Process process = operation.GetParent();
+ AtlTrace("%ds timeout. Killing Chrome %d\n", kWaitSeconds, process.Pid());
+ process.Terminate(0);
} else {
AtlTrace("Failed to wait for relaunch mutex, result is 0x%x\n", result);
}
diff --git a/win8/delegate_execute/delegate_execute_operation.cc b/win8/delegate_execute/delegate_execute_operation.cc
index a4a61a12..277b74b 100644
--- a/win8/delegate_execute/delegate_execute_operation.cc
+++ b/win8/delegate_execute/delegate_execute_operation.cc
@@ -51,15 +51,15 @@ bool DelegateExecuteOperation::Init(const base::CommandLine* cmd_line) {
return true;
}
-DWORD DelegateExecuteOperation::GetParentPid() const {
+base::Process DelegateExecuteOperation::GetParent() const {
std::vector<base::string16> parts;
base::SplitString(mutex_, L'.', &parts);
if (parts.size() != 3)
- return 0;
+ return base::Process();
DWORD pid;
if (!base::StringToUint(parts[2], reinterpret_cast<uint32*>(&pid)))
- return 0;
- return pid;
+ return base::Process();
+ return base::Process::Open(pid);
}
} // namespace delegate_execute
diff --git a/win8/delegate_execute/delegate_execute_operation.h b/win8/delegate_execute/delegate_execute_operation.h
index 26bc19e..3dbc702 100644
--- a/win8/delegate_execute/delegate_execute_operation.h
+++ b/win8/delegate_execute/delegate_execute_operation.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "base/process/process.h"
#include "base/strings/string16.h"
namespace base {
@@ -59,8 +60,8 @@ class DelegateExecuteOperation {
return mutex_;
}
- // Returns the process id of the parent or 0 on failure.
- DWORD GetParentPid() const;
+ // Returns the parent process.
+ base::Process GetParent() const;
const base::FilePath& shortcut() const {
return relaunch_shortcut_;