| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SECCOMP_BPF_TRAP_H__ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__ |
| 6 #define SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__ |
| 7 | 7 |
| 8 #include <signal.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <map> | 11 #include <map> |
| 9 #include <vector> | 12 #include <vector> |
| 10 | 13 |
| 14 #include "sandbox/linux/seccomp-bpf/port.h" |
| 15 |
| 16 |
| 11 namespace playground2 { | 17 namespace playground2 { |
| 12 | 18 |
| 13 class ErrorCode; | 19 class ErrorCode; |
| 14 | 20 |
| 15 // The Trap class allows a BPF filter program to branch out to user space by | 21 // The Trap class allows a BPF filter program to branch out to user space by |
| 16 // raising a SIGSYS signal. | 22 // raising a SIGSYS signal. |
| 17 // N.B.: This class does not perform any synchronization operations. If | 23 // N.B.: This class does not perform any synchronization operations. If |
| 18 // modifications are made to any of the traps, it is the caller's | 24 // modifications are made to any of the traps, it is the caller's |
| 19 // responsibility to ensure that this happens in a thread-safe fashion. | 25 // responsibility to ensure that this happens in a thread-safe fashion. |
| 20 // Preferably, that means that no other threads should be running at that | 26 // Preferably, that means that no other threads should be running at that |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Our constructor is private. A shared global instance is created | 111 // Our constructor is private. A shared global instance is created |
| 106 // automatically as needed. | 112 // automatically as needed. |
| 107 // Copying and assigning is unimplemented. It doesn't make sense for a | 113 // Copying and assigning is unimplemented. It doesn't make sense for a |
| 108 // singleton. | 114 // singleton. |
| 109 DISALLOW_IMPLICIT_CONSTRUCTORS(Trap); | 115 DISALLOW_IMPLICIT_CONSTRUCTORS(Trap); |
| 110 }; | 116 }; |
| 111 | 117 |
| 112 } // namespace playground2 | 118 } // namespace playground2 |
| 113 | 119 |
| 114 #endif // SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__ | 120 #endif // SANDBOX_LINUX_SECCOMP_BPF_TRAP_H__ |
| OLD | NEW |