Commit 5f7eb14a authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Don't ignore GetProcessTimes failures

ProcessMetrics silently ignores failures in GetProcessTimes because of
concerns about race conditions, but since ProcessMetrics *owns* a
duplicated process handle such concerns are not valid. If they were then
we could get occasional handle errors when debugging or using
Application Verifier which is unacceptable any. So, adding a DCHECK.

Change-Id: I97475f4223ab71be87ae9025d3f8a00fe2363ff0
Bug: 890051
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1601540Reviewed-by: default avatarDavid Bienvenu <davidbienvenu@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658393}
parent be9198d1
...@@ -143,9 +143,9 @@ TimeDelta ProcessMetrics::GetCumulativeCPUUsage() { ...@@ -143,9 +143,9 @@ TimeDelta ProcessMetrics::GetCumulativeCPUUsage() {
if (!GetProcessTimes(process_.Get(), &creation_time, &exit_time, &kernel_time, if (!GetProcessTimes(process_.Get(), &creation_time, &exit_time, &kernel_time,
&user_time)) { &user_time)) {
// We don't assert here because in some cases (such as in the Task Manager) // This should never fail because we duplicate the handle to guarantee it
// we may call this function on a process that has just exited but we have // will remain valid.
// not yet received the notification. DCHECK(false);
return TimeDelta(); return TimeDelta();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment