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

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

Issue 187183002: Add creation of ServiceManager to Content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check USE_MOJO for Windows bots 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
Index: content/common/mojo/mojo_init.cc
diff --git a/content/common/mojo/mojo_init.cc b/content/common/mojo/mojo_init.cc
new file mode 100644
index 0000000000000000000000000000000000000000..491fce60b9cee1b4a2a0fb8782f1ed3e95094e89
--- /dev/null
+++ b/content/common/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/common/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

Powered by Google App Engine
This is Rietveld 408576698