1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
--- content/browser/child_process_launcher_helper_linux.cc.orig 2022-02-28 16:54:41 UTC
+++ content/browser/child_process_launcher_helper_linux.cc
@@ -19,7 +19,9 @@
#include "content/public/common/result_codes.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "content/public/common/zygote/sandbox_support_linux.h"
+#if !BUILDFLAG(IS_BSD)
#include "content/public/common/zygote/zygote_handle.h"
+#endif
#include "sandbox/policy/linux/sandbox_linux.h"
namespace content {
@@ -68,6 +70,7 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThr
int* launch_result) {
*is_synchronous_launch = true;
+#if !BUILDFLAG(IS_BSD)
ZygoteHandle zygote_handle =
base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
? nullptr
@@ -81,7 +84,6 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThr
GetProcessType());
*launch_result = LAUNCH_RESULT_SUCCESS;
-#if !BUILDFLAG(IS_OPENBSD)
if (handle) {
// It could be a renderer process or an utility process.
int oom_score = content::kMiscOomScore;
@@ -90,13 +92,13 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThr
oom_score = content::kLowestRendererOomScore;
ZygoteHostImpl::GetInstance()->AdjustRendererOOMScore(handle, oom_score);
}
-#endif
Process process;
process.process = base::Process(handle);
process.zygote = zygote_handle;
return process;
}
+#endif
Process process;
process.process = base::LaunchProcess(*command_line(), options);
@@ -114,10 +116,14 @@ ChildProcessTerminationInfo ChildProcessLauncherHelper
const ChildProcessLauncherHelper::Process& process,
bool known_dead) {
ChildProcessTerminationInfo info;
+#if !BUILDFLAG(IS_BSD)
if (process.zygote) {
info.status = process.zygote->GetTerminationStatus(
process.process.Handle(), known_dead, &info.exit_code);
} else if (known_dead) {
+#else
+ if (known_dead) {
+#endif
info.status = base::GetKnownDeadTerminationStatus(process.process.Handle(),
&info.exit_code);
} else {
@@ -141,13 +147,17 @@ void ChildProcessLauncherHelper::ForceNormalProcessTer
DCHECK(CurrentlyOnProcessLauncherTaskRunner());
process.process.Terminate(RESULT_CODE_NORMAL_EXIT, false);
// On POSIX, we must additionally reap the child.
+#if !BUILDFLAG(IS_BSD)
if (process.zygote) {
// If the renderer was created via a zygote, we have to proxy the reaping
// through the zygote process.
process.zygote->EnsureProcessTerminated(process.process.Handle());
} else {
+#endif
base::EnsureProcessTerminated(std::move(process.process));
+#if !BUILDFLAG(IS_BSD)
}
+#endif
}
void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread(
|