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

Unified Diff: base/sys_info_linux.cc

Issue 67373006: Cache the numberOfProcessors value on posix and expose it to blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « base/sys_info_internal.h ('k') | base/sys_info_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_linux.cc
diff --git a/base/sys_info_linux.cc b/base/sys_info_linux.cc
index d7c9f1032ff5470100f81ce350e34bc69b0396ce..6f1e5eb7d1fea35ad3fd795b42592467396fde8f 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -10,6 +10,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
+#include "base/sys_info_internal.h"
namespace {
@@ -47,25 +48,11 @@ size_t MaxSharedMemorySize() {
return static_cast<size_t>(limit);
}
-template<typename T, T (*F)(void)>
-class LazySysInfoValue {
- public:
- LazySysInfoValue()
- : value_(F()) { }
-
- ~LazySysInfoValue() { }
-
- T value() { return value_; }
-
- private:
- const T value_;
-
- DISALLOW_COPY_AND_ASSIGN(LazySysInfoValue);
-};
-
-base::LazyInstance<LazySysInfoValue<int64, AmountOfPhysicalMemory> >::Leaky
+base::LazyInstance<
+ base::internal::LazySysInfoValue<int64, AmountOfPhysicalMemory> >::Leaky
g_lazy_physical_memory = LAZY_INSTANCE_INITIALIZER;
-base::LazyInstance<LazySysInfoValue<size_t, MaxSharedMemorySize> >::Leaky
+base::LazyInstance<
+ base::internal::LazySysInfoValue<size_t, MaxSharedMemorySize> >::Leaky
g_lazy_max_shared_memory = LAZY_INSTANCE_INITIALIZER;
} // namespace
« no previous file with comments | « base/sys_info_internal.h ('k') | base/sys_info_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698