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

Issue 5172009: This adds some plumbing for propagating the reason for a renderer's death (Closed)

Created:
10 years, 1 month ago by Greg Spencer (Chromium)
Modified:
9 years, 7 months ago
CC:
chromium-reviews, ben+cc_chromium.org, Erik does not do reviews, brettw-cc_chromium.org, Aaron Boodman, pam+watch_chromium.org, darin-cc_chromium.org, native-client-reviews_googlegroups.com, Mark Mentovai, Paweł Hajdan Jr., agl
Visibility:
Public.

Description

This adds some plumbing for propagating the status and error code of a renderer process that went away so that we can tell at the UI level what happened to the tab: did it crash, or was it killed by the OOM killer (or some other reason). This is in preparation for implementing a new UI for when a process is killed by the OOM on ChromeOS which handles it differently from a crash. Most of the changes are modifications of the argument list to include a status and error code for the exited process, but in addition the following was done: - Changed the name of DidProcessCrash to GetTerminationStatus. - Added TerminationStatus enum in process_util.h, so it can be used as the status returned by GetTerminationStatus. - Improved process_util_unittest to actually test for crashing and terminated processes on all platforms. - Added a new notification for renderers that were killed. - Added error code information to crash notification. - Added status and error code information to renderer IPC message for RenderViewGone. - Added a UMA histogram count for number of renderer kills. BUG=http://crosbug.com/8505 TEST=ran new unit test. Test passes on try servers. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69082

Patch Set 1 #

Total comments: 9

Patch Set 2 : Test review changes, disable test on Mac #

Patch Set 3 : Forgot a header #

Patch Set 4 : checkpoint #

Patch Set 5 : Fixing crash reporting conditions #

Patch Set 6 : Fixing exit code usage, general cleanup #

Patch Set 7 : Improving comment #

Patch Set 8 : Renaming PROCESS_END_* to EXIT_CODE_* #

Total comments: 2

Patch Set 9 : Upload after sync for proper diffs #

Total comments: 7

Patch Set 10 : Moving error codes into result_codes.h #

Patch Set 11 : Removed TERMINATION_STATUS_PROCESS_WAS_HUNG #

Patch Set 12 : Fixing windows includes #

Total comments: 4

