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

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

Issue 185713005: Add support for FreeBSD in base/ , base/process/ , and base/threading so that the bootstrap binary … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 <sys/sysctl.h>
8 #include <sys/user.h>
9 #include <unistd.h>
10
11 #include "base/sys_info.h"
12
7 namespace base { 13 namespace base {
8 14
9 ProcessMetrics::ProcessMetrics(ProcessHandle process) 15 ProcessMetrics::ProcessMetrics(ProcessHandle process)
10 : process_(process), 16 : process_(process),
11 last_cpu_time_(0), 17 last_cpu_time_(0),
12 last_system_time_(0), 18 last_system_time_(0),
13 last_cpu_(0) { 19 last_cpu_(0) {
14 processor_count_ = base::SysInfo::NumberOfProcessors(); 20 processor_count_ = base::SysInfo::NumberOfProcessors();
15 } 21 }
16 22
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 NULL, 0) < 0) { 119 NULL, 0) < 0) {
114 return 0; 120 return 0;
115 } 121 }
116 122
117 pagesize = getpagesize(); 123 pagesize = getpagesize();
118 124
119 return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize); 125 return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
120 } 126 }
121 127
122 } // namespace base 128 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698