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

Unified Diff: content/app/mojo/mojo_init.cc

Issue 187183002: Add creation of ServiceManager to Content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge problem Created 6 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/mojo/mojo_init.h ('k') | content/common/mojo/mojo_channel_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/mojo/mojo_init.cc
diff --git a/content/app/mojo/mojo_init.cc b/content/app/mojo/mojo_init.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c34917fed798476fe6ea04d10211d0365bc10c24
--- /dev/null
+++ b/content/app/mojo/mojo_init.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2014 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/mojo/mojo_init.h"
+
+#include "base/lazy_instance.h"
+#include "mojo/embedder/embedder.h"
+#include "mojo/service_manager/service_manager.h"
+
+namespace content {
+
+namespace {
+
+struct Initializer {
+ Initializer() {
+ // TODO(davemoore): Configuration goes here. For now just create the shared
+ // instance of the ServiceManager.
+ mojo::ServiceManager::GetInstance();
+ mojo::embedder::Init();
+ }
+};
+
+static base::LazyInstance<Initializer>::Leaky initializer =
+ LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
+// Initializes mojo. Use a lazy instance to ensure we only do this once.
+void InitializeMojo() {
+ initializer.Get();
+}
+
+} // namespace content
« no previous file with comments | « content/app/mojo/mojo_init.h ('k') | content/common/mojo/mojo_channel_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698