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

Unified Diff: sandbox/linux/bpf_dsl/test_trap_registry.h

Issue 1292753009: sandbox/linux: move ErrorCode into bpf_dsl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bpf_dsl-deps
Patch Set: Rebase and cleanup test code Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/bpf_dsl/policy_compiler.cc ('k') | sandbox/linux/bpf_dsl/test_trap_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/bpf_dsl/test_trap_registry.h
diff --git a/sandbox/linux/bpf_dsl/test_trap_registry.h b/sandbox/linux/bpf_dsl/test_trap_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..161f28e34c9b6905c180732d1c27c2d86bdeadc7
--- /dev/null
+++ b/sandbox/linux/bpf_dsl/test_trap_registry.h
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SANDBOX_LINUX_BPF_DSL_TEST_TRAP_REGISTRY_H_
+#define SANDBOX_LINUX_BPF_DSL_TEST_TRAP_REGISTRY_H_
+
+#include <stdint.h>
+
+#include <map>
+#include <utility>
+
+#include "sandbox/linux/bpf_dsl/trap_registry.h"
+
+namespace sandbox {
+namespace bpf_dsl {
+
+class TestTrapRegistry : public TrapRegistry {
+ public:
+ TestTrapRegistry();
+ virtual ~TestTrapRegistry();
+
+ uint16_t Add(TrapFnc fnc, const void* aux, bool safe) override;
+ bool EnableUnsafeTraps() override;
+
+ private:
+ using Key = std::pair<TrapFnc, const void*>;
+
+ std::map<Key, uint16_t> map_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestTrapRegistry);
+};
+
+} // namespace bpf_dsl
+} // namespace sandbox
+
+#endif // SANDBOX_LINUX_BPF_DSL_TEST_TRAP_REGISTRY_H_
« no previous file with comments | « sandbox/linux/bpf_dsl/policy_compiler.cc ('k') | sandbox/linux/bpf_dsl/test_trap_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698