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

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

Issue 1309963002: sandbox/linux/bpf_dsl: remove ErrorCode intermediary representation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rm-verifier
Patch Set: Sync 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/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 709a31c5da3cd88ea79a27b5a0fe6a4a5344cc1a..0064f8a7a2176f7c97e8b4fff02d3fec27067dd2 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl_impl.h
+++ b/sandbox/linux/bpf_dsl/bpf_dsl_impl.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "sandbox/linux/bpf_dsl/codegen.h"
#include "sandbox/sandbox_export.h"
namespace sandbox {
@@ -19,12 +20,12 @@ namespace internal {
// Internal interface implemented by BoolExpr implementations.
class BoolExprImpl : public base::RefCounted<BoolExprImpl> {
public:
- // Compile uses |pc| to construct an ErrorCode that conditionally continues
- // to either |true_ec| or |false_ec|, depending on whether the represented
+ // Compile uses |pc| to emit a CodeGen::Node that conditionally continues
+ // to either |then_node| or |false_node|, depending on whether the represented
// boolean expression is true or false.
- virtual ErrorCode Compile(PolicyCompiler* pc,
- ErrorCode true_ec,
- ErrorCode false_ec) const = 0;
+ virtual CodeGen::Node Compile(PolicyCompiler* pc,
+ CodeGen::Node then_node,
+ CodeGen::Node else_node) const = 0;
protected:
BoolExprImpl() {}
@@ -38,9 +39,9 @@ class BoolExprImpl : public base::RefCounted<BoolExprImpl> {
// Internal interface implemented by ResultExpr implementations.
class ResultExprImpl : public base::RefCounted<ResultExprImpl> {
public:
- // Compile uses |pc| to construct an ErrorCode analogous to the represented
- // result expression.
- virtual ErrorCode Compile(PolicyCompiler* pc) const = 0;
+ // Compile uses |pc| to emit a CodeGen::Node that executes the
+ // represented result expression.
+ virtual CodeGen::Node Compile(PolicyCompiler* pc) const = 0;
// HasUnsafeTraps returns whether the result expression is or recursively
// contains an unsafe trap expression.

Powered by Google App Engine
This is Rietveld 408576698