Chromium Code Reviews| Index: base/process/launch_win.cc |
| diff --git a/base/process/launch_win.cc b/base/process/launch_win.cc |
| index 1349b3e4af3d101d4515e04d5ae081195e73016a..bb51a69b1b2e7b7986d87c4cac2fbc73a41930f0 100644 |
| --- a/base/process/launch_win.cc |
| +++ b/base/process/launch_win.cc |
| @@ -17,6 +17,7 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| #include "base/command_line.h" |
| +#include "base/debug/activity_tracker.h" |
| #include "base/debug/stack_trace.h" |
| #include "base/logging.h" |
| #include "base/message_loop/message_loop.h" |
| @@ -94,7 +95,12 @@ bool GetAppOutputInternal(const StringPiece16& cl, |
| NOTREACHED() << "Failed to start process"; |
| return false; |
| } |
| + |
| base::win::ScopedProcessInformation proc_info(temp_process_info); |
| + base::debug::GlobalActivityTracker* tracker = |
|
manzagop (departed)
2017/02/24 15:56:35
Use your *IfEnabled counterpart?
bcwhite
2017/03/06 16:33:52
Some of the parameters can be expensive to generat
manzagop (departed)
2017/03/07 22:08:57
Probably worth a comment.
bcwhite
2017/03/09 14:07:54
Done. (in the activity_tracker.h file)
|
| + base::debug::GlobalActivityTracker::Get(); |
| + if (tracker) |
| + tracker->RecordProcessLaunch(proc_info.process_id(), cl.as_string()); |
| // Close our writing end of pipe now. Otherwise later read would not be able |
| // to detect end of child's output. |
| @@ -119,6 +125,8 @@ bool GetAppOutputInternal(const StringPiece16& cl, |
| int exit_code; |
| base::TerminationStatus status = GetTerminationStatus( |
| proc_info.process_handle(), &exit_code); |
| + base::debug::GlobalActivityTracker::RecordProcessExitIfEnabled( |
| + proc_info.process_id(), exit_code); |
| return status != base::TERMINATION_STATUS_PROCESS_CRASHED && |
| status != base::TERMINATION_STATUS_ABNORMAL_TERMINATION; |
| } |
| @@ -317,6 +325,8 @@ Process LaunchProcess(const string16& cmdline, |
| if (options.wait) |
| WaitForSingleObject(process_info.process_handle(), INFINITE); |
| + base::debug::GlobalActivityTracker::RecordProcessLaunchIfEnabled( |
| + process_info.process_id(), cmdline); |
| return Process(process_info.TakeProcessHandle()); |
| } |
| @@ -344,6 +354,8 @@ Process LaunchElevatedProcess(const CommandLine& cmdline, |
| if (options.wait) |
| WaitForSingleObject(shex_info.hProcess, INFINITE); |
| + base::debug::GlobalActivityTracker::RecordProcessLaunchIfEnabled( |
| + GetProcessId(shex_info.hProcess), file, arguments); |
| return Process(shex_info.hProcess); |
| } |