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

Unified Diff: base/sys_info.h

Issue 227113011: Expose the virtual memory limit to blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 8 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 | « no previous file | 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.h
diff --git a/base/sys_info.h b/base/sys_info.h
index aa40cadfbc93791dc57b9513554bea33d4b05c3b..7ce4e659f28b989e1151dddc3cf431923768539e 100644
--- a/base/sys_info.h
+++ b/base/sys_info.h
@@ -28,11 +28,22 @@ class BASE_EXPORT SysInfo {
// machine.
static int64 AmountOfAvailablePhysicalMemory();
+ // Return the number of bytes of virtual memory of this process. A return
+ // value of zero means that there is no limit on the available virtual
+ // memory.
+ static int64 AmountOfVirtualMemory();
+
// Return the number of megabytes of physical memory on the current machine.
static int AmountOfPhysicalMemoryMB() {
return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024);
}
+ // Return the number of megabytes of available virtual memory, or zero if it
+ // is unlimited.
+ static int AmountOfVirtualMemoryMB() {
+ return static_cast<int>(AmountOfVirtualMemory() / 1024 / 1024);
+ }
+
// Return the available disk space in bytes on the volume containing |path|,
// or -1 on failure.
static int64 AmountOfFreeDiskSpace(const FilePath& path);
« no previous file with comments | « no previous file | base/sys_info_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698