summaryrefslogtreecommitdiff
path: root/chromium/content/public/browser/zygote_host
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/content/public/browser/zygote_host
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/public/browser/zygote_host')
-rw-r--r--chromium/content/public/browser/zygote_host/OWNERS4
-rw-r--r--chromium/content/public/browser/zygote_host/zygote_host_linux.h42
2 files changed, 46 insertions, 0 deletions
diff --git a/chromium/content/public/browser/zygote_host/OWNERS b/chromium/content/public/browser/zygote_host/OWNERS
new file mode 100644
index 00000000000..eb4b322bdf5
--- /dev/null
+++ b/chromium/content/public/browser/zygote_host/OWNERS
@@ -0,0 +1,4 @@
+file://content/zygote/OWNERS
+
+# TEAM: security-dev@chromium.org
+# COMPONENT: Internals>Sandbox
diff --git a/chromium/content/public/browser/zygote_host/zygote_host_linux.h b/chromium/content/public/browser/zygote_host/zygote_host_linux.h
new file mode 100644
index 00000000000..449ccf7b3ce
--- /dev/null
+++ b/chromium/content/public/browser/zygote_host/zygote_host_linux.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_LINUX_H_
+#define CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_LINUX_H_
+
+#include <unistd.h>
+
+#include "base/process/process.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+// https://chromium.googlesource.com/chromium/src/+/master/docs/linux/zygote.md
+
+// The zygote host is an interface, in the browser process, to the zygote
+// process.
+class ZygoteHost {
+ public:
+ // Returns the singleton instance.
+ static CONTENT_EXPORT ZygoteHost* GetInstance();
+
+ virtual ~ZygoteHost() {}
+
+ // Returns the pid of the Zygote process.
+ virtual bool IsZygotePid(pid_t pid) = 0;
+
+ // Returns an int which is a bitmask of kSandboxLinux* values. Only valid
+ // after the first render has been forked.
+ virtual int GetRendererSandboxStatus() = 0;
+
+ // Adjust the OOM score of the given renderer's PID. The allowed
+ // range for the score is [0, 1000], where higher values are more
+ // likely to be killed by the OOM killer.
+ virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle,
+ int score) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_LINUX_H_