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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/content_browser.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_
6 #define CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_
7 #pragma once
8
9 #include <unistd.h>
10
11 #include "base/process.h"
12 #include "content/common/content_export.h"
13
14 namespace content {
15
16 // http://code.google.com/p/chromium/wiki/LinuxZygote
17
18 // The zygote host is the interface, in the browser process, to the zygote
19 // process.
20 class ZygoteHost {
21 public:
22 // Returns the singleton instance.
23 CONTENT_EXPORT static ZygoteHost* GetInstance();
24
25 // These form a bitmask which describes the conditions of the sandbox that
26 // the zygote finds itself in.
27 enum {
28 kSandboxSUID = 1 << 0, // SUID sandbox active
29 kSandboxPIDNS = 1 << 1, // SUID sandbox is using the PID namespace
30 kSandboxNetNS = 1 << 2, // SUID sandbox is using the network namespace
31 kSandboxSeccomp = 1 << 3, // seccomp sandbox active.
32 };
33
34 virtual pid_t GetPid() const = 0;
35
36 // Returns an int which is a bitmask of kSandbox* values. Only valid after
37 // the first render has been forked.
38 virtual int GetSandboxStatus() const = 0;
39
40 // Adjust the OOM score of the given renderer's PID. The allowed
41 // range for the score is [0, 1000], where higher values are more
42 // likely to be killed by the OOM killer.
43 virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle,
44 int score) = 0;
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_
OLDNEW
« 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