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

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

Issue 570163003: Large IWYU cleanup for seccomp-bpf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trap-errorcode
Patch Set: Sort #includes 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 | « sandbox/linux/seccomp-bpf/errorcode.h ('k') | sandbox/linux/seccomp-bpf/errorcode_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
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 #include "sandbox/linux/seccomp-bpf/die.h"
6 #include "sandbox/linux/seccomp-bpf/errorcode.h" 5 #include "sandbox/linux/seccomp-bpf/errorcode.h"
7 6
7 #include "sandbox/linux/seccomp-bpf/die.h"
8 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
9
8 namespace sandbox { 10 namespace sandbox {
9 11
12 ErrorCode::ErrorCode() : error_type_(ET_INVALID), err_(SECCOMP_RET_INVALID) {
13 }
14
10 ErrorCode::ErrorCode(int err) { 15 ErrorCode::ErrorCode(int err) {
11 switch (err) { 16 switch (err) {
12 case ERR_ALLOWED: 17 case ERR_ALLOWED:
13 err_ = SECCOMP_RET_ALLOW; 18 err_ = SECCOMP_RET_ALLOW;
14 error_type_ = ET_SIMPLE; 19 error_type_ = ET_SIMPLE;
15 break; 20 break;
16 case ERR_MIN_ERRNO... ERR_MAX_ERRNO: 21 case ERR_MIN_ERRNO... ERR_MAX_ERRNO:
17 err_ = SECCOMP_RET_ERRNO + err; 22 err_ = SECCOMP_RET_ERRNO + err;
18 error_type_ = ET_SIMPLE; 23 error_type_ = ET_SIMPLE;
19 break; 24 break;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } else { 103 } else {
99 return false; 104 return false;
100 } 105 }
101 } else { 106 } else {
102 SANDBOX_DIE("Corrupted ErrorCode"); 107 SANDBOX_DIE("Corrupted ErrorCode");
103 } 108 }
104 } 109 }
105 } 110 }
106 111
107 } // namespace sandbox 112 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/errorcode.h ('k') | sandbox/linux/seccomp-bpf/errorcode_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698