OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef BASE_PROCESS_PROCESS_H_ | 5 #ifndef BASE_PROCESS_PROCESS_H_ |
6 #define BASE_PROCESS_PROCESS_H_ | 6 #define BASE_PROCESS_PROCESS_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // Creates an object from a |handle| owned by someone else. | 70 // Creates an object from a |handle| owned by someone else. |
71 // Don't use this for new code. It is only intended to ease the migration to | 71 // Don't use this for new code. It is only intended to ease the migration to |
72 // a strict ownership model. | 72 // a strict ownership model. |
73 // TODO(rvargas) crbug.com/417532: Remove this code. | 73 // TODO(rvargas) crbug.com/417532: Remove this code. |
74 static Process DeprecatedGetProcessFromHandle(ProcessHandle handle); | 74 static Process DeprecatedGetProcessFromHandle(ProcessHandle handle); |
75 | 75 |
76 // Returns true if processes can be backgrounded. | 76 // Returns true if processes can be backgrounded. |
77 static bool CanBackgroundProcesses(); | 77 static bool CanBackgroundProcesses(); |
78 | 78 |
| 79 // Terminates the current process immediately with |exit_code|. |
| 80 static void TerminateCurrentProcessImmediately(int exit_code); |
| 81 |
79 // Returns true if this objects represents a valid process. | 82 // Returns true if this objects represents a valid process. |
80 bool IsValid() const; | 83 bool IsValid() const; |
81 | 84 |
82 // Returns a handle for this process. There is no guarantee about when that | 85 // Returns a handle for this process. There is no guarantee about when that |
83 // handle becomes invalid because this object retains ownership. | 86 // handle becomes invalid because this object retains ownership. |
84 ProcessHandle Handle() const; | 87 ProcessHandle Handle() const; |
85 | 88 |
86 // Returns a second object that represents this process. | 89 // Returns a second object that represents this process. |
87 Process Duplicate() const; | 90 Process Duplicate() const; |
88 | 91 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // Exposed for testing. | 176 // Exposed for testing. |
174 // Given the contents of the /proc/<pid>/cgroup file, determine whether the | 177 // Given the contents of the /proc/<pid>/cgroup file, determine whether the |
175 // process is backgrounded or not. | 178 // process is backgrounded or not. |
176 BASE_EXPORT bool IsProcessBackgroundedCGroup( | 179 BASE_EXPORT bool IsProcessBackgroundedCGroup( |
177 const StringPiece& cgroup_contents); | 180 const StringPiece& cgroup_contents); |
178 #endif // defined(OS_CHROMEOS) | 181 #endif // defined(OS_CHROMEOS) |
179 | 182 |
180 } // namespace base | 183 } // namespace base |
181 | 184 |
182 #endif // BASE_PROCESS_PROCESS_H_ | 185 #endif // BASE_PROCESS_PROCESS_H_ |
OLD | NEW |