Index: third_party/mojo/src/mojo/edk/embedder/entrypoints.cc |
diff --git a/third_party/mojo/src/mojo/edk/embedder/entrypoints.cc b/third_party/mojo/src/mojo/edk/embedder/entrypoints.cc |
index 9f853b509ef1037d6d007aa6b8ee51fbf5b576b8..3d30deb466b1d8438e8ccc8b37e35313c57a35bf 100644 |
--- a/third_party/mojo/src/mojo/edk/embedder/entrypoints.cc |
+++ b/third_party/mojo/src/mojo/edk/embedder/entrypoints.cc |
@@ -5,7 +5,6 @@ |
#include "../../../../../../mojo/edk/embedder/embedder_internal.h" |
#include "../../../../../../mojo/edk/system/core.h" |
#include "base/command_line.h" |
-#include "base/lazy_instance.h" |
#include "mojo/public/c/system/buffer.h" |
#include "mojo/public/c/system/data_pipe.h" |
#include "mojo/public/c/system/functions.h" |
@@ -18,22 +17,15 @@ |
using mojo::system::MakeUserPointer; |
namespace { |
- |
-struct UseNewEDKChecker { |
- UseNewEDKChecker() { |
+bool UseNewEDK() { |
+ static bool checked = false; |
+ static bool use_new = false; |
+ if (!checked) { |
use_new = base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk"); |
+ checked = true; |
} |
- |
- bool use_new; |
-}; |
- |
-base::LazyInstance<UseNewEDKChecker> g_use_new_checker = |
- LAZY_INSTANCE_INITIALIZER; |
- |
-bool UseNewEDK() { |
- return g_use_new_checker.Get().use_new; |
-} |
- |
+ return use_new; |
+} |
} |
// Definitions of the system functions. |