OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ | 5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ |
6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ | 6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "sandbox/sandbox_export.h" | 10 #include "sandbox/sandbox_export.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 class ResultExprImpl : public base::RefCounted<ResultExprImpl> { | 40 class ResultExprImpl : public base::RefCounted<ResultExprImpl> { |
41 public: | 41 public: |
42 // Compile uses |pc| to construct an ErrorCode analogous to the represented | 42 // Compile uses |pc| to construct an ErrorCode analogous to the represented |
43 // result expression. | 43 // result expression. |
44 virtual ErrorCode Compile(PolicyCompiler* pc) const = 0; | 44 virtual ErrorCode Compile(PolicyCompiler* pc) const = 0; |
45 | 45 |
46 // HasUnsafeTraps returns whether the result expression is or recursively | 46 // HasUnsafeTraps returns whether the result expression is or recursively |
47 // contains an unsafe trap expression. | 47 // contains an unsafe trap expression. |
48 virtual bool HasUnsafeTraps() const; | 48 virtual bool HasUnsafeTraps() const; |
49 | 49 |
| 50 // IsAllow returns whether the result expression is an "allow" result. |
| 51 virtual bool IsAllow() const; |
| 52 |
| 53 // IsAllow returns whether the result expression is a "deny" result. |
| 54 virtual bool IsDeny() const; |
| 55 |
50 protected: | 56 protected: |
51 ResultExprImpl() {} | 57 ResultExprImpl() {} |
52 virtual ~ResultExprImpl() {} | 58 virtual ~ResultExprImpl() {} |
53 | 59 |
54 private: | 60 private: |
55 friend class base::RefCounted<ResultExprImpl>; | 61 friend class base::RefCounted<ResultExprImpl>; |
56 DISALLOW_COPY_AND_ASSIGN(ResultExprImpl); | 62 DISALLOW_COPY_AND_ASSIGN(ResultExprImpl); |
57 }; | 63 }; |
58 | 64 |
59 } // namespace internal | 65 } // namespace internal |
60 } // namespace bpf_dsl | 66 } // namespace bpf_dsl |
61 } // namespace sandbox | 67 } // namespace sandbox |
62 | 68 |
63 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ | 69 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_ |
OLD | NEW |