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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « base/process/process_win.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/app/content_main.h" 5 #include "content/public/app/content_main.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/debug/activity_tracker.h"
9 #include "content/public/app/content_main_runner.h" 10 #include "content/public/app/content_main_runner.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 int ContentMain(const ContentMainParams& params) { 14 int ContentMain(const ContentMainParams& params) {
14 std::unique_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create()); 15 std::unique_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create());
15 16
16 int exit_code = main_runner->Initialize(params); 17 int exit_code = main_runner->Initialize(params);
17 if (exit_code >= 0) 18 if (exit_code >= 0) {
19 base::debug::GlobalActivityTracker* tracker =
20 base::debug::GlobalActivityTracker::Get();
21 if (tracker) {
22 tracker->SetProcessPhase(
23 base::debug::GlobalActivityTracker::PROCESS_LAUNCH_FAILED);
24 tracker->process_data().SetInt("exit-code", exit_code);
25 }
18 return exit_code; 26 return exit_code;
27 }
19 28
20 exit_code = main_runner->Run(); 29 exit_code = main_runner->Run();
21 30
22 main_runner->Shutdown(); 31 main_runner->Shutdown();
23 32
33 base::debug::GlobalActivityTracker* tracker =
34 base::debug::GlobalActivityTracker::Get();
35 if (tracker) {
36 if (exit_code == 0) {
37 tracker->SetProcessPhaseIfEnabled(
38 base::debug::GlobalActivityTracker::PROCESS_EXITED_CLEANLY);
39 } else {
40 tracker->SetProcessPhaseIfEnabled(
41 base::debug::GlobalActivityTracker::PROCESS_EXITED_WITH_CODE);
42 tracker->process_data().SetInt("exit-code", exit_code);
43 }
44 }
45
24 return exit_code; 46 return exit_code;
25 } 47 }
26 48
27 } // namespace content 49 } // namespace content
OLDNEW
« 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