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
3 // found in the LICENSE file.
5 #include "mojo/public/bindings/lib/array_internal.h"
10 ArrayDataTraits<bool>::BitRef::~BitRef() {
13 ArrayDataTraits<bool>::BitRef::BitRef(uint8_t* storage, uint8_t mask)
18 ArrayDataTraits<bool>::BitRef&
19 ArrayDataTraits<bool>::BitRef::operator=(bool value) {
28 ArrayDataTraits<bool>::BitRef&
29 ArrayDataTraits<bool>::BitRef::operator=(const BitRef& value) {
30 return (*this) = static_cast<bool>(value);
33 ArrayDataTraits<bool>::BitRef::operator bool() const {
34 return (*storage_ & mask_) != 0;
38 void ArraySerializationHelper<Handle>::EncodePointersAndHandles(
39 const ArrayHeader* header,
40 ElementType* elements,
41 std::vector<Handle>* handles) {
42 for (uint32_t i = 0; i < header->num_elements; ++i)
43 EncodeHandle(&elements[i], handles);
47 bool ArraySerializationHelper<Handle>::DecodePointersAndHandles(
48 const ArrayHeader* header,
49 ElementType* elements,
51 for (uint32_t i = 0; i < header->num_elements; ++i) {
52 if (!DecodeHandle(&elements[i], message->mutable_handles()))
58 } // namespace internal