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

Unified Diff: base/sys_info_win.cc

Issue 3141: Move GetFreeDiskSpace to SysInfo. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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 | « base/sys_info_unittest.cc ('k') | net/disk_cache/backend_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_win.cc
===================================================================
--- base/sys_info_win.cc (revision 2357)
+++ base/sys_info_win.cc (working copy)
@@ -29,4 +29,13 @@
return static_cast<int64>(memory_info.ullTotalPhys);
}
+// static
+int64 SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) {
+ ULARGE_INTEGER available, total, free;
+ if (!GetDiskFreeSpaceExW(path.c_str(), &available, &total, &free)) {
+ return 0;
+ }
+ return static_cast<int64>(available.QuadPart);
+}
+
} // namespace base
« no previous file with comments | « base/sys_info_unittest.cc ('k') | net/disk_cache/backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698