Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: content/public/browser/zygote_host_linux.h

Issue 9463029: Add an API around zygoteHost so that chrome doesn't reach into the internal content implementation. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix clang Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_browser.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/zygote_host_linux.h
===================================================================
--- content/public/browser/zygote_host_linux.h (revision 0)
+++ content/public/browser/zygote_host_linux.h (revision 0)
@@ -0,0 +1,49 @@
+// 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_LINUX_H_
+#define CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_
+#pragma once
+
+#include <unistd.h>
+
+#include "base/process.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+// http://code.google.com/p/chromium/wiki/LinuxZygote
+
+// The zygote host is the interface, in the browser process, to the zygote
+// process.
+class ZygoteHost {
+ public:
+ // Returns the singleton instance.
+ CONTENT_EXPORT static ZygoteHost* GetInstance();
+
+ // These form a bitmask which describes the conditions of the sandbox that
+ // the zygote finds itself in.
+ enum {
+ kSandboxSUID = 1 << 0, // SUID sandbox active
+ kSandboxPIDNS = 1 << 1, // SUID sandbox is using the PID namespace
+ kSandboxNetNS = 1 << 2, // SUID sandbox is using the network namespace
+ kSandboxSeccomp = 1 << 3, // seccomp sandbox active.
+ };
+
+ virtual pid_t GetPid() const = 0;
+
+ // Returns an int which is a bitmask of kSandbox* values. Only valid after
+ // the first render has been forked.
+ virtual int GetSandboxStatus() const = 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_LINUX_H_
Property changes on: content\public\browser\zygote_host_linux.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698