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..0532e3e431e61692a06d6a35a3d7ac3474709ca5 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 "base/logging.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; |
+ mojo::embedder::Init(); |
+ mojo::ServiceManager::GetInstance(); |
+} |
+ |
+void ShutdownMojo() { |
+ delete environment; |
+ environment = NULL; |
} |
} // namespace content |