summaryrefslogtreecommitdiff
path: root/devel/electron13/files/sandbox_freebsd.h
diff options
context:
space:
mode:
authorHiroki Tagato <tagattie@FreeBSD.org>2021-11-24 17:28:24 +0900
committerHiroki Tagato <tagattie@FreeBSD.org>2021-11-24 17:30:52 +0900
commit4da4f5edbf9de5c4269cf66d70044f4cb3abdc41 (patch)
tree21363ca7518a943c48bde3a669c78444685f832e /devel/electron13/files/sandbox_freebsd.h
parentports-mgmt/octopkg: update description and WWW (diff)
devel/electron13: update to 13.6.2 (and rename from devel/electron12)
Changelog: https://www.electronjs.org/blog/electron-13-0
Diffstat (limited to 'devel/electron13/files/sandbox_freebsd.h')
-rw-r--r--devel/electron13/files/sandbox_freebsd.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/devel/electron13/files/sandbox_freebsd.h b/devel/electron13/files/sandbox_freebsd.h
new file mode 100644
index 000000000000..fffc6262c97f
--- /dev/null
+++ b/devel/electron13/files/sandbox_freebsd.h
@@ -0,0 +1,45 @@
+// 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 SANDBOX_POLICY_FREEBSD_SANDBOX_FREEBSD_H_
+#define SANDBOX_POLICY_FREEBSD_SANDBOX_FREEBSD_H_
+
+#include "base/macros.h"
+#include "base/memory/singleton.h"
+#include "sandbox/policy/export.h"
+#include "sandbox/policy/sandbox_type.h"
+
+namespace sandbox {
+namespace policy {
+
+// A singleton class to represent and change our sandboxing state for the
+// capsicum sandbox on FreeBSD.
+class SANDBOX_POLICY_EXPORT SandboxFreeBSD {
+public:
+ // Get our singleton instance.
+ static SandboxFreeBSD* GetInstance();
+
+ // Get a description for a sandbox type.
+ static std::string GetSandboxTypeInEnglish(SandboxType sandbox_type);
+
+ // Initializing the Capsicum sandbox.
+ bool InitializeSandbox(SandboxType sandbox_type);
+
+ // Testing whether the sandbox is enabled.
+ bool IsSandboxed();
+
+private:
+ friend struct base::DefaultSingletonTraits<SandboxFreeBSD>;
+
+ SandboxFreeBSD();
+ ~SandboxFreeBSD();
+
+ bool initialize_sandbox_ran_; // InitializeSandbox() was called.
+
+ DISALLOW_COPY_AND_ASSIGN(SandboxFreeBSD);
+};
+
+} // namespace policy
+} // namespace sandbox
+
+#endif // SANDBOX_POLICY_FREBSD_SANDBOX_FREEBSD_H_