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

Side by Side Diff: sandbox/linux/seccomp-bpf/errorcode.h

Issue 572753002: Decouple Trap from ErrorCode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | sandbox/linux/seccomp-bpf/errorcode.cc » ('j') | sandbox/linux/seccomp-bpf/trap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ERRORCODE_H__ 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_ERRORCODE_H__
6 #define SANDBOX_LINUX_SECCOMP_BPF_ERRORCODE_H__ 6 #define SANDBOX_LINUX_SECCOMP_BPF_ERRORCODE_H__
7 7
8 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h" 8 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
9 #include "sandbox/linux/seccomp-bpf/trap.h" 9 #include "sandbox/linux/seccomp-bpf/trap.h"
10 #include "sandbox/sandbox_export.h" 10 #include "sandbox/sandbox_export.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 }; 148 };
149 149
150 private: 150 private:
151 friend class CodeGen; 151 friend class CodeGen;
152 friend class SandboxBPF; 152 friend class SandboxBPF;
153 friend class Trap; 153 friend class Trap;
154 154
155 // If we are wrapping a callback, we must assign a unique id. This id is 155 // If we are wrapping a callback, we must assign a unique id. This id is
156 // how the kernel tells us which one of our different SECCOMP_RET_TRAP 156 // how the kernel tells us which one of our different SECCOMP_RET_TRAP
157 // cases has been triggered. 157 // cases has been triggered.
158 ErrorCode(Trap::TrapFnc fnc, const void* aux, bool safe, uint16_t id); 158 ErrorCode(Trap::TrapFnc fnc, const void* aux, bool safe);
159 159
160 // Some system calls require inspection of arguments. This constructor 160 // Some system calls require inspection of arguments. This constructor
161 // allows us to specify additional constraints. 161 // allows us to specify additional constraints.
162 ErrorCode(int argno, 162 ErrorCode(int argno,
163 ArgType width, 163 ArgType width,
164 uint64_t mask, 164 uint64_t mask,
165 uint64_t value, 165 uint64_t value,
166 const ErrorCode* passed, 166 const ErrorCode* passed,
167 const ErrorCode* failed); 167 const ErrorCode* failed);
168 168
(...skipping 20 matching lines...) Expand all
189 189
190 // 32bit field used for all possible types of ErrorCode values. This is 190 // 32bit field used for all possible types of ErrorCode values. This is
191 // the value that uniquely identifies any ErrorCode and it (typically) can 191 // the value that uniquely identifies any ErrorCode and it (typically) can
192 // be emitted directly into a BPF filter program. 192 // be emitted directly into a BPF filter program.
193 uint32_t err_; 193 uint32_t err_;
194 }; 194 };
195 195
196 } // namespace sandbox 196 } // namespace sandbox
197 197
198 #endif // SANDBOX_LINUX_SECCOMP_BPF_ERRORCODE_H__ 198 #endif // SANDBOX_LINUX_SECCOMP_BPF_ERRORCODE_H__
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/errorcode.cc » ('j') | sandbox/linux/seccomp-bpf/trap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698