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

Issue 24004: Fix the windows implementation of KillProcess and WaitForSingleProcess to not... (Closed)

Created:
11 years, 10 months ago by stoyan
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Fix the windows implementation of KillProcess and WaitForSingleProcess to not close the process handle that they do not own. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=9400

Patch Set 1 #

Patch Set 2 : maruel@chromium.org #

Total comments: 2

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 4

Patch Set 5 : '' #

Total comments: 7

Patch Set 6 : '' #

Total comments: 4

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -22 lines) Patch
M base/process_util.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M base/process_util_posix.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M base/process_util_unittest.cc View 1 2 3 4 3 chunks +3 lines, -0 lines 0 comments Download
M base/process_util_win.cc View 1 2 3 4 5 6 5 chunks +19 lines, -16 lines 0 comments Download
M base/stats_table_unittest.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/message_window.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/metrics/metrics_service_uitest.cc View 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/common/ipc_fuzzing_tests.cc View 1 2 3 4 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/ipc_tests.cc View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M net/disk_cache/stress_cache.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
stoyan
11 years, 10 months ago (2009-02-06 22:47:23 UTC) #1
tommi (sloooow) - chröme
lgtm (btw, I didn't see a reviewer list) http://codereview.chromium.org/24004/diff/2001/3002 File base/process_util_unittest.cc (right): http://codereview.chromium.org/24004/diff/2001/3002#newcode69 Line 69: ...
11 years, 10 months ago (2009-02-06 22:56:03 UTC) #2
TVL
http://codereview.chromium.org/24004/diff/2001/3005 File base/process_util_win.cc (right): http://codereview.chromium.org/24004/diff/2001/3005#newcode176 Line 176: bool result = !!TerminateProcess(process, exit_code); while you're here, ...
11 years, 10 months ago (2009-02-06 22:56:25 UTC) #3
stoyan
11 years, 10 months ago (2009-02-06 23:17:25 UTC) #4
M-A Ruel
Sorry for the delay. :( http://codereview.chromium.org/24004/diff/2009/3028 File base/process_util.h (right): http://codereview.chromium.org/24004/diff/2009/3028#newcode156 Line 156: bool KillProcess(DWORD process_id, ...
11 years, 10 months ago (2009-02-07 20:54:39 UTC) #5
stoyan
http://codereview.chromium.org/24004/diff/2009/3028 File base/process_util.h (right): http://codereview.chromium.org/24004/diff/2009/3028#newcode156 Line 156: bool KillProcess(DWORD process_id, int exit_code, bool wait); On ...
11 years, 10 months ago (2009-02-09 18:04:06 UTC) #6
M-A Ruel
lgtm with the 80 cols fix. I added 2 nits, it's up to you. No ...
11 years, 10 months ago (2009-02-09 18:31:56 UTC) #7
stoyan
http://codereview.chromium.org/24004/diff/3037/3042 File base/process_util_win.cc (right): http://codereview.chromium.org/24004/diff/3037/3042#newcode257 Line 257: const ProcessFilter* filter) : On 2009/02/09 18:31:56, M-A ...
11 years, 10 months ago (2009-02-09 18:44:37 UTC) #8
M-A Ruel
lgtm if you remove the if (!Kill...). I think it should continue killing as much ...
11 years, 10 months ago (2009-02-09 18:50:17 UTC) #9
stoyan
http://codereview.chromium.org/24004/diff/2028/3061 File base/process_util_win.cc (right): http://codereview.chromium.org/24004/diff/2028/3061#newcode258 Line 258: started_iteration_(false), On 2009/02/09 18:50:17, M-A wrote: > Actually ...
11 years, 10 months ago (2009-02-09 18:59:42 UTC) #10
M-A Ruel
On 2009/02/09 18:59:42, stoyan wrote: > http://codereview.chromium.org/24004/diff/2028/3061#newcode321 > Line 321: if (!KillProcessById((*entry).th32ProcessID, exit_code, true)) > ...
11 years, 10 months ago (2009-02-09 19:02:50 UTC) #11
tommi (sloooow) - chröme
11 years, 10 months ago (2009-02-09 19:42:50 UTC) #12
http://codereview.chromium.org/24004/diff/3037/3042
File base/process_util_win.cc (right):

http://codereview.chromium.org/24004/diff/3037/3042#newcode321
Line 321: result = KillProcessById((*entry).th32ProcessID, exit_code, true) &&
result;
> "If we failed on one, no attempt will be made to kill the others."

Are you sure that's true?

I don't think you're short-circuiting correctly here since you evaluate 'result'
second and not first.

In this case I think you always try to kill every process, although the return
value will be false if one of them failed.

Powered by Google App Engine
This is Rietveld 408576698