diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 12:18:14 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 12:18:14 +0000 |
commit | fadf97f2f16f6b3ad2756cd07657c4f47172da92 (patch) | |
tree | ba24cf444ef2696e32639d51ef30e9f0d96df330 /chrome/browser | |
parent | 1918c4e12cea21c56d5d9e07f3759de6ad9e3dd3 (diff) | |
download | chromium_src-fadf97f2f16f6b3ad2756cd07657c4f47172da92.zip chromium_src-fadf97f2f16f6b3ad2756cd07657c4f47172da92.tar.gz chromium_src-fadf97f2f16f6b3ad2756cd07657c4f47172da92.tar.bz2 |
Add cross platform base::SysInfo::AmountOfPhysicalMemoryMB to replace the Windows only env_util::GetPhysicalMemoryMB.
From Seo Sanghyeon.
Review URL: http://codereview.chromium.org/2962
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cache_manager_host.cc | 3 | ||||
-rw-r--r-- | chrome/browser/metrics_log.cc | 3 | ||||
-rw-r--r-- | chrome/browser/render_process_host.cc | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/cache_manager_host.cc b/chrome/browser/cache_manager_host.cc index 0e329d3..13fc171 100644 --- a/chrome/browser/cache_manager_host.cc +++ b/chrome/browser/cache_manager_host.cc @@ -6,6 +6,7 @@ #include "chrome/browser/cache_manager_host.h" +#include "base/sys_info.h" #include "base/time.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/render_process_host.h" @@ -31,7 +32,7 @@ int GetDefaultCacheSize() { int default_cache_size = kDefaultMemoryCacheSize; // Check how much physical memory the OS has - int mem_size_mb = env_util::GetPhysicalMemoryMB(); + int mem_size_mb = base::SysInfo::AmountOfPhysicalMemoryMB(); if (mem_size_mb >= 1000) // If we have a GB of memory, set a larger default. default_cache_size *= 4; else if (mem_size_mb >= 512) // With 512 MB, set a slightly larger default. diff --git a/chrome/browser/metrics_log.cc b/chrome/browser/metrics_log.cc index d72e1ae..8144940 100644 --- a/chrome/browser/metrics_log.cc +++ b/chrome/browser/metrics_log.cc @@ -9,6 +9,7 @@ #include "base/md5.h" #include "base/scoped_ptr.h" #include "base/string_util.h" +#include "base/sys_info.h" #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/browser_process.h" #include "chrome/common/env_util.h" @@ -462,7 +463,7 @@ void MetricsLog::RecordEnvironment( { OPEN_ELEMENT_FOR_SCOPE("memory"); - WriteIntAttribute("mb", env_util::GetPhysicalMemoryMB()); + WriteIntAttribute("mb", base::SysInfo:AmountOfPhysicalMemoryMB()); } { diff --git a/chrome/browser/render_process_host.cc b/chrome/browser/render_process_host.cc index 90ff2aa..dfa5755 100644 --- a/chrome/browser/render_process_host.cc +++ b/chrome/browser/render_process_host.cc @@ -22,6 +22,7 @@ #include "base/shared_event.h" #include "base/shared_memory.h" #include "base/string_util.h" +#include "base/sys_info.h" #include "base/thread.h" #include "base/win_util.h" #include "chrome/app/result_codes.h" @@ -74,7 +75,7 @@ unsigned int GetMaxRendererProcessCount() { static unsigned int max_count = 0; if (!max_count) { - int memory_tier = env_util::GetPhysicalMemoryMB() / 256; + int memory_tier = base::SysInfo::AmountOfPhysicalMemoryMB() / 256; if (memory_tier >= arraysize(kMaxRenderersByRamTier)) max_count = chrome::kMaxRendererProcessCount; else |