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

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

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/bpf_dsl/bpf_dsl_more_unittest.cc » ('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
15 namespace bpf_dsl {
16 class PolicyCompiler;
17
18 namespace internal {
19
20 // Internal interface implemented by BoolExpr implementations.
21 class BoolExprImpl : public base::RefCounted<BoolExprImpl> {
22 public:
23 // Compile uses |pc| to construct an ErrorCode that conditionally continues
24 // to either |true_ec| or |false_ec|, depending on whether the represented
25 // boolean expression is true or false.
26 virtual ErrorCode Compile(PolicyCompiler* pc,
27 ErrorCode true_ec,
28 ErrorCode false_ec) const = 0;
29
30 protected:
31 BoolExprImpl() {}
32 virtual ~BoolExprImpl() {}
33
34 private:
35 friend class base::RefCounted<BoolExprImpl>;
36 DISALLOW_COPY_AND_ASSIGN(BoolExprImpl);
37 };
38
39 // Internal interface implemented by ResultExpr implementations.
40 class ResultExprImpl : public base::RefCounted<ResultExprImpl> {
41 public:
42 // Compile uses |pc| to construct an ErrorCode analogous to the represented
43 // result expression.
44 virtual ErrorCode Compile(PolicyCompiler* pc) const = 0;
45
46 // HasUnsafeTraps returns whether the result expression is or recursively
47 // contains an unsafe trap expression.
48 virtual bool HasUnsafeTraps() const;
49
50 protected:
51 ResultExprImpl() {}
52 virtual ~ResultExprImpl() {}
53
54 private:
55 friend class base::RefCounted<ResultExprImpl>;
56 DISALLOW_COPY_AND_ASSIGN(ResultExprImpl);
57 };
58
59 } // namespace internal
60 } // namespace bpf_dsl
61 } // namespace sandbox
62
63 #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/bpf_dsl/bpf_dsl_more_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698