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

Side by Side Diff: sandbox/linux/bpf_dsl/bpf_dsl_impl.h

Issue 635223006: bpf_dsl: Move {Bool,Result}ExprImpl definition into separate header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « sandbox/linux/bpf_dsl/bpf_dsl.cc ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « sandbox/linux/bpf_dsl/bpf_dsl.cc ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698