DescriptionDecouple 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
Messages
Total messages: 9 (2 generated)
|