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

Side by Side Diff: base/sys_info_win.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/sys_info_unittest.cc ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 int64 SysInfo::AmountOfPhysicalMemory() { 42 int64 SysInfo::AmountOfPhysicalMemory() {
43 return AmountOfMemory(&MEMORYSTATUSEX::ullTotalPhys); 43 return AmountOfMemory(&MEMORYSTATUSEX::ullTotalPhys);
44 } 44 }
45 45
46 // static 46 // static
47 int64 SysInfo::AmountOfAvailablePhysicalMemory() { 47 int64 SysInfo::AmountOfAvailablePhysicalMemory() {
48 return AmountOfMemory(&MEMORYSTATUSEX::ullAvailPhys); 48 return AmountOfMemory(&MEMORYSTATUSEX::ullAvailPhys);
49 } 49 }
50 50
51 // static 51 // static
52 int64 SysInfo::AmountOfVirtualMemory() {
53 return 0;
54 }
55
56 // static
52 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { 57 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
53 base::ThreadRestrictions::AssertIOAllowed(); 58 base::ThreadRestrictions::AssertIOAllowed();
54 59
55 ULARGE_INTEGER available, total, free; 60 ULARGE_INTEGER available, total, free;
56 if (!GetDiskFreeSpaceExW(path.value().c_str(), &available, &total, &free)) { 61 if (!GetDiskFreeSpaceExW(path.value().c_str(), &available, &total, &free)) {
57 return -1; 62 return -1;
58 } 63 }
59 int64 rv = static_cast<int64>(available.QuadPart); 64 int64 rv = static_cast<int64>(available.QuadPart);
60 if (rv < 0) 65 if (rv < 0)
61 rv = kint64max; 66 rv = kint64max;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, 121 void SysInfo::OperatingSystemVersionNumbers(int32* major_version,
117 int32* minor_version, 122 int32* minor_version,
118 int32* bugfix_version) { 123 int32* bugfix_version) {
119 win::OSInfo* os_info = win::OSInfo::GetInstance(); 124 win::OSInfo* os_info = win::OSInfo::GetInstance();
120 *major_version = os_info->version_number().major; 125 *major_version = os_info->version_number().major;
121 *minor_version = os_info->version_number().minor; 126 *minor_version = os_info->version_number().minor;
122 *bugfix_version = 0; 127 *bugfix_version = 0;
123 } 128 }
124 129
125 } // namespace base 130 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_unittest.cc ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698