| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 5 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 namespace internal { | 8 namespace internal { |
| 9 | 9 |
| 10 ArrayDataTraits<bool>::BitRef::~BitRef() { | 10 ArrayDataTraits<bool>::BitRef::~BitRef() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 for (uint32_t i = 0; i < header->num_elements; ++i) | 51 for (uint32_t i = 0; i < header->num_elements; ++i) |
| 52 DecodeHandle(&elements[i], handles); | 52 DecodeHandle(&elements[i], handles); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // static | 55 // static |
| 56 bool ArraySerializationHelper<Handle, true>::ValidateElements( | 56 bool ArraySerializationHelper<Handle, true>::ValidateElements( |
| 57 const ArrayHeader* header, | 57 const ArrayHeader* header, |
| 58 const ElementType* elements, | 58 const ElementType* elements, |
| 59 BoundsChecker* bounds_checker) { | 59 BoundsChecker* bounds_checker) { |
| 60 for (uint32_t i = 0; i < header->num_elements; ++i) { | 60 for (uint32_t i = 0; i < header->num_elements; ++i) { |
| 61 if (!bounds_checker->ClaimHandle(elements[i])) | 61 if (!bounds_checker->ClaimHandle(elements[i])) { |
| 62 ReportValidationError(VALIDATION_ERROR_ILLEGAL_HANDLE); |
| 62 return false; | 63 return false; |
| 64 } |
| 63 } | 65 } |
| 64 return true; | 66 return true; |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace internal | 69 } // namespace internal |
| 68 } // namespace mojo | 70 } // namespace mojo |
| OLD | NEW |