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

Side by Side Diff: sandbox/linux/bpf_dsl/bpf_dsl.h

Issue 1108173002: Roll //build, //native_client, and a few more targets of opportunity. Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Test fix Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « sandbox/linux/BUILD.gn ('k') | sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ 5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_
6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ 6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 15 matching lines...) Expand all
26 // An idiomatic and demonstrative (albeit silly) example of this API 26 // An idiomatic and demonstrative (albeit silly) example of this API
27 // would be: 27 // would be:
28 // 28 //
29 // #include "sandbox/linux/bpf_dsl/bpf_dsl.h" 29 // #include "sandbox/linux/bpf_dsl/bpf_dsl.h"
30 // 30 //
31 // using namespace sandbox::bpf_dsl; 31 // using namespace sandbox::bpf_dsl;
32 // 32 //
33 // class SillyPolicy : public Policy { 33 // class SillyPolicy : public Policy {
34 // public: 34 // public:
35 // SillyPolicy() {} 35 // SillyPolicy() {}
36 // virtual ~SillyPolicy() {} 36 // ~SillyPolicy() override {}
37 // virtual ResultExpr EvaluateSyscall(int sysno) const override { 37 // ResultExpr EvaluateSyscall(int sysno) const override {
38 // if (sysno == __NR_fcntl) { 38 // if (sysno == __NR_fcntl) {
39 // Arg<int> fd(0), cmd(1); 39 // Arg<int> fd(0), cmd(1);
40 // Arg<unsigned long> flags(2); 40 // Arg<unsigned long> flags(2);
41 // const uint64_t kGoodFlags = O_ACCMODE | O_NONBLOCK; 41 // const uint64_t kGoodFlags = O_ACCMODE | O_NONBLOCK;
42 // return If(fd == 0 && cmd == F_SETFL && (flags & ~kGoodFlags) == 0, 42 // return If(fd == 0 && cmd == F_SETFL && (flags & ~kGoodFlags) == 0,
43 // Allow()) 43 // Allow())
44 // .ElseIf(cmd == F_DUPFD || cmd == F_DUPFD_CLOEXEC, 44 // .ElseIf(cmd == F_DUPFD || cmd == F_DUPFD_CLOEXEC,
45 // Error(EMFILE)) 45 // Error(EMFILE))
46 // .Else(Trap(SetFlagHandler, NULL)); 46 // .Else(Trap(SetFlagHandler, NULL));
47 // } else { 47 // } else {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 template <typename T> 309 template <typename T>
310 ResultExpr Caser<T>::Default(ResultExpr result) const { 310 ResultExpr Caser<T>::Default(ResultExpr result) const {
311 return elser_.Else(result); 311 return elser_.Else(result);
312 } 312 }
313 313
314 } // namespace bpf_dsl 314 } // namespace bpf_dsl
315 } // namespace sandbox 315 } // namespace sandbox
316 316
317 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ 317 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_
OLDNEW
« no previous file with comments | « sandbox/linux/BUILD.gn ('k') | sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698