summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 19:28:41 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 19:28:41 +0000
commitcd4fd156aba80ddffd3fffd8e2d8703247181fe0 (patch)
tree1f4b2dc5f58e5f534b033f71e0e48cc5549c6732 /chrome
parenta6309f8198825442d77f0fc9aa70c82ae5dd6d04 (diff)
downloadchromium_src-cd4fd156aba80ddffd3fffd8e2d8703247181fe0.zip
chromium_src-cd4fd156aba80ddffd3fffd8e2d8703247181fe0.tar.gz
chromium_src-cd4fd156aba80ddffd3fffd8e2d8703247181fe0.tar.bz2
Fix the windows implementation of KillProcess and WaitForSingleProcess to not close the process handle that they do not own.
Review URL: http://codereview.chromium.org/24004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/message_window.cc2
-rw-r--r--chrome/browser/metrics/metrics_service_uitest.cc3
-rw-r--r--chrome/common/ipc_fuzzing_tests.cc3
-rw-r--r--chrome/common/ipc_tests.cc2
4 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/message_window.cc b/chrome/browser/message_window.cc
index 3bfced7..d198254 100644
--- a/chrome/browser/message_window.cc
+++ b/chrome/browser/message_window.cc
@@ -106,7 +106,7 @@ bool MessageWindow::NotifyOtherProcess() {
}
// Time to take action. Kill the browser process.
- base::KillProcess(process_id, ResultCodes::HUNG, true);
+ base::KillProcessById(process_id, ResultCodes::HUNG, true);
remote_window_ = NULL;
return false;
}
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index db35f1c..e782128 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -91,7 +91,8 @@ TEST_F(MetricsServiceTest, CrashRenderers) {
int process_id = 0;
ASSERT_TRUE(tab->GetProcessID(&process_id));
ASSERT_NE(0, process_id);
- base::KillProcess(process_id, 0xc0000005, true); // Fake Access Violation.
+ // Fake Access Violation.
+ base::KillProcessById(process_id, 0xc0000005, true);
// Give the browser a chance to notice the crashed tab.
Sleep(1000);
diff --git a/chrome/common/ipc_fuzzing_tests.cc b/chrome/common/ipc_fuzzing_tests.cc
index 0638bb4..b9a9563 100644
--- a/chrome/common/ipc_fuzzing_tests.cc
+++ b/chrome/common/ipc_fuzzing_tests.cc
@@ -302,6 +302,7 @@ TEST_F(IPCFuzzingTest, SanityTest) {
EXPECT_TRUE(listener.ExpectMessage(value, MsgClassSI::ID));
EXPECT_TRUE(base::WaitForSingleProcess(server_process, 5000));
+ base::CloseProcessHandle(server_process);
}
// This test uses a payload that is smaller than expected.
@@ -331,6 +332,7 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadShort) {
EXPECT_TRUE(listener.ExpectMessage(1, MsgClassSI::ID));
EXPECT_TRUE(base::WaitForSingleProcess(server_process, 5000));
+ base::CloseProcessHandle(server_process);
}
#endif // NDEBUG
@@ -365,6 +367,7 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadArgs) {
EXPECT_TRUE(listener.ExpectMessage(3, MsgClassIS::ID));
EXPECT_TRUE(base::WaitForSingleProcess(server_process, 5000));
+ base::CloseProcessHandle(server_process);
}
// This class is for testing the IPC_BEGIN_MESSAGE_MAP_EX macros.
diff --git a/chrome/common/ipc_tests.cc b/chrome/common/ipc_tests.cc
index e2b5416..01873e7 100644
--- a/chrome/common/ipc_tests.cc
+++ b/chrome/common/ipc_tests.cc
@@ -231,6 +231,7 @@ TEST_F(IPCChannelTest, ChannelTest) {
// Cleanup child process.
EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000));
+ base::CloseProcessHandle(process_handle);
}
#if defined(OS_POSIX)
@@ -357,6 +358,7 @@ TEST_F(IPCChannelTest, ChannelProxyTest) {
// cleanup child process
EXPECT_TRUE(base::WaitForSingleProcess(process_handle, 5000));
+ base::CloseProcessHandle(process_handle);
}
thread.Stop();
}