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

Side by Side Diff: base/process/process_metrics.h

Issue 710373002: LevelDB: Using base::File for all file I/O (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Guarded call to base::GetMaxFds with #if defined(OS_POSIX) Created 6 years, 1 month 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 // This file contains routines for gathering resource statistics for processes 5 // This file contains routines for gathering resource statistics for processes
6 // running on the system. 6 // running on the system.
7 7
8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ 8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_
9 #define BASE_PROCESS_PROCESS_METRICS_H_ 9 #define BASE_PROCESS_PROCESS_METRICS_H_
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 DISALLOW_COPY_AND_ASSIGN(ProcessMetrics); 227 DISALLOW_COPY_AND_ASSIGN(ProcessMetrics);
228 }; 228 };
229 229
230 // Returns the memory committed by the system in KBytes. 230 // Returns the memory committed by the system in KBytes.
231 // Returns 0 if it can't compute the commit charge. 231 // Returns 0 if it can't compute the commit charge.
232 BASE_EXPORT size_t GetSystemCommitCharge(); 232 BASE_EXPORT size_t GetSystemCommitCharge();
233 233
234 #if defined(OS_POSIX) 234 #if defined(OS_POSIX)
235 // Returns the maximum number of file descriptors that can be open by a process 235 // Returns the maximum number of file descriptors that can be open by a process
236 // at once. If the number is unavailable, a conservative best guess is returned. 236 // at once. If the number is unavailable, a conservative best guess is returned.
237 size_t GetMaxFds(); 237 BASE_EXPORT size_t GetMaxFds();
238 238
239 // Sets the file descriptor soft limit to |max_descriptors| or the OS hard 239 // Sets the file descriptor soft limit to |max_descriptors| or the OS hard
240 // limit, whichever is lower. 240 // limit, whichever is lower.
241 BASE_EXPORT void SetFdLimit(unsigned int max_descriptors); 241 BASE_EXPORT void SetFdLimit(unsigned int max_descriptors);
242 #endif // defined(OS_POSIX) 242 #endif // defined(OS_POSIX)
243 243
244 #if defined(OS_LINUX) || defined(OS_ANDROID) 244 #if defined(OS_LINUX) || defined(OS_ANDROID)
245 // Parse the data found in /proc/<pid>/stat and return the sum of the 245 // Parse the data found in /proc/<pid>/stat and return the sum of the
246 // CPU-related ticks. Returns -1 on parse error. 246 // CPU-related ticks. Returns -1 on parse error.
247 // Exposed for testing. 247 // Exposed for testing.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 SystemDiskInfo disk_info_; 383 SystemDiskInfo disk_info_;
384 #endif 384 #endif
385 #if defined(OS_CHROMEOS) 385 #if defined(OS_CHROMEOS)
386 SwapInfo swap_info_; 386 SwapInfo swap_info_;
387 #endif 387 #endif
388 }; 388 };
389 389
390 } // namespace base 390 } // namespace base
391 391
392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ 392 #endif // BASE_PROCESS_PROCESS_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | build/secondary/third_party/leveldatabase/BUILD.gn » ('j') | third_party/leveldatabase/env_chromium.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698