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

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

Issue 944823002: Revert of bpf_dsl: Change bpf_dsl_unittests into actual standalone unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/seccomp_macros.h ('k') | sandbox/linux/seccomp-bpf/trap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_TRAP_REGISTRY_H_ 5 #ifndef SANDBOX_LINUX_BPF_DSL_TRAP_REGISTRY_H_
6 #define SANDBOX_LINUX_BPF_DSL_TRAP_REGISTRY_H_ 6 #define SANDBOX_LINUX_BPF_DSL_TRAP_REGISTRY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // time of the trap registry. If the same tuple is registered 46 // time of the trap registry. If the same tuple is registered
47 // multiple times, the same value will be returned each time. 47 // multiple times, the same value will be returned each time.
48 virtual uint16_t Add(TrapFnc fnc, const void* aux, bool safe) = 0; 48 virtual uint16_t Add(TrapFnc fnc, const void* aux, bool safe) = 0;
49 49
50 // EnableUnsafeTraps tries to enable unsafe traps and returns 50 // EnableUnsafeTraps tries to enable unsafe traps and returns
51 // whether it was successful. This is a one-way operation. 51 // whether it was successful. This is a one-way operation.
52 virtual bool EnableUnsafeTraps() = 0; 52 virtual bool EnableUnsafeTraps() = 0;
53 53
54 protected: 54 protected:
55 TrapRegistry() {} 55 TrapRegistry() {}
56
57 // TrapRegistry's destructor is intentionally non-virtual so that
58 // implementations can omit their destructor. Instead we protect against
59 // misuse by marking it protected.
60 ~TrapRegistry() {} 56 ~TrapRegistry() {}
61 57
62 DISALLOW_COPY_AND_ASSIGN(TrapRegistry); 58 DISALLOW_COPY_AND_ASSIGN(TrapRegistry);
63 }; 59 };
64 60
65 } // namespace bpf_dsl 61 } // namespace bpf_dsl
66 } // namespace sandbox 62 } // namespace sandbox
67 63
68 #endif // SANDBOX_LINUX_BPF_DSL_TRAP_REGISTRY_H_ 64 #endif // SANDBOX_LINUX_BPF_DSL_TRAP_REGISTRY_H_
OLDNEW
« no previous file with comments | « sandbox/linux/bpf_dsl/seccomp_macros.h ('k') | sandbox/linux/seccomp-bpf/trap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698