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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/sys_info_unittest.cc ('k') | net/disk_cache/backend_impl.cc » ('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) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 11 matching lines...) Expand all
22 MEMORYSTATUSEX memory_info; 22 MEMORYSTATUSEX memory_info;
23 memory_info.dwLength = sizeof(memory_info); 23 memory_info.dwLength = sizeof(memory_info);
24 if (!GlobalMemoryStatusEx(&memory_info)) { 24 if (!GlobalMemoryStatusEx(&memory_info)) {
25 NOTREACHED(); 25 NOTREACHED();
26 return 0; 26 return 0;
27 } 27 }
28 28
29 return static_cast<int64>(memory_info.ullTotalPhys); 29 return static_cast<int64>(memory_info.ullTotalPhys);
30 } 30 }
31 31
32 // static
33 int64 SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) {
34 ULARGE_INTEGER available, total, free;
35 if (!GetDiskFreeSpaceExW(path.c_str(), &available, &total, &free)) {
36 return 0;
37 }
38 return static_cast<int64>(available.QuadPart);
39 }
40
32 } // namespace base 41 } // namespace base
OLDNEW
« 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