| 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> | 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_ |
| OLD | NEW |