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

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

Issue 660153002: bpf_dsl: move more implementation details out of bpf_dsl.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: IWYU Created 6 years, 2 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
« no previous file with comments | « sandbox/linux/bpf_dsl/bpf_dsl.cc ('k') | sandbox/linux/bpf_dsl/policy_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/bpf_dsl/bpf_dsl_impl.h
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl_impl.h b/sandbox/linux/bpf_dsl/bpf_dsl_impl.h
index cf067b3933f10e06d1ab071dcd1b7f4c4ff0f917..48b91692b66272197bbc69f8702b6cd4b0d41a42 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl_impl.h
+++ b/sandbox/linux/bpf_dsl/bpf_dsl_impl.h
@@ -11,20 +11,24 @@
namespace sandbox {
class ErrorCode;
-class SandboxBPF;
namespace bpf_dsl {
+class PolicyCompiler;
+
namespace internal {
// Internal interface implemented by BoolExpr implementations.
class BoolExprImpl : public base::RefCounted<BoolExprImpl> {
public:
- BoolExprImpl() {}
+ // Compile uses |pc| to construct an ErrorCode that conditionally continues
+ // to either |true_ec| or |false_ec|, depending on whether the represented
+ // boolean expression is true or false.
virtual ErrorCode Compile(PolicyCompiler* pc,
ErrorCode true_ec,
ErrorCode false_ec) const = 0;
protected:
+ BoolExprImpl() {}
virtual ~BoolExprImpl() {}
private:
@@ -35,11 +39,16 @@ class BoolExprImpl : public base::RefCounted<BoolExprImpl> {
// Internal interface implemented by ResultExpr implementations.
class ResultExprImpl : public base::RefCounted<ResultExprImpl> {
public:
- ResultExprImpl() {}
+ // Compile uses |pc| to construct an ErrorCode analogous to the represented
+ // result expression.
virtual ErrorCode Compile(PolicyCompiler* pc) const = 0;
+
+ // HasUnsafeTraps returns whether the result expression is or recursively
+ // contains an unsafe trap expression.
virtual bool HasUnsafeTraps() const;
protected:
+ ResultExprImpl() {}
virtual ~ResultExprImpl() {}
private:
« no previous file with comments | « sandbox/linux/bpf_dsl/bpf_dsl.cc ('k') | sandbox/linux/bpf_dsl/policy_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698