OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ |
| 6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "sandbox/sandbox_export.h" |
| 11 |
| 12 namespace sandbox { |
| 13 class ErrorCode; |
| 14 class SandboxBPF; |
| 15 |
| 16 namespace bpf_dsl { |
| 17 namespace internal { |
| 18 |
| 19 // Internal interface implemented by BoolExpr implementations. |
| 20 class BoolExprImpl : public base::RefCounted<BoolExprImpl> { |
| 21 public: |
| 22 BoolExprImpl() {} |
| 23 virtual ErrorCode Compile(SandboxBPF* sb, |
| 24 ErrorCode true_ec, |
| 25 ErrorCode false_ec) const = 0; |
| 26 |
| 27 protected: |
| 28 virtual ~BoolExprImpl() {} |
| 29 |
| 30 private: |
| 31 friend class base::RefCounted<BoolExprImpl>; |
| 32 DISALLOW_COPY_AND_ASSIGN(BoolExprImpl); |
| 33 }; |
| 34 |
| 35 // Internal interface implemented by ResultExpr implementations. |
| 36 class ResultExprImpl : public base::RefCounted<ResultExprImpl> { |
| 37 public: |
| 38 ResultExprImpl() {} |
| 39 virtual ErrorCode Compile(SandboxBPF* sb) const = 0; |
| 40 virtual bool HasUnsafeTraps() const; |
| 41 |
| 42 protected: |
| 43 virtual ~ResultExprImpl() {} |
| 44 |
| 45 private: |
| 46 friend class base::RefCounted<ResultExprImpl>; |
| 47 DISALLOW_COPY_AND_ASSIGN(ResultExprImpl); |
| 48 }; |
| 49 |
| 50 } // namespace internal |
| 51 } // namespace bpf_dsl |
| 52 } // namespace sandbox |
| 53 |
| 54 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ |
OLD | NEW |