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

Unified Diff: chrome/browser/ui/webui/about_ui.cc

Issue 2558043007: Fix free memory calculation. (Closed)
Patch Set: Fix integer overflow in unittest. Created 3 years, 9 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 | « base/sys_info_win.cc ('k') | components/memory_pressure/direct_memory_pressure_calculator_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/about_ui.cc
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index e2389f1f92f5ff01ef5472d60f684bc024bdb4fa..707b769f24754f5d230f911f11777e942bb86c03 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -30,6 +30,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/sys_info.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread.h"
#include "base/values.h"
@@ -552,7 +553,9 @@ std::string AboutDiscards(const std::string& path) {
output.append(AddStringRow(
"Total", base::IntToString(meminfo.total / 1024)));
output.append(AddStringRow(
- "Free", base::IntToString(meminfo.free / 1024)));
+ "Free",
+ base::IntToString(base::SysInfo::AmountOfAvailablePhysicalMemory() /
+ 1024 / 1024)));
#if defined(OS_CHROMEOS)
int mem_allocated_kb = meminfo.active_anon + meminfo.inactive_anon;
#if defined(ARCH_CPU_ARM_FAMILY)
« no previous file with comments | « base/sys_info_win.cc ('k') | components/memory_pressure/direct_memory_pressure_calculator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698