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

Unified Diff: sandbox/linux/seccomp-bpf/errorcode.cc

Issue 66723007: Make sandbox/linux/seccomp-bpf/ follow the style guide. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (empty) rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/seccomp-bpf/errorcode.h ('k') | sandbox/linux/seccomp-bpf/instruction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/errorcode.cc
diff --git a/sandbox/linux/seccomp-bpf/errorcode.cc b/sandbox/linux/seccomp-bpf/errorcode.cc
index ab89d73c3fa11180ddae67cd778ee207ebe67f55..e517d3811949bc0fa9a6b43d46337160112cdf6f 100644
--- a/sandbox/linux/seccomp-bpf/errorcode.cc
+++ b/sandbox/linux/seccomp-bpf/errorcode.cc
@@ -5,35 +5,36 @@
#include "sandbox/linux/seccomp-bpf/die.h"
#include "sandbox/linux/seccomp-bpf/errorcode.h"
-
namespace playground2 {
ErrorCode::ErrorCode(int err) {
switch (err) {
- case ERR_ALLOWED:
- err_ = SECCOMP_RET_ALLOW;
- error_type_ = ET_SIMPLE;
- break;
- case ERR_MIN_ERRNO ... ERR_MAX_ERRNO:
- err_ = SECCOMP_RET_ERRNO + err;
- error_type_ = ET_SIMPLE;
- break;
- default:
- SANDBOX_DIE("Invalid use of ErrorCode object");
+ case ERR_ALLOWED:
+ err_ = SECCOMP_RET_ALLOW;
+ error_type_ = ET_SIMPLE;
+ break;
+ case ERR_MIN_ERRNO... ERR_MAX_ERRNO:
+ err_ = SECCOMP_RET_ERRNO + err;
+ error_type_ = ET_SIMPLE;
+ break;
+ default:
+ SANDBOX_DIE("Invalid use of ErrorCode object");
}
}
-ErrorCode::ErrorCode(Trap::TrapFnc fnc, const void *aux, bool safe,
- uint16_t id)
+ErrorCode::ErrorCode(Trap::TrapFnc fnc, const void* aux, bool safe, uint16_t id)
: error_type_(ET_TRAP),
fnc_(fnc),
- aux_(const_cast<void *>(aux)),
+ aux_(const_cast<void*>(aux)),
safe_(safe),
- err_(SECCOMP_RET_TRAP + id) {
-}
+ err_(SECCOMP_RET_TRAP + id) {}
-ErrorCode::ErrorCode(int argno, ArgType width, Operation op, uint64_t value,
- const ErrorCode *passed, const ErrorCode *failed)
+ErrorCode::ErrorCode(int argno,
+ ArgType width,
+ Operation op,
+ uint64_t value,
+ const ErrorCode* passed,
+ const ErrorCode* failed)
: error_type_(ET_COND),
value_(value),
argno_(argno),
@@ -57,12 +58,9 @@ bool ErrorCode::Equals(const ErrorCode& err) const {
if (error_type_ == ET_SIMPLE || error_type_ == ET_TRAP) {
return err_ == err.err_;
} else if (error_type_ == ET_COND) {
- return value_ == err.value_ &&
- argno_ == err.argno_ &&
- width_ == err.width_ &&
- op_ == err.op_ &&
- passed_->Equals(*err.passed_) &&
- failed_->Equals(*err.failed_);
+ return value_ == err.value_ && argno_ == err.argno_ &&
+ width_ == err.width_ && op_ == err.op_ &&
+ passed_->Equals(*err.passed_) && failed_->Equals(*err.failed_);
} else {
SANDBOX_DIE("Corrupted ErrorCode");
}
« no previous file with comments | « sandbox/linux/seccomp-bpf/errorcode.h ('k') | sandbox/linux/seccomp-bpf/instruction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698