Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: base/process/process_metrics_ios.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
10
9 namespace base { 11 namespace base {
10 12
11 namespace { 13 namespace {
12 14
13 bool GetTaskInfo(task_basic_info_64* task_info_data) { 15 bool GetTaskInfo(task_basic_info_64* task_info_data) {
14 mach_msg_type_number_t count = TASK_BASIC_INFO_64_COUNT; 16 mach_msg_type_number_t count = TASK_BASIC_INFO_64_COUNT;
15 kern_return_t kr = task_info(mach_task_self(), 17 kern_return_t kr = task_info(mach_task_self(),
16 TASK_BASIC_INFO_64, 18 TASK_BASIC_INFO_64,
17 reinterpret_cast<task_info_t>(task_info_data), 19 reinterpret_cast<task_info_t>(task_info_data),
18 &count); 20 &count);
19 return kr == KERN_SUCCESS; 21 return kr == KERN_SUCCESS;
20 } 22 }
21 23
22 } // namespace 24 } // namespace
23 25
24 ProcessMetrics::ProcessMetrics(ProcessHandle process) {} 26 ProcessMetrics::ProcessMetrics(ProcessHandle process) {}
25 27
26 ProcessMetrics::~ProcessMetrics() {} 28 ProcessMetrics::~ProcessMetrics() {}
27 29
28 // static 30 // static
29 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) { 31 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
30 return new ProcessMetrics(process); 32 return new ProcessMetrics(process);
31 } 33 }
32 34
35 double ProcessMetrics::GetCPUUsage() {
36 NOTIMPLEMENTED();
37 return 0;
38 }
39
33 size_t ProcessMetrics::GetPagefileUsage() const { 40 size_t ProcessMetrics::GetPagefileUsage() const {
34 task_basic_info_64 task_info_data; 41 task_basic_info_64 task_info_data;
35 if (!GetTaskInfo(&task_info_data)) 42 if (!GetTaskInfo(&task_info_data))
36 return 0; 43 return 0;
37 return task_info_data.virtual_size; 44 return task_info_data.virtual_size;
38 } 45 }
39 46
40 size_t ProcessMetrics::GetWorkingSetSize() const { 47 size_t ProcessMetrics::GetWorkingSetSize() const {
41 task_basic_info_64 task_info_data; 48 task_basic_info_64 task_info_data;
42 if (!GetTaskInfo(&task_info_data)) 49 if (!GetTaskInfo(&task_info_data))
(...skipping 19 matching lines...) Expand all
62 } 69 }
63 70
64 void SetFdLimit(unsigned int max_descriptors) { 71 void SetFdLimit(unsigned int max_descriptors) {
65 // Unimplemented. 72 // Unimplemented.
66 } 73 }
67 74
68 size_t GetPageSize() { 75 size_t GetPageSize() {
69 return getpagesize(); 76 return getpagesize();
70 } 77 }
71 78
79 // Bytes committed by the system.
80 size_t GetSystemCommitCharge() {
81 NOTIMPLEMENTED();
82 return 0;
83 }
84
72 } // namespace base 85 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698