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

Issue 8674003: Move the ProcessWatcher methods out of content/common/process_watcher into base/process_util, alo... (Closed)

Created:
9 years, 1 month ago by jam
Modified:
9 years, 1 month ago
CC:
chromium-reviews, brettw-cc_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., Mark Larson
Visibility:
Public.

Description

Move the ProcessWatcher methods out of content/common/process_watcher into base/process_util, alongside the other process methods. The only non-trivial move change is to the Windows implementation, where I changed KillProcess to use an exit code of kProcessKilledExitCode instead of content::RESULT_CODE_HUNG. cpu said that the existing code was incorrect, since GetTerminationStatus() should be mapping that result to TERMINATION_STATUS_PROCESS_WAS_KILLED. So I changed the exit code to kProcessKilledExitCode. This might make the UMA stats for killed processes to go up (and crashed to go down), but that will be an accounting change and should be zero-sum. BUG=98716 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111371

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+403 lines, -501 lines) Patch
M base/process_util.h View 1 chunk +22 lines, -0 lines 0 comments Download
M base/process_util_mac.mm View 4 chunks +159 lines, -0 lines 0 comments Download
M base/process_util_posix.cc View 1 chunk +97 lines, -0 lines 2 comments Download
M base/process_util_unittest.cc View 1 chunk +45 lines, -0 lines 1 comment Download
M base/process_util_win.cc View 4 chunks +71 lines, -0 lines 1 comment Download
M chrome/browser/platform_util_chromeos.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/platform_util_linux.cc View 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/printing/printer_manager_dialog_linux.cc View 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/ui/webui/options/advanced_options_utils_x11.cc View 2 chunks +1 line, -2 lines 0 comments Download
M content/browser/browser_child_process_host.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/child_process_launcher.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 2 chunks +1 line, -1 line 0 comments Download
M content/browser/zygote_host_linux.cc View 3 chunks +2 lines, -3 lines 0 comments Download
M content/browser/zygote_main_linux.cc View 2 chunks +1 line, -2 lines 0 comments Download
D content/common/process_watcher.h View 1 chunk +0 lines, -46 lines 0 comments Download
D content/common/process_watcher_mac.cc View 1 chunk +0 lines, -170 lines 0 comments Download
D content/common/process_watcher_posix.cc View 1 chunk +0 lines, -105 lines 0 comments Download
D content/common/process_watcher_unittest.cc View 1 chunk +0 lines, -64 lines 0 comments Download
D content/common/process_watcher_win.cc View 1 chunk +0 lines, -85 lines 0 comments Download
M content/content_common.gypi View 2 chunks +0 lines, -7 lines 0 comments Download
M content/content_tests.gypi View 2 chunks +0 lines, -7 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
jam
Will: last one I promise :) Carlos: FYI per our discussion and your helpful background
9 years, 1 month ago (2011-11-23 00:59:27 UTC) #1
cpu_(ooo_6.6-7.5)
I am not sure I can get to this code review in the next 24 ...
9 years, 1 month ago (2011-11-23 01:59:49 UTC) #2
jam
On 2011/11/23 01:59:49, cpu wrote: > I am not sure I can get to this ...
9 years, 1 month ago (2011-11-23 02:09:35 UTC) #3
willchan no longer on Chromium
LGTM, although you should probably tell people who look at the stability metrics so they ...
9 years, 1 month ago (2011-11-23 17:46:36 UTC) #4
jam
done, will tell laforge/jar http://codereview.chromium.org/8674003/diff/1/base/process_util_posix.cc File base/process_util_posix.cc (right): http://codereview.chromium.org/8674003/diff/1/base/process_util_posix.cc#newcode1308 base/process_util_posix.cc:1308: #endif On 2011/11/23 17:46:37, willchan ...
9 years, 1 month ago (2011-11-23 17:48:33 UTC) #5
jar (doing other things)
+cc mal Since we should watch for changes in crash rates on renderer processes as ...
9 years, 1 month ago (2011-11-23 18:14:23 UTC) #6
cpu_(ooo_6.6-7.5)
9 years, 1 month ago (2011-11-24 00:22:07 UTC) #7
http://codereview.chromium.org/8674003/diff/1/base/process_util_unittest.cc
File base/process_util_unittest.cc (right):

http://codereview.chromium.org/8674003/diff/1/base/process_util_unittest.cc#n...
base/process_util_unittest.cc:850: base::WaitForSingleProcess(child_process,
5000);
the problem here is that EnsureProcessTerminated closes the handle so line 850
is a silent fail.

http://codereview.chromium.org/8674003/diff/1/base/process_util_win.cc
File base/process_util_win.cc (right):

http://codereview.chromium.org/8674003/diff/1/base/process_util_win.cc#newcod...
base/process_util_win.cc:139: CloseHandle(process_);
I see a problem, here we close the handle, but we don't do that if the timer
expired.

Powered by Google App Engine
This is Rietveld 408576698