Lines Matching full:process
12 #include "base/process/process_handle.h"
23 #include <lib/zx/process.h>
31 #include "base/process/port_provider_mac.h"
37 // OneGroupPerRenderer feature places each foreground renderer process into
39 // of all threads in the process when deciding on the next thread to schedule.
43 // Set all threads of a background process as backgrounded, which changes the
45 // is unchanged, since background process is under the spell of the background
52 // Provides a move-only encapsulation of a process.
54 // This object is not tied to the lifetime of the underlying process: the
55 // process may be killed and this object may still around, and it will still
58 // Windows: The underlying ProcessHandle will be valid after the process dies
59 // and can be used to gather some information about that process, but most
63 // the process dies, and it may be reused by the system, which means that it may
64 // end up pointing to the wrong process.
65 class BASE_EXPORT Process {
69 explicit Process(ProcessHandle handle = kNullProcessHandle);
71 Process(Process&& other);
73 Process(const Process&) = delete;
74 Process& operator=(const Process&) = delete;
76 // The destructor does not terminate the process.
77 ~Process();
79 Process& operator=(Process&& other);
81 // Returns an object for the current process.
82 static Process Current();
84 // Returns a Process for the given |pid|.
85 static Process Open(ProcessId pid);
87 // Returns a Process for the given |pid|. On Windows the handle is opened
90 static Process OpenWithExtraPrivileges(ProcessId pid);
93 // Returns a Process for the given |pid|, using some |desired_access|.
95 static Process OpenWithAccess(ProcessId pid, DWORD desired_access);
102 // Terminates the current process immediately with |exit_code|.
105 // Returns true if this objects represents a valid process.
108 // Returns a handle for this process. There is no guarantee about when that
112 // Returns a second object that represents this process.
113 Process Duplicate() const;
120 // Get the PID for this process.
123 // Get the creation time for this process. Since the Pid can be reused after a
124 // process dies, it is useful to use both the Pid and the creation time to
125 // uniquely identify a process.
127 // On Android, works only if |this| is the current process, as security
132 // Returns true if this process is the current process.
136 // A unique token generated for each process, this is used to create a unique
143 // Close the process handle. This will not terminate the process.
146 // Returns true if this process is still running. This is only safe on Windows
148 // process information available until itself has been released. But on Posix,
156 // Terminates the process with extreme prejudice. The given |exit_code| will
157 // be the exit code of the process. If |wait| is true, this method will wait
158 // for up to one minute for the process to actually terminate.
159 // Returns true if the process terminates within the allowed time.
170 // Waits for the process to exit, or the specified |stop_event_handle| to be
172 // will be the exit code of the process.
178 // Waits for the process to exit. Returns true on success.
179 // On POSIX, if the process has been signaled then |exit_code| is set to -1.
180 // On Linux this must be a child process, however on Mac and Windows it can be
181 // any process.
191 // Indicates that the process has exited with the specified |exit_code|.
192 // This should be called if process exit is observed outside of this class.
195 // process though that should be avoided.
198 // The different priorities that a process can have.
202 // The process does not contribute to content that is currently important
206 // The process contributes to content that is visible to the user, but the
211 // The process contributes to content that is of the utmost importance to
220 // The Mac needs a Mach port in order to manipulate a process's priority,
225 // Retrieves the priority of the process. Defaults to Priority::kUserBlocking
229 // Sets the priority of the process process. Returns true if the priority was
234 // Retrieves the priority of the process. Defaults to Priority::kUserBlocking
238 // Sets the priority of the process process. Returns true if the priority was
243 // Returns an integer representing the priority of a process. The meaning
249 // If the process is not in a PID namespace or /proc/<pid>/status does not
255 // Returns true if the process has any seccomp policy applied.
260 // Sets a delegate which handles process priority changes. This
261 // must be externally synchronized with any call to base::Process methods.
267 // If OneGroupPerRenderer is enabled, runs at process startup to clean up
269 // browser process.
272 // Initializes the process's priority.
277 // the process priority. The returned `base::Process::PriorityEntry` should be
278 // freed when the process is terminated so that the cached entry is freed from
282 // process.
283 // This is a no-op if the Process is not valid or if it has already been
294 // Sets the priority of the current process to its default value.
309 // forked processes. For non-simulator builds on iOS every process would
310 // be a "content process" so we don't need the conditionals.
318 // Cleans up process state. If OneGroupPerRenderer is enabled, it cleans up
319 // the cgroup created by InitializePriority(). If the process has not
326 // Used to call CleanUpProcess() on a background thread because Process is not
328 static void CleanUpProcessScheduled(Process process, int remaining_retries);
341 zx::process process_;
351 // A flag indicating that this is a "content process". iOS does not support
352 // generic process invocation but it does support some types of well defined
359 // A unique token per process not per class instance (`base::Process`). This
360 // is similar to the PID of a process but should not be reused after the
361 // process's termination. The token will be copied during Duplicate()
370 // process is backgrounded or not.
371 BASE_EXPORT Process::Priority GetProcessPriorityCGroup(