Patch Set 13 : Final review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+560 lines, -238 lines) Patch
M base/process_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +19 lines, -12 lines 0 comments Download
M base/process_util_posix.cc View 1 2 3 4 5 6 7 8 9 2 chunks +24 lines, -17 lines 0 comments Download
M base/process_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +155 lines, -17 lines 0 comments Download
M base/process_util_win.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +54 lines, -32 lines 0 comments Download
M chrome/browser/browser_child_process_host.h View 1 2 3 4 5 6 7 8 2 chunks +17 lines, -5 lines 0 comments Download
M chrome/browser/browser_child_process_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +24 lines, -8 lines 0 comments Download
M chrome/browser/child_process_launcher.h View 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/child_process_launcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +12 lines, -11 lines 0 comments Download
M chrome/browser/child_process_security_policy_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_crash_recovery_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/sandboxed_extension_unpacker.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/sandboxed_extension_unpacker.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/gpu_process_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/gpu_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/importer/importer.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/importer/importer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/in_process_webkit/indexed_db_key_utility_client.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/in_process_webkit/indexed_db_key_utility_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/nacl_host/nacl_process_host.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/nacl_host/nacl_process_host.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/notifications/balloon_host.h View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/notifications/balloon_host.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/profile_import_process_host.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/profile_import_process_host.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +19 lines, -7 lines 0 comments Download
M chrome/browser/renderer_host/render_process_host.h View 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 5 6 7 8 9 4 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 4 5 6 7 8 9 2 chunks +13 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_views.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_views.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/test/test_render_view_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/test/web_cache_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/interstitial_page.h View 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/interstitial_page.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 2 3 4 5 6 7 8 9 3 chunks +13 lines, -4 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 6 7 8 9 6 chunks +13 lines, -8 lines 0 comments Download
M chrome/browser/tab_contents/web_contents_unittest.cc View 5 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/task_manager/task_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/utility_process_host.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/utility_process_host.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/web_resource/web_resource_service.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/zygote_host_linux.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +13 lines, -11 lines 0 comments Download
M chrome/browser/zygote_host_linux.cc View 1 2 3 4 5 6 7 8 9 3 chunks +19 lines, -13 lines 0 comments Download
M chrome/browser/zygote_main_linux.cc View 1 2 3 4 5 6 7 8 9 3 chunks +18 lines, -12 lines 0 comments Download
M chrome/common/notification_type.h View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -4 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -1 line 0 comments Download
M chrome/common/result_codes.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/test/chrome_process_util.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -2 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
Greg Spencer (Chromium)
Hi Adam, In light of your recent change: http://codereview.chromium.org/5377001/ Can you tell me if I ...
10 years ago (2010-11-29 20:13:30 UTC) #1
Mark Mentovai
The context here is that Greg’s test highlights a fundamental limitation of waiting for children ...
10 years ago (2010-11-29 21:19:30 UTC) #2
agl
On Mon, Nov 29, 2010 at 3:13 PM, <gspencer@chromium.org> wrote: > Hi Adam, I think ...
10 years ago (2010-11-29 22:29:04 UTC) #3
Greg Spencer
On Mon, Nov 29, 2010 at 2:28 PM, Adam Langley <agl@chromium.org> wrote: > On Mon, ...
10 years ago (2010-11-29 22:44:07 UTC) #4
agl
On Mon, Nov 29, 2010 at 5:43 PM, Greg Spencer <gspencer@google.com> wrote: > And I'm ...
10 years ago (2010-11-29 22:53:20 UTC) #5
Paweł Hajdan Jr.
Drive-by with some test comments. Please do not commit without my explicit "LGTM". http://codereview.chromium.org/5172009/diff/1/base/process_util_unittest.cc File ...
10 years ago (2010-11-30 09:39:38 UTC) #6
Greg Spencer (Chromium)
http://codereview.chromium.org/5172009/diff/1/base/process_util_unittest.cc File base/process_util_unittest.cc (right): http://codereview.chromium.org/5172009/diff/1/base/process_util_unittest.cc#newcode62 base/process_util_unittest.cc:62: const int kMaxWaitTimeMs = 5000; On 2010/11/30 09:39:38, Paweł ...
10 years ago (2010-11-30 19:42:29 UTC) #7
Paweł Hajdan Jr.
http://codereview.chromium.org/5172009/diff/1/base/process_util_unittest.cc File base/process_util_unittest.cc (right): http://codereview.chromium.org/5172009/diff/1/base/process_util_unittest.cc#newcode150 base/process_util_unittest.cc:150: WaitForChildTermination(handle, &exit_code); On 2010/11/30 19:42:29, Greg Spencer (Chromium) wrote: ...
10 years ago (2010-12-01 08:40:45 UTC) #8
Greg Spencer (Chromium)
On 2010/12/01 08:40:45, Paweł Hajdan Jr. wrote: > I suspected something like that. However, the ...
10 years ago (2010-12-02 01:32:12 UTC) #9
Greg Spencer (Chromium)
http://codereview.chromium.org/5172009/diff/27001/chrome/browser/metrics/metrics_service.cc File chrome/browser/metrics/metrics_service.cc (right): http://codereview.chromium.org/5172009/diff/27001/chrome/browser/metrics/metrics_service.cc#newcode615 chrome/browser/metrics/metrics_service.cc:615: base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { I'm wondering if I should be adding ...
10 years ago (2010-12-03 01:00:07 UTC) #10
brettw
I realize moving the enum is a bit of extra work, but I did some ...
10 years ago (2010-12-03 01:01:54 UTC) #11
Paweł Hajdan Jr.
On Thu, Dec 2, 2010 at 02:32, <gspencer@chromium.org> wrote: > On 2010/12/01 08:40:45, Paweł Hajdan ...
10 years ago (2010-12-03 18:07:23 UTC) #12
Greg Spencer (Chromium)
http://codereview.chromium.org/5172009/diff/31001/base/process_util.h File base/process_util.h (right): http://codereview.chromium.org/5172009/diff/31001/base/process_util.h#newcode125 base/process_util.h:125: enum ExitCode { On 2010/12/03 01:01:54, brettw wrote: > ...
10 years ago (2010-12-03 18:29:25 UTC) #13
Greg Spencer (Chromium)
On 2010/12/03 18:07:23, PaweÅ Hajdan Jr. wrote: > It seems at least some of the ...
10 years ago (2010-12-03 18:48:08 UTC) #14
Greg Spencer (Chromium)
On 2010/12/03 18:48:08, Greg Spencer (Chromium) wrote: > OK, but then we're not testing what ...
10 years ago (2010-12-03 18:49:53 UTC) #15
Paweł Hajdan Jr.
On Fri, Dec 3, 2010 at 19:48, <gspencer@chromium.org> wrote: > > OK, but then we're ...
10 years ago (2010-12-04 09:32:24 UTC) #16
Greg Spencer (Chromium)
On 2010/12/03 18:29:25, Greg Spencer (Chromium) wrote: > http://codereview.chromium.org/5172009/diff/31001/base/process_util.h > File base/process_util.h (right): > > ...
10 years ago (2010-12-07 22:27:07 UTC) #17
Greg Spencer (Chromium)
On 2010/12/04 09:32:24, Paweł Hajdan Jr. wrote: > How about creating a variant of WaitForSingleProcess ...
10 years ago (2010-12-08 01:07:20 UTC) #18
Greg Spencer (Chromium)
On 2010/12/08 01:07:20, Greg Spencer (Chromium) wrote: > Can I quote you from the last ...
10 years ago (2010-12-08 01:10:23 UTC) #19
Paweł Hajdan Jr.
Ah, it's the same code as with *that* review. Sorry, I was thinking we're copy-pasting ...
10 years ago (2010-12-09 09:54:15 UTC) #20
brettw
http://codereview.chromium.org/5172009/diff/31001/base/process_util.h File base/process_util.h (right): http://codereview.chromium.org/5172009/diff/31001/base/process_util.h#newcode125 base/process_util.h:125: enum ExitCode { I don't really like the exit ...
10 years ago (2010-12-09 16:48:49 UTC) #21
brettw
http://codereview.chromium.org/5172009/diff/31001/base/process_util.h File base/process_util.h (right): http://codereview.chromium.org/5172009/diff/31001/base/process_util.h#newcode125 base/process_util.h:125: enum ExitCode { I'm more sure that I don't ...
10 years ago (2010-12-09 17:22:13 UTC) #22
Greg Spencer (Chromium)
http://codereview.chromium.org/5172009/diff/31001/base/process_util.h File base/process_util.h (right): http://codereview.chromium.org/5172009/diff/31001/base/process_util.h#newcode125 base/process_util.h:125: enum ExitCode { On 2010/12/09 17:22:13, brettw wrote: > ...
10 years ago (2010-12-09 17:58:42 UTC) #23
brettw
> OK, as I said, I'm happy taking the exit code out and moving it ...
10 years ago (2010-12-09 18:11:26 UTC) #24
Greg Spencer
On Thu, Dec 9, 2010 at 10:11 AM, <brettw@chromium.org> wrote: > > OK, as I ...
10 years ago (2010-12-09 18:21:24 UTC) #25
Greg Spencer (Chromium)
Ok, I've done one possible way of doing this, but there is a snag I'd ...
10 years ago (2010-12-10 18:49:25 UTC) #26
Greg Spencer (Chromium)
On 2010/12/10 18:49:25, Greg Spencer (Chromium) wrote: > Ok, I've done one possible way of ...
10 years ago (2010-12-10 22:59:47 UTC) #27
Greg Spencer (Chromium)
OK, PTAL. The TERMINATION_STATUS_PROCESS_WAS_HUNG value has been removed, and the exit code enum eliminated (replaced ...
10 years ago (2010-12-10 23:44:33 UTC) #28
brettw
LGTM, sorry this took so long! Just a couple things to check before you check ...
10 years ago (2010-12-13 21:09:34 UTC) #29
Greg Spencer (Chromium)
10 years ago (2010-12-13 22:36:16 UTC) #30
Thanks for the reviews!

http://codereview.chromium.org/5172009/diff/136001/base/process_util.h
File base/process_util.h (right):

http://codereview.chromium.org/5172009/diff/136001/base/process_util.h#newcod...
base/process_util.h:356: // caller is not interested in it.
On 2010/12/13 21:09:35, brettw wrote:
> On Linux, is my understanding correct that this function may only be called
once
> for a child process? If so, we should be sure to mention it in this comment.

Done.

http://codereview.chromium.org/5172009/diff/136001/chrome/browser/zygote_host...
File chrome/browser/zygote_host_linux.h (right):

http://codereview.chromium.org/5172009/diff/136001/chrome/browser/zygote_host...
chrome/browser/zygote_host_linux.h:50: kCmdFork = 0,             // Fork off a
new renderer.
On 2010/12/13 21:09:35, brettw wrote:
> Can you move these other comments over so they're aligned again?

Done.

Powered by Google App Engine
This is Rietveld 408576698