| OLD | NEW | 
|   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 MOJO_PUBLIC_CPP_BINDINGS_LIB_BOUNDS_CHECKER_H_ |   5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BOUNDS_CHECKER_H_ | 
|   6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BOUNDS_CHECKER_H_ |   6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BOUNDS_CHECKER_H_ | 
|   7  |   7  | 
|   8 #include <stddef.h> |   8 #include <stddef.h> | 
|   9 #include <stdint.h> |   9 #include <stdint.h> | 
|  10  |  10  | 
|  11 #include "mojo/public/cpp/system/macros.h" |  11 #include "base/macros.h" | 
|  12  |  12  | 
|  13 namespace mojo { |  13 namespace mojo { | 
|  14  |  14  | 
|  15 class Handle; |  15 class Handle; | 
|  16  |  16  | 
|  17 namespace internal { |  17 namespace internal { | 
|  18  |  18  | 
|  19 // BoundsChecker is used to validate object sizes, pointers and handle indices |  19 // BoundsChecker is used to validate object sizes, pointers and handle indices | 
|  20 // for payload of incoming messages. |  20 // for payload of incoming messages. | 
|  21 class BoundsChecker { |  21 class BoundsChecker { | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
|  48   bool InternalIsValidRange(uintptr_t begin, uintptr_t end) const; |  48   bool InternalIsValidRange(uintptr_t begin, uintptr_t end) const; | 
|  49  |  49  | 
|  50   // [data_begin_, data_end_) is the valid memory range. |  50   // [data_begin_, data_end_) is the valid memory range. | 
|  51   uintptr_t data_begin_; |  51   uintptr_t data_begin_; | 
|  52   uintptr_t data_end_; |  52   uintptr_t data_end_; | 
|  53  |  53  | 
|  54   // [handle_begin_, handle_end_) is the valid handle index range. |  54   // [handle_begin_, handle_end_) is the valid handle index range. | 
|  55   uint32_t handle_begin_; |  55   uint32_t handle_begin_; | 
|  56   uint32_t handle_end_; |  56   uint32_t handle_end_; | 
|  57  |  57  | 
|  58   MOJO_DISALLOW_COPY_AND_ASSIGN(BoundsChecker); |  58   DISALLOW_COPY_AND_ASSIGN(BoundsChecker); | 
|  59 }; |  59 }; | 
|  60  |  60  | 
|  61 }  // namespace internal |  61 }  // namespace internal | 
|  62 }  // namespace mojo |  62 }  // namespace mojo | 
|  63  |  63  | 
|  64 #endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_BOUNDS_CHECKER_H_ |  64 #endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_BOUNDS_CHECKER_H_ | 
| OLD | NEW |