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

Unified Diff: content/app/android/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/child_process_service_impl.cc ('k') | content/app/content_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/android/content_main.cc
diff --git a/content/app/android/content_main.cc b/content/app/android/content_main.cc
index d6a1eecff0cfaf7bc6f63827418ef58066107954..f974e716671ea3edf656a47f6b7887ece830bcb4 100644
--- a/content/app/android/content_main.cc
+++ b/content/app/android/content_main.cc
@@ -6,16 +6,14 @@
#include <memory>
-#include "base/at_exit.h"
-#include "base/base_switches.h"
-#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
+#include "content/app/content_service_manager_main_delegate.h"
#include "content/public/app/content_main.h"
#include "content/public/app/content_main_delegate.h"
-#include "content/public/app/content_main_runner.h"
-#include "content/public/common/content_switches.h"
#include "jni/ContentMain_jni.h"
+#include "services/service_manager/embedder/main.h"
using base::LazyInstance;
using base::android::JavaParamRef;
@@ -23,8 +21,9 @@ using base::android::JavaParamRef;
namespace content {
namespace {
-LazyInstance<std::unique_ptr<ContentMainRunner>>::DestructorAtExit
- g_content_runner = LAZY_INSTANCE_INITIALIZER;
+
+LazyInstance<std::unique_ptr<service_manager::MainDelegate>>::DestructorAtExit
+ g_service_manager_main_delegate = LAZY_INSTANCE_INITIALIZER;
LazyInstance<std::unique_ptr<ContentMainDelegate>>::DestructorAtExit
g_content_main_delegate = LAZY_INSTANCE_INITIALIZER;
@@ -38,12 +37,15 @@ static jint Start(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
// simultaneously. If we get an asynchonous request followed by a synchronous
// request then we have to call this a second time to finish starting the
// browser synchronously.
- if (!g_content_runner.Get().get()) {
- ContentMainParams params(g_content_main_delegate.Get().get());
- g_content_runner.Get().reset(ContentMainRunner::Create());
- g_content_runner.Get()->Initialize(params);
+ if (!g_service_manager_main_delegate.Get()) {
+ g_service_manager_main_delegate.Get() =
+ base::MakeUnique<ContentServiceManagerMainDelegate>(
+ ContentMainParams(g_content_main_delegate.Get().get()));
}
- return g_content_runner.Get()->Run();
+
+ service_manager::MainParams main_params(
+ g_service_manager_main_delegate.Get().get());
+ return service_manager::Main(main_params);
}
void SetContentMainDelegate(ContentMainDelegate* delegate) {
« no previous file with comments | « content/app/android/child_process_service_impl.cc ('k') | content/app/content_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698