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

Unified Diff: content/app/content_main.cc

Issue 2613653003: Move some basic early process init into Service Manager (Closed)
Patch Set: fix mac shutdown order 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 | « content/app/android/content_main.cc ('k') | content/app/content_main_runner.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 c5086ad4f2b0d04ff4a5650268b07205d1084df1..657761cb5dc582fe1f19c6dbb509604da0ff6ce3 100644
--- a/content/app/content_main.cc
+++ b/content/app/content_main.cc
@@ -4,46 +4,19 @@
#include "content/public/app/content_main.h"
-#include <memory>
-
-#include "base/debug/activity_tracker.h"
-#include "content/public/app/content_main_runner.h"
+#include "content/app/content_service_manager_main_delegate.h"
+#include "services/service_manager/embedder/main.h"
namespace content {
int ContentMain(const ContentMainParams& params) {
- std::unique_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create());
-
- int exit_code = main_runner->Initialize(params);
- 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;
+ ContentServiceManagerMainDelegate delegate(params);
+ service_manager::MainParams main_params(&delegate);
+#if defined(OS_POSIX) && !defined(OS_ANDROID)
+ main_params.argc = params.argc;
+ main_params.argv = params.argv;
+#endif
+ return service_manager::Main(main_params);
}
} // namespace content
« no previous file with comments | « content/app/android/content_main.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698