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

Issue 572753002: Decouple Trap from ErrorCode (Closed)

Created:
6 years, 3 months ago by mdempsky
Modified:
6 years, 3 months ago
CC:
chromium-reviews, jln+watch_chromium.org, rickyz (no longer on Chrome)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Decouple Trap from ErrorCode This CL makes a few changes in the direction of removing dependencies on ErrorCode by pushing them up a layer: - Trap now simply uses TrapKeys directly to store trap function and metadata instead of needlessly encoding them as ErrorCode. - MakeTrap returns a bare trap ID and it's instead the caller's responsibility to encode in an ErrorCode if needed, which is now handled by ErrorCode's trap constructor. - Also, ErrorCodeFromTrapId() is replaced by IsSafeTrapId() to answer the one question that SandboxBPF was interested in knowing about existing traps. - Change a few SandboxBPF trap-constructing functions into static functions since they don't depend on any SandboxBPF instance member variables. BUG=414363 Committed: https://crrev.com/af240444899ad7ff5c7f0209c5865ce36ac9c92a Cr-Commit-Position: refs/heads/master@{#295121}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix indenting; revert volatile changes #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -103 lines) Patch
M sandbox/linux/seccomp-bpf/errorcode.h View 1 chunk +1 line, -1 line 0 comments Download
M sandbox/linux/seccomp-bpf/errorcode.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.h View 5 chunks +5 lines, -18 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 2 chunks +3 lines, -5 lines 0 comments Download
M sandbox/linux/seccomp-bpf/trap.h View 1 5 chunks +15 lines, -8 lines 0 comments Download
M sandbox/linux/seccomp-bpf/trap.cc View 1 8 chunks +78 lines, -69 lines 2 comments Download

Messages

Total messages: 9 (2 generated)
mdempsky
6 years, 3 months ago (2014-09-15 20:15:24 UTC) #2
leecam
LGTM - This is so much cleaner! One thing I did use was ErrorCodeFromTrapId in ...
6 years, 3 months ago (2014-09-16 12:36:45 UTC) #3
jln (very slow on Chromium)
lgtm, nice cleanup! https://codereview.chromium.org/572753002/diff/20001/sandbox/linux/seccomp-bpf/trap.cc File sandbox/linux/seccomp-bpf/trap.cc (right): https://codereview.chromium.org/572753002/diff/20001/sandbox/linux/seccomp-bpf/trap.cc#newcode339 sandbox/linux/seccomp-bpf/trap.cc:339: // TODO(mdempsky): Try to clean this ...
6 years, 3 months ago (2014-09-16 17:47:46 UTC) #4
mdempsky
> One thing I did use was ErrorCodeFromTrapId in the logging stuff to get the ...
6 years, 3 months ago (2014-09-16 18:48:20 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/572753002/20001
6 years, 3 months ago (2014-09-16 18:49:03 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001) as 01c27cbe0b693cb5a0b274a32a4cf88a5eafeea1
6 years, 3 months ago (2014-09-16 19:16:38 UTC) #8
commit-bot: I haz the power
6 years, 3 months ago (2014-09-16 19:18:23 UTC) #9
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/af240444899ad7ff5c7f0209c5865ce36ac9c92a
Cr-Commit-Position: refs/heads/master@{#295121}

Powered by Google App Engine
This is Rietveld 408576698