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/task.h> | 7 #include <mach/task.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 bool GetTaskInfo(task_basic_info_64* task_info_data) { | 15 bool GetTaskInfo(task_basic_info_64* task_info_data) { |
16 mach_msg_type_number_t count = TASK_BASIC_INFO_64_COUNT; | 16 mach_msg_type_number_t count = TASK_BASIC_INFO_64_COUNT; |
17 kern_return_t kr = task_info(mach_task_self(), | 17 kern_return_t kr = task_info(mach_task_self(), |
18 TASK_BASIC_INFO_64, | 18 TASK_BASIC_INFO_64, |
19 reinterpret_cast<task_info_t>(task_info_data), | 19 reinterpret_cast<task_info_t>(task_info_data), |
20 &count); | 20 &count); |
21 return kr == KERN_SUCCESS; | 21 return kr == KERN_SUCCESS; |
22 } | 22 } |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
| 26 SystemMemoryInfoKB::SystemMemoryInfoKB() { |
| 27 total = 0; |
| 28 free = 0; |
| 29 } |
| 30 |
26 ProcessMetrics::ProcessMetrics(ProcessHandle process) {} | 31 ProcessMetrics::ProcessMetrics(ProcessHandle process) {} |
27 | 32 |
28 ProcessMetrics::~ProcessMetrics() {} | 33 ProcessMetrics::~ProcessMetrics() {} |
29 | 34 |
30 // static | 35 // static |
31 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) { | 36 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) { |
32 return new ProcessMetrics(process); | 37 return new ProcessMetrics(process); |
33 } | 38 } |
34 | 39 |
35 double ProcessMetrics::GetCPUUsage() { | 40 double ProcessMetrics::GetCPUUsage() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 size_t GetPageSize() { | 80 size_t GetPageSize() { |
76 return getpagesize(); | 81 return getpagesize(); |
77 } | 82 } |
78 | 83 |
79 // Bytes committed by the system. | 84 // Bytes committed by the system. |
80 size_t GetSystemCommitCharge() { | 85 size_t GetSystemCommitCharge() { |
81 NOTIMPLEMENTED(); | 86 NOTIMPLEMENTED(); |
82 return 0; | 87 return 0; |
83 } | 88 } |
84 | 89 |
| 90 // Bytes committed by the system. |
| 91 bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { |
| 92 // Unimplemented. Must enable unittest for IOS when this gets implemented. |
| 93 NOTIMPLEMENTED(); |
| 94 return false; |
| 95 } |
| 96 |
85 } // namespace base | 97 } // namespace base |
OLD | NEW |