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

Unified Diff: base/sys_info_linux.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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
Index: base/sys_info_linux.cc
diff --git a/base/sys_info_linux.cc b/base/sys_info_linux.cc
index 401d55ce1b24bcb2a5fa741deaf8a78e4852ca6f..1bbfe9c604e0f422efe4e990e8fab8d69f2df84b 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -9,6 +9,7 @@
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/sys_info_internal.h"
@@ -28,7 +29,7 @@ int64 AmountOfPhysicalMemory() {
return AmountOfMemory(_SC_PHYS_PAGES);
}
-size_t MaxSharedMemorySize() {
+uint64 MaxSharedMemorySize() {
std::string contents;
base::ReadFileToString(base::FilePath("/proc/sys/kernel/shmmax"), &contents);
DCHECK(!contents.empty());
@@ -40,18 +41,15 @@ size_t MaxSharedMemorySize() {
if (!base::StringToUint64(contents, &limit)) {
limit = 0;
}
- if (limit > std::numeric_limits<size_t>::max()) {
- limit = 0;
- }
DCHECK_GT(limit, 0u);
- return static_cast<size_t>(limit);
+ return limit;
}
base::LazyInstance<
base::internal::LazySysInfoValue<int64, AmountOfPhysicalMemory> >::Leaky
g_lazy_physical_memory = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<
- base::internal::LazySysInfoValue<size_t, MaxSharedMemorySize> >::Leaky
+ base::internal::LazySysInfoValue<uint64, MaxSharedMemorySize> >::Leaky
g_lazy_max_shared_memory = LAZY_INSTANCE_INITIALIZER;
} // namespace
@@ -68,15 +66,8 @@ int64 SysInfo::AmountOfPhysicalMemory() {
return g_lazy_physical_memory.Get().value();
}
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) {
- // TODO(dbeam): implement.
- return false;
-}
-#endif
-
// static
-size_t SysInfo::MaxSharedMemorySize() {
+uint64 SysInfo::MaxSharedMemorySize() {
return g_lazy_max_shared_memory.Get().value();
}
« no previous file with comments | « base/sys_info_ios.mm ('k') | base/sys_info_mac.cc » ('j') | mojo/public/tools/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698