diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 02:01:51 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 02:01:51 +0000 |
commit | 59658423f8a374ac79bd8abb122c87ee8c9b8685 (patch) | |
tree | 56cf53acd0e91bf33a9e1f7b2cf67e7a5af82f64 /base/sys_info.h | |
parent | e5a3ea33e830593b16f140429896940be276f1ca (diff) | |
download | chromium_src-59658423f8a374ac79bd8abb122c87ee8c9b8685.zip chromium_src-59658423f8a374ac79bd8abb122c87ee8c9b8685.tar.gz chromium_src-59658423f8a374ac79bd8abb122c87ee8c9b8685.tar.bz2 |
Under the OS X Sandbox, some system calls are blocked.
This CL adds a facility to cache system info values on renderer startup.
Review URL: http://codereview.chromium.org/20250
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info.h')
-rw-r--r-- | base/sys_info.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/base/sys_info.h b/base/sys_info.h index 46029cc..35d371b 100644 --- a/base/sys_info.h +++ b/base/sys_info.h @@ -15,7 +15,7 @@ class SysInfo { public: // Return the number of logical processors/cores on the current machine. static int NumberOfProcessors(); - + // Return the number of bytes of physical memory on the current machine. static int64 AmountOfPhysicalMemory(); @@ -57,6 +57,14 @@ class SysInfo { // Return the smallest amount of memory (in bytes) which the VM system will // allocate. static size_t VMAllocationGranularity(); + +#if defined(OS_MACOSX) + // Under the OS X Sandbox, our access to the system is limited, this call + // caches the system info on startup before we turn the Sandbox on. + // The above functions are all wired up to return the cached value so the rest + // of the code can call them in the Sandbox without worrying. + static void CacheSysInfo(); +#endif }; } // namespace base |