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

Unified Diff: base/process/process_metrics.h

Issue 19064002: Split ProcessHandle and its related routines into base/process/process_handle.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_handle_win.cc ('k') | base/process/process_metrics_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics.h
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h
index 1232f7419091831f79cfa9a804087664fdbf7f13..3a6a30b41e4d3bfa795e8320330f6145fdaf3a0d 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -237,6 +237,23 @@ struct BASE_EXPORT SystemMemoryInfoKB {
BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo);
#endif // defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID)
+// Get the number of threads of |process| as available in /proc/<pid>/stat.
+// This should be used with care as no synchronization with running threads is
+// done. This is mostly useful to guarantee being single-threaded.
+// Returns 0 on failure.
+BASE_EXPORT int GetNumberOfThreads(ProcessHandle process);
+
+// /proc/self/exe refers to the current executable.
+BASE_EXPORT extern const char kProcSelfExe[];
+#endif // defined(OS_LINUX) || defined(OS_ANDROID)
+
+#if defined(OS_POSIX)
+// Returns the maximum number of file descriptors that can be open by a process
+// at once. If the number is unavailable, a conservative best guess is returned.
+size_t GetMaxFds();
+#endif // defined(OS_POSIX)
+
} // namespace base
#endif // BASE_PROCESS_PROCESS_METRICS_H_
« no previous file with comments | « base/process/process_handle_win.cc ('k') | base/process/process_metrics_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698