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.
5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_
6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "sandbox/sandbox_export.h"
19 // Internal interface implemented by BoolExpr implementations.
20 class BoolExprImpl
: public base::RefCounted
<BoolExprImpl
> {
23 virtual ErrorCode
Compile(SandboxBPF
* sb
,
25 ErrorCode false_ec
) const = 0;
28 virtual ~BoolExprImpl() {}
31 friend class base::RefCounted
<BoolExprImpl
>;
32 DISALLOW_COPY_AND_ASSIGN(BoolExprImpl
);
35 // Internal interface implemented by ResultExpr implementations.
36 class ResultExprImpl
: public base::RefCounted
<ResultExprImpl
> {
39 virtual ErrorCode
Compile(SandboxBPF
* sb
) const = 0;
40 virtual bool HasUnsafeTraps() const;
43 virtual ~ResultExprImpl() {}
46 friend class base::RefCounted
<ResultExprImpl
>;
47 DISALLOW_COPY_AND_ASSIGN(ResultExprImpl
);
50 } // namespace internal
51 } // namespace bpf_dsl
52 } // namespace sandbox
54 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_IMPL_H_