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

Side by Side Diff: sandbox/linux/seccomp-bpf/syscall_iterator.h

Issue 66723007: Make sandbox/linux/seccomp-bpf/ follow the style guide. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (empty) rebase Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp-bpf/syscall.h ('k') | sandbox/linux/seccomp-bpf/syscall_iterator.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_SECCOMP_BPF_SYSCALL_ITERATOR_H__ 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_ITERATOR_H__
6 #define SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_ITERATOR_H__ 6 #define SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_ITERATOR_H__
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 namespace playground2 { 10 namespace playground2 {
(...skipping 14 matching lines...) Expand all
25 // Example usage: 25 // Example usage:
26 // for (SyscallIterator iter(false); !iter.Done(); ) { 26 // for (SyscallIterator iter(false); !iter.Done(); ) {
27 // uint32_t sysnum = iter.Next(); 27 // uint32_t sysnum = iter.Next();
28 // // Do something with sysnum. 28 // // Do something with sysnum.
29 // } 29 // }
30 // 30 //
31 // TODO(markus): Make this a classic C++ iterator. 31 // TODO(markus): Make this a classic C++ iterator.
32 class SyscallIterator { 32 class SyscallIterator {
33 public: 33 public:
34 explicit SyscallIterator(bool invalid_only) 34 explicit SyscallIterator(bool invalid_only)
35 : invalid_only_(invalid_only), 35 : invalid_only_(invalid_only), done_(false), num_(0) {}
36 done_(false),
37 num_(0) {}
38 36
39 bool Done() const { return done_; } 37 bool Done() const { return done_; }
40 uint32_t Next(); 38 uint32_t Next();
41 static bool IsValid(uint32_t num); 39 static bool IsValid(uint32_t num);
42 40
43 private: 41 private:
44 static bool IsArmPrivate(uint32_t num); 42 static bool IsArmPrivate(uint32_t num);
45 43
46 bool invalid_only_; 44 bool invalid_only_;
47 bool done_; 45 bool done_;
48 uint32_t num_; 46 uint32_t num_;
49 47
50 DISALLOW_IMPLICIT_CONSTRUCTORS(SyscallIterator); 48 DISALLOW_IMPLICIT_CONSTRUCTORS(SyscallIterator);
51 }; 49 };
52 50
53 } // namespace playground2 51 } // namespace playground2
54 52
55 #endif // SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_ITERATOR_H__ 53 #endif // SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_ITERATOR_H__
56
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/syscall.h ('k') | sandbox/linux/seccomp-bpf/syscall_iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698