OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Returns its pid on success, otherwise | 30 // Returns its pid on success, otherwise |
31 // base::kNullProcessHandle; | 31 // base::kNullProcessHandle; |
32 pid_t ForkRequest(const std::vector<std::string>& command_line, | 32 pid_t ForkRequest(const std::vector<std::string>& command_line, |
33 const std::vector<FileDescriptorInfo>& mapping, | 33 const std::vector<FileDescriptorInfo>& mapping, |
34 const std::string& process_type); | 34 const std::string& process_type); |
35 void EnsureProcessTerminated(pid_t process); | 35 void EnsureProcessTerminated(pid_t process); |
36 | 36 |
37 // Get the termination status (and, optionally, the exit code) of | 37 // Get the termination status (and, optionally, the exit code) of |
38 // the process. |exit_code| is set to the exit code of the child | 38 // the process. |exit_code| is set to the exit code of the child |
39 // process. (|exit_code| may be NULL.) | 39 // process. (|exit_code| may be NULL.) |
| 40 // Unfortunately the Zygote can not accurately figure out if a process |
| 41 // is already dead without waiting synchronously for it. |
| 42 // |known_dead| should be set to true when we already know that the process |
| 43 // is dead. |
40 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, | 44 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, |
| 45 bool known_dead, |
41 int* exit_code); | 46 int* exit_code); |
42 | 47 |
43 // ZygoteHost implementation: | 48 // ZygoteHost implementation: |
44 virtual pid_t GetPid() const OVERRIDE; | 49 virtual pid_t GetPid() const OVERRIDE; |
45 virtual pid_t GetSandboxHelperPid() const OVERRIDE; | 50 virtual pid_t GetSandboxHelperPid() const OVERRIDE; |
46 virtual int GetSandboxStatus() const OVERRIDE; | 51 virtual int GetSandboxStatus() const OVERRIDE; |
47 virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle, | 52 virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle, |
48 int score) OVERRIDE; | 53 int score) OVERRIDE; |
49 virtual void AdjustLowMemoryMargin(int64 margin_mb) OVERRIDE; | 54 virtual void AdjustLowMemoryMargin(int64 margin_mb) OVERRIDE; |
50 | 55 |
(...skipping 19 matching lines...) Expand all Loading... |
70 bool init_; | 75 bool init_; |
71 bool using_suid_sandbox_; | 76 bool using_suid_sandbox_; |
72 std::string sandbox_binary_; | 77 std::string sandbox_binary_; |
73 bool have_read_sandbox_status_word_; | 78 bool have_read_sandbox_status_word_; |
74 int sandbox_status_; | 79 int sandbox_status_; |
75 }; | 80 }; |
76 | 81 |
77 } // namespace content | 82 } // namespace content |
78 | 83 |
79 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 84 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
OLD | NEW |