Index: shell/context.cc |
diff --git a/shell/context.cc b/shell/context.cc |
index 8569a1a98a43e558c2b1bd4bebc922f13932207e..703d428b333624f40b073872dee82ea3e78dc797 100644 |
--- a/shell/context.cc |
+++ b/shell/context.cc |
@@ -11,7 +11,6 @@ |
#include "base/command_line.h" |
#include "base/files/file_path.h" |
#include "base/files/file_util.h" |
-#include "base/lazy_instance.h" |
#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/scoped_vector.h" |
@@ -53,19 +52,6 @@ using mojo::ServiceProviderPtr; |
namespace shell { |
namespace { |
-// Used to ensure we only init once. |
-class Setup { |
- public: |
- Setup() { |
- mojo::embedder::Init(mojo::embedder::CreateSimplePlatformSupport()); |
- } |
- |
- ~Setup() {} |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(Setup); |
-}; |
- |
ApplicationManager::Options MakeApplicationManagerOptions() { |
ApplicationManager::Options options; |
options.disable_cache = base::CommandLine::ForCurrentProcess()->HasSwitch( |
@@ -253,8 +239,11 @@ Context::~Context() { |
// static |
void Context::EnsureEmbedderIsInitialized() { |
- static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER; |
- setup.Get(); |
+ static bool initialized = ([]() { |
+ mojo::embedder::Init(mojo::embedder::CreateSimplePlatformSupport()); |
+ return true; |
+ })(); |
+ std::ignore = initialized; |
jamesr
2016/02/10 21:28:39
arguably this is too fancy, especially since it co
viettrungluu
2016/02/10 23:55:50
Should probably use MOJO_ALLOW_UNUSED_LOCAL from m
|
} |
void Context::SetShellFileRoot(const base::FilePath& path) { |