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

Side by Side Diff: base/sys_info.h

Issue 4003: Fix AmountOfFreeDiskSpace to be able to differentiate an error... (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 | « no previous file | base/sys_info_posix.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 #ifndef BASE_SYS_INFO_H_ 5 #ifndef BASE_SYS_INFO_H_
6 #define BASE_SYS_INFO_H_ 6 #define BASE_SYS_INFO_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 #include <string> 10 #include <string>
11 11
12 namespace base { 12 namespace base {
13 13
14 class SysInfo { 14 class SysInfo {
15 public: 15 public:
16 // Return the number of logical processors/cores on the current machine. 16 // Return the number of logical processors/cores on the current machine.
17 static int NumberOfProcessors(); 17 static int NumberOfProcessors();
18 18
19 // Return the number of bytes of physical memory on the current machine. 19 // Return the number of bytes of physical memory on the current machine.
20 static int64 AmountOfPhysicalMemory(); 20 static int64 AmountOfPhysicalMemory();
21 21
22 // Return the number of megabytes of physical memory on the current machine. 22 // Return the number of megabytes of physical memory on the current machine.
23 static int AmountOfPhysicalMemoryMB() { 23 static int AmountOfPhysicalMemoryMB() {
24 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); 24 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024);
25 } 25 }
26 26
27 // Return the available disk space in bytes on the volume containing |path|. 27 // Return the available disk space in bytes on the volume containing |path|,
28 // or -1 on failure.
28 static int64 AmountOfFreeDiskSpace(const std::wstring& path); 29 static int64 AmountOfFreeDiskSpace(const std::wstring& path);
29 30
30 }; 31 };
31 32
32 } // namespace base 33 } // namespace base
33 34
34 #endif // BASE_SYS_INFO_H_ 35 #endif // BASE_SYS_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | base/sys_info_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698