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

Unified Diff: content/common/sandbox_linux/bpf_ppapi_policy_linux.cc

Issue 299683004: Rewrite all BPF policies to use DSL API Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Overhaul of DSL and implementation Created 6 years, 7 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
Index: content/common/sandbox_linux/bpf_ppapi_policy_linux.cc
diff --git a/content/common/sandbox_linux/bpf_ppapi_policy_linux.cc b/content/common/sandbox_linux/bpf_ppapi_policy_linux.cc
index 4c806228a8e8208df13bc149497156fc137cd5d8..cd7acde718ae920a2175ed0ed81defda5bcfa343 100644
--- a/content/common/sandbox_linux/bpf_ppapi_policy_linux.cc
+++ b/content/common/sandbox_linux/bpf_ppapi_policy_linux.cc
@@ -14,6 +14,7 @@
#include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h"
#include "sandbox/linux/services/linux_syscalls.h"
+using namespace sandbox::bpf_dsl;
using sandbox::SyscallSets;
namespace content {
@@ -21,8 +22,7 @@ namespace content {
PpapiProcessPolicy::PpapiProcessPolicy() {}
PpapiProcessPolicy::~PpapiProcessPolicy() {}
-ErrorCode PpapiProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox,
- int sysno) const {
+ResultExpr PpapiProcessPolicy::EvaluateSyscall(int sysno) const {
switch (sysno) {
case __NR_pread64:
case __NR_pwrite64:
@@ -33,12 +33,12 @@ ErrorCode PpapiProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox,
case __NR_sched_getscheduler:
case __NR_sched_setscheduler:
case __NR_times:
- return ErrorCode(ErrorCode::ERR_ALLOWED);
+ return Allow();
case __NR_ioctl:
- return ErrorCode(ENOTTY); // Flash Access.
+ return Error(ENOTTY); // Flash Access.
default:
// Default on the baseline policy.
- return SandboxBPFBasePolicy::EvaluateSyscall(sandbox, sysno);
+ return SandboxBPFBasePolicy::EvaluateSyscall(sysno);
}
}
« no previous file with comments | « content/common/sandbox_linux/bpf_ppapi_policy_linux.h ('k') | content/common/sandbox_linux/bpf_renderer_policy_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698