Index: mojo/public/bindings/lib/array_internal.cc |
diff --git a/mojo/public/bindings/lib/array_internal.cc b/mojo/public/bindings/lib/array_internal.cc |
index a4ea9302d3b5d62be0007cd6994da7811b07b252..17a26b2157337dda85206f5d00296a654e30c8bd 100644 |
--- a/mojo/public/bindings/lib/array_internal.cc |
+++ b/mojo/public/bindings/lib/array_internal.cc |
@@ -34,5 +34,26 @@ ArrayDataTraits<bool>::BitRef::operator bool() const { |
return (*storage_ & mask_) != 0; |
} |
+// static |
+void ArraySerializationHelper<Handle>::EncodePointersAndHandles( |
+ const ArrayHeader* header, |
+ ElementType* elements, |
+ std::vector<Handle>* handles) { |
+ for (uint32_t i = 0; i < header->num_elements; ++i) |
+ EncodeHandle(&elements[i], handles); |
+} |
+ |
+// static |
+bool ArraySerializationHelper<Handle>::DecodePointersAndHandles( |
+ const ArrayHeader* header, |
+ ElementType* elements, |
+ Message* message) { |
+ for (uint32_t i = 0; i < header->num_elements; ++i) { |
+ if (!DecodeHandle(&elements[i], &message->handles)) |
+ return false; |
+ } |
+ return true; |
+} |
+ |
} // namespace internal |
} // namespace mojo |