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

Unified Diff: content/app/content_main.cc

Issue 2680123003: Multi-Process Tracking Support (Closed)
Patch Set: move tracking from target_process to sandbox_win Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_win.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main.cc
diff --git a/content/app/content_main.cc b/content/app/content_main.cc
index b983bf8191d9d1e59e27d2a9250569d8fc793751..c5086ad4f2b0d04ff4a5650268b07205d1084df1 100644
--- a/content/app/content_main.cc
+++ b/content/app/content_main.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/debug/activity_tracker.h"
#include "content/public/app/content_main_runner.h"
namespace content {
@@ -14,13 +15,34 @@ int ContentMain(const ContentMainParams& params) {
std::unique_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create());
int exit_code = main_runner->Initialize(params);
- if (exit_code >= 0)
+ if (exit_code >= 0) {
+ base::debug::GlobalActivityTracker* tracker =
+ base::debug::GlobalActivityTracker::Get();
+ if (tracker) {
+ tracker->SetProcessPhase(
+ base::debug::GlobalActivityTracker::PROCESS_LAUNCH_FAILED);
+ tracker->process_data().SetInt("exit-code", exit_code);
+ }
return exit_code;
+ }
exit_code = main_runner->Run();
main_runner->Shutdown();
+ base::debug::GlobalActivityTracker* tracker =
+ base::debug::GlobalActivityTracker::Get();
+ if (tracker) {
+ if (exit_code == 0) {
+ tracker->SetProcessPhaseIfEnabled(
+ base::debug::GlobalActivityTracker::PROCESS_EXITED_CLEANLY);
+ } else {
+ tracker->SetProcessPhaseIfEnabled(
+ base::debug::GlobalActivityTracker::PROCESS_EXITED_WITH_CODE);
+ tracker->process_data().SetInt("exit-code", exit_code);
+ }
+ }
+
return exit_code;
}
« no previous file with comments | « base/process/process_win.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698