OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ios/chrome/browser/memory/memory_metrics.h" | 5 #include "ios/chrome/browser/memory/memory_metrics.h" |
6 | 6 |
7 #include <mach/mach.h> | 7 #include <mach/mach.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/mac/scoped_mach_port.h" | 12 #include "base/mac/scoped_mach_port.h" |
| 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/process/process_handle.h" | 14 #include "base/process/process_handle.h" |
14 #include "base/process/process_metrics.h" | 15 #include "base/process/process_metrics.h" |
15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
16 | 17 |
17 #ifdef ARCH_CPU_64_BITS | 18 #ifdef ARCH_CPU_64_BITS |
18 #define cr_vm_region vm_region_64 | 19 #define cr_vm_region vm_region_64 |
19 #else | 20 #else |
20 #define cr_vm_region vm_region | 21 #define cr_vm_region vm_region |
21 #endif | 22 #endif |
22 | 23 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 reinterpret_cast<task_info_t>(&task_vm_info), &count); | 85 reinterpret_cast<task_info_t>(&task_vm_info), &count); |
85 if (result != KERN_SUCCESS) { | 86 if (result != KERN_SUCCESS) { |
86 LOG(ERROR) << "Calling task_info failed."; | 87 LOG(ERROR) << "Calling task_info failed."; |
87 return 0; | 88 return 0; |
88 } | 89 } |
89 | 90 |
90 return static_cast<uint64_t>(task_vm_info.internal); | 91 return static_cast<uint64_t>(task_vm_info.internal); |
91 } | 92 } |
92 | 93 |
93 } // namespace memory_util | 94 } // namespace memory_util |
OLD | NEW |