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

Unified Diff: sandbox/linux/bpf_dsl/policy_compiler.h

Issue 1302043002: sandbox/linux: refactor bpf_dsl dependency on die.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use logging.h instead of errx Created 5 years, 4 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: sandbox/linux/bpf_dsl/policy_compiler.h
diff --git a/sandbox/linux/bpf_dsl/policy_compiler.h b/sandbox/linux/bpf_dsl/policy_compiler.h
index df38d4ccbc4e4cd087d6e9d510adcf50b00b2a2b..445cb9c32f58df7193a58435c3e387253a6d8b9e 100644
--- a/sandbox/linux/bpf_dsl/policy_compiler.h
+++ b/sandbox/linux/bpf_dsl/policy_compiler.h
@@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl_forward.h"
#include "sandbox/linux/bpf_dsl/codegen.h"
+#include "sandbox/linux/bpf_dsl/trap_registry.h"
#include "sandbox/linux/seccomp-bpf/errorcode.h"
#include "sandbox/sandbox_export.h"
@@ -38,6 +39,12 @@ class SANDBOX_EXPORT PolicyCompiler {
// system calls, regardless of policy.
void DangerousSetEscapePC(uint64_t escapepc);
+ // SetPanicFunc sets the trap function used for handling faulty
+ // system call conditions. The function will be called with its aux
+ // argument set to a pointer to a null-terminated character sequence
+ // describing the fault.
+ void SetPanicFunc(TrapRegistry::TrapFnc panic_func);
+
// Error returns an ErrorCode to indicate the system call should fail with
// the specified error number.
ErrorCode Error(int err);
@@ -142,9 +149,12 @@ class SANDBOX_EXPORT PolicyCompiler {
CodeGen::Node passed,
CodeGen::Node failed);
+ bpf_dsl::ResultExpr Panic(const char* msg);
+
const Policy* policy_;
TrapRegistry* registry_;
uint64_t escapepc_;
+ TrapRegistry::TrapFnc panic_func_;
Conds conds_;
CodeGen gen_;

Powered by Google App Engine
This is Rietveld 408576698