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 #include "base/process/process_metrics.h" | 5 #include "base/process/process_metrics.h" |
6 | 6 |
7 #include <mach/mach.h> | 7 #include <mach/mach.h> |
8 #include <mach/mach_vm.h> | 8 #include <mach/mach_vm.h> |
9 #include <mach/shared_region.h> | 9 #include <mach/shared_region.h> |
10 #include <sys/sysctl.h> | 10 #include <sys/sysctl.h> |
11 | 11 |
12 #include "base/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/mac/scoped_mach_port.h" | 14 #include "base/mac/scoped_mach_port.h" |
15 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 bool GetTaskInfo(mach_port_t task, task_basic_info_64* task_info_data) { | 21 bool GetTaskInfo(mach_port_t task, task_basic_info_64* task_info_data) { |
22 if (task == MACH_PORT_NULL) | 22 if (task == MACH_PORT_NULL) |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 kr = host_page_size(host, &page_size); | 316 kr = host_page_size(host, &page_size); |
317 if (kr) { | 317 if (kr) { |
318 DLOG(ERROR) << "Failed to fetch host page size."; | 318 DLOG(ERROR) << "Failed to fetch host page size."; |
319 return 0; | 319 return 0; |
320 } | 320 } |
321 | 321 |
322 return (data.active_count * page_size) / 1024; | 322 return (data.active_count * page_size) / 1024; |
323 } | 323 } |
324 | 324 |
325 } // namespace base | 325 } // namespace base |
OLD | NEW |