summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
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_;