Chromium Code Reviews| Index: base/sys_info_win.cc |
| diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc |
| index d2c7bcddc148d1693946fbb26086f676f85b1423..9f5d86d347c1b5d0aa20272af299a7338c30f340 100644 |
| --- a/base/sys_info_win.cc |
| +++ b/base/sys_info_win.cc |
| @@ -66,6 +66,21 @@ int64_t SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { |
| return rv < 0 ? std::numeric_limits<int64_t>::max() : rv; |
|
Dan Beam
2016/06/09 17:20:13
what about this logic?
fukino
2016/06/10 01:33:36
Added the logic inside GetDiskSpaceInfo to cover t
|
| } |
| +// static |
| +bool SysInfo::GetDiskSpaceInfo(const FilePath& path, |
| + int64_t* available_bytes, |
| + int64_t* total_bytes) { |
| + ThreadRestrictions::AssertIOAllowed(); |
| + |
| + ULARGE_INTEGER available, total, free; |
| + if (!GetDiskFreeSpaceExW(path.value().c_str(), &available, &total, &free)) |
| + return false; |
| + |
| + *available_bytes = static_cast<int64_t>(available.QuadPart); |
| + *total_bytes = static_cast<int64_t>(total.QuadPart); |
| + return true; |
| +} |
| + |
| std::string SysInfo::OperatingSystemName() { |
| return "Windows NT"; |
| } |