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

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

Issue 218583009: Adds a way to associate key/value pairs with the environment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment 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/app/mojo/mojo_init.cc
diff --git a/content/app/mojo/mojo_init.cc b/content/app/mojo/mojo_init.cc
index 4552b66adfaf3ee6a936e0410ba743799db584a5..793d676f977a0f1c060085d45e32f0ea174f78d7 100644
--- a/content/app/mojo/mojo_init.cc
+++ b/content/app/mojo/mojo_init.cc
@@ -4,31 +4,29 @@
#include "content/app/mojo/mojo_init.h"
-#include "base/lazy_instance.h"
#include "mojo/embedder/embedder.h"
+#include "mojo/public/cpp/environment/environment.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;
+mojo::Environment* environment = NULL;
} // namespace
-// Initializes mojo. Use a lazy instance to ensure we only do this once.
void InitializeMojo() {
- initializer.Get();
+ DCHECK(!environment);
+ environment = new mojo::Environment;
+ // instance of the ServiceManager.
darin (slow to review) 2014/03/31 23:21:55 nit: "instance of" -> "Instantiate" ?
sky 2014/03/31 23:54:40 This was part of a comment on 18 (old). Makes no s
+ mojo::ServiceManager::GetInstance();
+ mojo::embedder::Init();
darin (slow to review) 2014/03/31 23:21:55 Maybe we should initialize mojo core before initia
sky 2014/03/31 23:54:40 I copied this code. Dave says order shouldn't matt
+}
+
+void ShutdownMojo() {
+ delete environment;
darin (slow to review) 2014/03/31 23:21:55 it is not clear why there is a benefit to storing
+ environment = NULL;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698