Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Unified Diff: mojo/public/c/bindings/array.h

Issue 2200843002: C bindings: Implement _DeepCopy() & some unittests. (Closed) Base URL: git@github.com:domokit/mojo.git@cgen_validate
Patch Set: oops, include c.sha1. also properly merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/c/bindings/lib/array.c » ('j') | mojo/public/c/bindings/lib/array.c » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/bindings/array.h
diff --git a/mojo/public/c/bindings/array.h b/mojo/public/c/bindings/array.h
index 93134be53e9ad0fc53ed25e49b8e54d197b1f3dd..2051e295c3f2fdf7371921f759aa3a65e7e4f8c5 100644
--- a/mojo/public/c/bindings/array.h
+++ b/mojo/public/c/bindings/array.h
@@ -114,6 +114,21 @@ MojomValidationResult MojomArray_Validate(
uint32_t in_num_handles,
struct MojomValidationContext* inout_context);
+// Creates a new copy of |in_array| using |buffer| to allocate space.
+// Recursively creates new copies of any references from |in_array|, and
+// updates the references to point to the new copies. All handles are moved
+// from |in_array| to the new copy (the copies in |in_array| are assigned an
+// invalid handle value). This operation is useful if you want to linearize
+// |in_array| using the buffer backed by |buffer|. The new copy of the array
+// is returned.
+// |buffer|: A mojom buffer used to allocate space for the new array.
viettrungluu 2016/08/02 20:15:06 What's the size/space requirement on |buffer|?
+// |in_type_desc|: Describes the pointer and handle fields of the mojom array.
+// |in_array|: The unencoded mojom array to be copied.
+struct MojomArrayHeader* MojomArray_DeepCopy(
+ struct MojomBuffer* buffer,
+ const struct MojomTypeDescriptorArray* in_type_desc,
+ struct MojomArrayHeader* in_array);
+
MOJO_END_EXTERN_C
#endif // MOJO_PUBLIC_C_BINDINGS_ARRAY_H_
« no previous file with comments | « no previous file | mojo/public/c/bindings/lib/array.c » ('j') | mojo/public/c/bindings/lib/array.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698