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

Unified Diff: sandbox/linux/seccomp-bpf/codegen.h

Issue 11363212: Added support for greylisting of system calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with more meat Created 8 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
Index: sandbox/linux/seccomp-bpf/codegen.h
diff --git a/sandbox/linux/seccomp-bpf/codegen.h b/sandbox/linux/seccomp-bpf/codegen.h
index b7d1d3904cc3189479ee2f0f97e28e891c44be44..079aa6c0ee417ec454df81e9704b1494d08dde1b 100644
--- a/sandbox/linux/seccomp-bpf/codegen.h
+++ b/sandbox/linux/seccomp-bpf/codegen.h
@@ -77,6 +77,12 @@ class CodeGen {
// or if a (conditional) jump still has an unsatisfied target.
void JoinInstructions(Instruction *head, Instruction *tail);
+ // Traverse the graph of instructions and visit each instruction once.
+ // Traversal order is implementation-defined. It is acceptable to make
+ // changes to the graph from within the callback function. These changes
+ // do not affect traversal.
+ void Traverse(Instruction *, void (*fnc)(Instruction *, void *), void *);
jln (very slow on Chromium) 2012/11/15 01:51:52 Please, name and document the parameter, this is i
+
// Compiles the graph of instructions into a BPF program that can be passed
// to the kernel. Please note that this function modifies the graph in place
// and must therefore only be called once per graph.
@@ -85,6 +91,9 @@ class CodeGen {
private:
friend class CodeGenUnittestHelper;
+ // Helper function for Traverse()
jln (very slow on Chromium) 2012/11/15 01:51:52 Nit: "." at the end.
+ void TraverseRecursively(std::set<Instruction *> *, Instruction *);
jln (very slow on Chromium) 2012/11/15 01:51:52 Same here
+
// Find all the instructions that are the target of BPF_JMPs.
void FindBranchTargets(const Instruction& instructions,
BranchTargets *branch_targets);

Powered by Google App Engine
This is Rietveld 408576698