OLD | NEW |
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_BPF_H__ | 5 #ifndef SANDBOX_BPF_H__ |
6 #define SANDBOX_BPF_H__ | 6 #define SANDBOX_BPF_H__ |
7 | 7 |
8 #include <endian.h> | 8 #include <endian.h> |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 // Get a file descriptor pointing to "/proc", if currently available. | 318 // Get a file descriptor pointing to "/proc", if currently available. |
319 static int getProcFd() { return proc_fd_; } | 319 static int getProcFd() { return proc_fd_; } |
320 | 320 |
321 private: | 321 private: |
322 friend class Util; | 322 friend class Util; |
323 friend class Verifier; | 323 friend class Verifier; |
324 struct Range { | 324 struct Range { |
325 Range(uint32_t f, uint32_t t, ErrorCode e) : | 325 Range(uint32_t f, uint32_t t, const ErrorCode& e) : |
326 from(f), | 326 from(f), |
327 to(t), | 327 to(t), |
328 err(e) { | 328 err(e) { |
329 } | 329 } |
330 uint32_t from, to; | 330 uint32_t from, to; |
331 ErrorCode err; | 331 ErrorCode err; |
332 }; | 332 }; |
333 struct FixUp { | 333 struct FixUp { |
334 FixUp(unsigned int a, bool j) : | 334 FixUp(unsigned int a, bool j) : |
335 jt(j), addr(a) { } | 335 jt(j), addr(a) { } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 static Traps *traps_; | 371 static Traps *traps_; |
372 static TrapIds trapIds_; | 372 static TrapIds trapIds_; |
373 static ErrorCode *trapArray_; | 373 static ErrorCode *trapArray_; |
374 static size_t trapArraySize_; | 374 static size_t trapArraySize_; |
375 DISALLOW_IMPLICIT_CONSTRUCTORS(Sandbox); | 375 DISALLOW_IMPLICIT_CONSTRUCTORS(Sandbox); |
376 }; | 376 }; |
377 | 377 |
378 } // namespace | 378 } // namespace |
379 | 379 |
380 #endif // SANDBOX_BPF_H__ | 380 #endif // SANDBOX_BPF_H__ |
OLD | NEW |