Re-enable index-basics-workers test to see if still times
[chromium-blink-merge.git] / content / public / browser / zygote_host_linux.h
blob2dd1f8012f5b7f0873d74af26ce3dbf0d68d2b1e
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.
5 #ifndef CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_
6 #define CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_
8 #include <unistd.h>
10 #include "base/process.h"
11 #include "content/common/content_export.h"
13 namespace content {
15 // http://code.google.com/p/chromium/wiki/LinuxZygote
17 // The zygote host is the interface, in the browser process, to the zygote
18 // process.
19 class ZygoteHost {
20 public:
21 // Returns the singleton instance.
22 CONTENT_EXPORT static ZygoteHost* GetInstance();
24 virtual ~ZygoteHost() {}
26 // Returns the pid of the Zygote process.
27 virtual pid_t GetPid() const = 0;
29 // Returns the pid of the Sandbox Helper process.
30 virtual pid_t GetSandboxHelperPid() const = 0;
32 // Returns an int which is a bitmask of kSandboxLinux* values. Only valid
33 // after the first render has been forked.
34 virtual int GetSandboxStatus() const = 0;
36 // Adjust the OOM score of the given renderer's PID. The allowed
37 // range for the score is [0, 1000], where higher values are more
38 // likely to be killed by the OOM killer.
39 virtual void AdjustRendererOOMScore(base::ProcessHandle process_handle,
40 int score) = 0;
42 // Adjust the point at which the low memory notifier in the kernel tells
43 // us that we're low on memory. When there is less than |margin_mb| left,
44 // then the notifier will notify us. Set |margin_mb| to -1 to turn off
45 // low memory notification altogether.
46 virtual void AdjustLowMemoryMargin(int64 margin_mb) = 0;
49 } // namespace content
51 #endif // CONTENT_PUBLIC_BROWSER_ZYGOTE_HOST_LINUX_H_