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 namespace base { | 9 namespace base { |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 ProcessMetrics::ProcessMetrics(ProcessHandle process) {} | 24 ProcessMetrics::ProcessMetrics(ProcessHandle process) {} |
25 | 25 |
26 ProcessMetrics::~ProcessMetrics() {} | 26 ProcessMetrics::~ProcessMetrics() {} |
27 | 27 |
28 // static | 28 // static |
29 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) { | 29 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) { |
30 return new ProcessMetrics(process); | 30 return new ProcessMetrics(process); |
31 } | 31 } |
32 | 32 |
| 33 double ProcessMetrics::GetCPUUsage() { |
| 34 return 0; |
| 35 } |
| 36 |
33 size_t ProcessMetrics::GetPagefileUsage() const { | 37 size_t ProcessMetrics::GetPagefileUsage() const { |
34 task_basic_info_64 task_info_data; | 38 task_basic_info_64 task_info_data; |
35 if (!GetTaskInfo(&task_info_data)) | 39 if (!GetTaskInfo(&task_info_data)) |
36 return 0; | 40 return 0; |
37 return task_info_data.virtual_size; | 41 return task_info_data.virtual_size; |
38 } | 42 } |
39 | 43 |
40 size_t ProcessMetrics::GetWorkingSetSize() const { | 44 size_t ProcessMetrics::GetWorkingSetSize() const { |
41 task_basic_info_64 task_info_data; | 45 task_basic_info_64 task_info_data; |
42 if (!GetTaskInfo(&task_info_data)) | 46 if (!GetTaskInfo(&task_info_data)) |
(...skipping 19 matching lines...) Expand all Loading... |
62 } | 66 } |
63 | 67 |
64 void SetFdLimit(unsigned int max_descriptors) { | 68 void SetFdLimit(unsigned int max_descriptors) { |
65 // Unimplemented. | 69 // Unimplemented. |
66 } | 70 } |
67 | 71 |
68 size_t GetPageSize() { | 72 size_t GetPageSize() { |
69 return getpagesize(); | 73 return getpagesize(); |
70 } | 74 } |
71 | 75 |
| 76 // Bytes committed by the system. |
| 77 size_t GetSystemCommitCharge() { |
| 78 return 0; |
| 79 } |
| 80 |
72 } // namespace base | 81 } // namespace base |
OLD | NEW |