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

Unified Diff: base/cpu.cc

Issue 2667513003: Remove some LazyInstance use in base/ (Closed)
Patch Set: . Created 3 years, 11 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
« no previous file with comments | « no previous file | base/debug/close_handle_hook_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/cpu.cc
diff --git a/base/cpu.cc b/base/cpu.cc
index 25328167425d4c0a242e0bfccaa47845737e81f9..8e2a621ff1f300fc2bf8691c3670410cfc0329c4 100644
--- a/base/cpu.cc
+++ b/base/cpu.cc
@@ -16,7 +16,6 @@
#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
#include "base/files/file_util.h"
-#include "base/lazy_instance.h"
#endif
#if defined(ARCH_CPU_X86_FAMILY)
@@ -130,9 +129,6 @@ class LazyCpuInfoValue {
DISALLOW_COPY_AND_ASSIGN(LazyCpuInfoValue);
};
-base::LazyInstance<LazyCpuInfoValue>::Leaky g_lazy_cpuinfo =
- LAZY_INSTANCE_INITIALIZER;
-
#endif // defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) ||
// defined(OS_LINUX))
@@ -221,7 +217,8 @@ void CPU::Initialize() {
has_non_stop_time_stamp_counter_ = (cpu_info[3] & (1 << 8)) != 0;
}
#elif defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
- cpu_brand_.assign(g_lazy_cpuinfo.Get().brand());
+ static auto lazy_cpuinfo = new LazyCpuInfoValue();
Mark Mentovai 2017/01/31 00:52:09 I don’t know how much digging you want to do at ea
+ cpu_brand_.assign(lazy_cpuinfo->brand());
#endif
}
« no previous file with comments | « no previous file | base/debug/close_handle_hook_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698