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

Unified Diff: content/app/content_service_manager_main_delegate.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/content_service_manager_main_delegate.h ('k') | content/app/mac/mac_init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_service_manager_main_delegate.cc
diff --git a/content/app/content_service_manager_main_delegate.cc b/content/app/content_service_manager_main_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6cd34e28c3b588b7ddbdf87be2b8fd0175ec4f99
--- /dev/null
+++ b/content/app/content_service_manager_main_delegate.cc
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/app/content_service_manager_main_delegate.h"
+
+#include "content/public/app/content_main_runner.h"
+
+namespace content {
+
+ContentServiceManagerMainDelegate::ContentServiceManagerMainDelegate(
+ const ContentMainParams& params)
+ : content_main_params_(params),
+ content_main_runner_(ContentMainRunner::Create()) {}
+
+ContentServiceManagerMainDelegate::~ContentServiceManagerMainDelegate() =
+ default;
+
+int ContentServiceManagerMainDelegate::Initialize(
+ const InitializeParams& params) {
+#if defined(OS_ANDROID)
+ // May be called twice on Android due to the way browser startup requests are
+ // dispatched by the system.
+ if (initialized_)
+ return -1;
+#endif
+
+#if defined(OS_MACOSX)
+ content_main_params_.autorelease_pool = params.autorelease_pool;
+#endif
+
+ return content_main_runner_->Initialize(content_main_params_);
+}
+
+int ContentServiceManagerMainDelegate::Run() {
+ return content_main_runner_->Run();
+}
+
+void ContentServiceManagerMainDelegate::ShutDown() {
+#if !defined(OS_ANDROID)
+ content_main_runner_->Shutdown();
+#endif
+}
+
+} // namespace content
« no previous file with comments | « content/app/content_service_manager_main_delegate.h ('k') | content/app/mac/mac_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698