Chromium Code Reviews| Index: content/public/browser/render_process_host.h |
| =================================================================== |
| --- content/public/browser/render_process_host.h (revision 127735) |
| +++ content/public/browser/render_process_host.h (working copy) |
| @@ -49,6 +49,34 @@ |
| this->exit_code = exit_code; |
| this->was_alive = was_alive; |
| } |
| + |
| +#if defined(OS_WIN) |
| + void RecordProcessStats() { |
| + have_process_times = false; |
| + FILETIME win_creation_time; |
| + FILETIME win_exit_time; |
| + FILETIME win_kernel_time; |
| + FILETIME win_user_time; |
| + if (0 == GetProcessTimes(handle, &win_creation_time, &win_exit_time, |
| + &win_kernel_time, &win_user_time)) { |
| + DWORD error = GetLastError(); |
| + DLOG(ERROR) << "Error getting process data" << error; |
| + } |
| + user_duration = base::Time::FromFileTime(win_user_time) - |
| + base::Time::Time(); |
| + kernel_duration = base::Time::FromFileTime(win_kernel_time) - |
| + base::Time::Time(); |
| + run_duration = base::Time::FromFileTime(win_exit_time) - |
| + base::Time::FromFileTime(win_creation_time); |
| + have_process_times = true; |
|
rvargas (doing something else)
2012/03/22 01:59:32
We should not set this flag to true (or read the t
jar (doing other things)
2012/03/22 02:06:44
<doh!> I left out my planned early return.
Added
|
| + } |
| + |
| + base::TimeDelta kernel_duration; |
| + base::TimeDelta user_duration; |
| + base::TimeDelta run_duration; |
| + bool have_process_times; |
| +#endif // OS_WIN |
| + |
| base::ProcessHandle handle; |
| base::TerminationStatus status; |
| int exit_code; |