OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |