| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // This file contains routines for gathering resource statistics for processes | 5 // This file contains routines for gathering resource statistics for processes |
| 6 // running on the system. | 6 // running on the system. |
| 7 | 7 |
| 8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ | 8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ |
| 9 #define BASE_PROCESS_PROCESS_METRICS_H_ | 9 #define BASE_PROCESS_PROCESS_METRICS_H_ |
| 10 | 10 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 struct BASE_EXPORT SystemMemoryInfoKB { | 265 struct BASE_EXPORT SystemMemoryInfoKB { |
| 266 SystemMemoryInfoKB(); | 266 SystemMemoryInfoKB(); |
| 267 SystemMemoryInfoKB(const SystemMemoryInfoKB& other); | 267 SystemMemoryInfoKB(const SystemMemoryInfoKB& other); |
| 268 | 268 |
| 269 // Serializes the platform specific fields to value. | 269 // Serializes the platform specific fields to value. |
| 270 std::unique_ptr<Value> ToValue() const; | 270 std::unique_ptr<Value> ToValue() const; |
| 271 | 271 |
| 272 int total; | 272 int total; |
| 273 int free; | 273 int free; |
| 274 | 274 |
| 275 #if defined(OS_LINUX) |
| 276 // This provides an estimate of available memory as described here: |
| 277 // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=
34e431b0ae398fc54ea69ff85ec700722c9da773 |
| 278 // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always |
| 279 // be 0 in earlier kernel versions. |
| 280 int available; |
| 281 #endif |
| 282 |
| 275 #if !defined(OS_MACOSX) | 283 #if !defined(OS_MACOSX) |
| 276 int swap_total; | 284 int swap_total; |
| 277 int swap_free; | 285 int swap_free; |
| 278 #endif | 286 #endif |
| 279 | 287 |
| 280 #if defined(OS_ANDROID) || defined(OS_LINUX) | 288 #if defined(OS_ANDROID) || defined(OS_LINUX) |
| 281 int buffers; | 289 int buffers; |
| 282 int cached; | 290 int cached; |
| 283 int active_anon; | 291 int active_anon; |
| 284 int inactive_anon; | 292 int inactive_anon; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 SystemDiskInfo disk_info_; | 423 SystemDiskInfo disk_info_; |
| 416 #endif | 424 #endif |
| 417 #if defined(OS_CHROMEOS) | 425 #if defined(OS_CHROMEOS) |
| 418 SwapInfo swap_info_; | 426 SwapInfo swap_info_; |
| 419 #endif | 427 #endif |
| 420 }; | 428 }; |
| 421 | 429 |
| 422 } // namespace base | 430 } // namespace base |
| 423 | 431 |
| 424 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 432 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
| OLD | NEW |