| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 24 // Return the number of megabytes of physical memory on the current machine. | 24 // Return the number of megabytes of physical memory on the current machine. |
| 25 static int AmountOfPhysicalMemoryMB() { | 25 static int AmountOfPhysicalMemoryMB() { |
| 26 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); | 26 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Return the available disk space in bytes on the volume containing |path|, | 29 // Return the available disk space in bytes on the volume containing |path|, |
| 30 // or -1 on failure. | 30 // or -1 on failure. |
| 31 static int64 AmountOfFreeDiskSpace(const FilePath& path); | 31 static int64 AmountOfFreeDiskSpace(const FilePath& path); |
| 32 | 32 |
| 33 // Return true if the given environment variable is defined. | 33 // Return true if the given environment variable is defined. |
| 34 // TODO: find a better place for HasEnvVar. | 34 // DEPRECATED in favor of EnvVarGetter in base/env_var.h. |
| 35 static bool HasEnvVar(const wchar_t* var); | 35 static bool HasEnvVar(const wchar_t* var); |
| 36 | 36 |
| 37 // Return the value of the given environment variable | 37 // Return the value of the given environment variable |
| 38 // or an empty string if not defined. | 38 // or an empty string if not defined. |
| 39 // TODO: find a better place for GetEnvVar. | 39 // DEPRECATED in favor of EnvVarGetter in base/env_var.h. |
| 40 static std::wstring GetEnvVar(const wchar_t* var); | 40 static std::wstring GetEnvVar(const wchar_t* var); |
| 41 | 41 |
| 42 // Returns the name of the host operating system. | 42 // Returns the name of the host operating system. |
| 43 static std::string OperatingSystemName(); | 43 static std::string OperatingSystemName(); |
| 44 | 44 |
| 45 // Returns the version of the host operating system. | 45 // Returns the version of the host operating system. |
| 46 static std::string OperatingSystemVersion(); | 46 static std::string OperatingSystemVersion(); |
| 47 | 47 |
| 48 // Retrieves detailed numeric values for the OS version. | 48 // Retrieves detailed numeric values for the OS version. |
| 49 // TODO(port): Implement a Linux version of this method and enable the | 49 // TODO(port): Implement a Linux version of this method and enable the |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 static void ParseLsbRelease(const std::string& lsb_release, | 82 static void ParseLsbRelease(const std::string& lsb_release, |
| 83 int32 *major_version, | 83 int32 *major_version, |
| 84 int32 *minor_version, | 84 int32 *minor_version, |
| 85 int32 *bugfix_version); | 85 int32 *bugfix_version); |
| 86 #endif | 86 #endif |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace base | 89 } // namespace base |
| 90 | 90 |
| 91 #endif // BASE_SYS_INFO_H_ | 91 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |