| OLD | NEW |
| 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> |
| 11 |
| 10 namespace base { | 12 namespace base { |
| 11 | 13 |
| 12 class SysInfo { | 14 class SysInfo { |
| 13 public: | 15 public: |
| 14 // Return the number of logical processors/cores on the current machine. | 16 // Return the number of logical processors/cores on the current machine. |
| 15 static int NumberOfProcessors(); | 17 static int NumberOfProcessors(); |
| 16 | 18 |
| 17 // 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. |
| 18 static int64 AmountOfPhysicalMemory(); | 20 static int64 AmountOfPhysicalMemory(); |
| 19 | 21 |
| 20 // 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. |
| 21 static int AmountOfPhysicalMemoryMB() { | 23 static int AmountOfPhysicalMemoryMB() { |
| 22 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); | 24 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); |
| 23 } | 25 } |
| 26 |
| 27 // Return the available disk space in bytes on the volume containing |path|. |
| 28 static int64 AmountOfFreeDiskSpace(const std::wstring& path); |
| 29 |
| 24 }; | 30 }; |
| 25 | 31 |
| 26 } // namespace base | 32 } // namespace base |
| 27 | 33 |
| 28 #endif // BASE_SYS_INFO_H_ | 34 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |