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

Unified Diff: content/common/sandbox_seccomp_bpf_linux.h

Issue 114483003: Revert of Linux Sandbox: split the GPU policies to their own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: content/common/sandbox_seccomp_bpf_linux.h
diff --git a/content/common/sandbox_seccomp_bpf_linux.h b/content/common/sandbox_seccomp_bpf_linux.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6058c41c03b8fac758aa960204f9917e207c5b7
--- /dev/null
+++ b/content/common/sandbox_seccomp_bpf_linux.h
@@ -0,0 +1,53 @@
+// 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_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_
+#define CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace sandbox {
+class SandboxBPFPolicy;
+}
+
+namespace content {
+
+// This class has two main sets of APIs. One can be used to start the sandbox
+// for internal content process types, the other is indirectly exposed as
+// a public content/ API and uses a supplied policy.
+class SandboxSeccompBPF {
+ public:
+ // This is the API to enable a seccomp-bpf sandbox for content/
+ // process-types:
+ // Is the sandbox globally enabled, can anything use it at all ?
+ // This looks at global command line flags to see if the sandbox
+ // should be enabled at all.
+ static bool IsSeccompBPFDesired();
+ // Should the sandbox be enabled for process_type ?
+ static bool ShouldEnableSeccompBPF(const std::string& process_type);
+ // Check if the kernel supports this sandbox. It's useful to "prewarm"
+ // this, part of the result will be cached.
+ static bool SupportsSandbox();
+ // Start the sandbox and apply the policy for process_type, depending on
+ // command line switches.
+ static bool StartSandbox(const std::string& process_type);
+
+ // This is the API to enable a seccomp-bpf sandbox by using an
+ // external policy.
+ static bool StartSandboxWithExternalPolicy(
+ scoped_ptr<sandbox::SandboxBPFPolicy> policy);
+ // The "baseline" policy can be a useful base to build a sandbox policy.
+ static scoped_ptr<sandbox::SandboxBPFPolicy> GetBaselinePolicy();
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SandboxSeccompBPF);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_
+
« no previous file with comments | « content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc ('k') | content/common/sandbox_seccomp_bpf_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698