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

Unified Diff: mojom/generators/c/templates/struct.tmpl.go

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
Index: mojom/generators/c/templates/struct.tmpl.go
diff --git a/mojom/generators/c/templates/struct.tmpl.go b/mojom/generators/c/templates/struct.tmpl.go
index 7cefe7824c66dc78fe74c3fbfdc295b1e72ab203..9f8402acda965ba7c530779f11b0ad4c0db1eb2b 100644
--- a/mojom/generators/c/templates/struct.tmpl.go
+++ b/mojom/generators/c/templates/struct.tmpl.go
@@ -38,7 +38,7 @@ void {{$struct.Name}}_CloseAllHandles(
struct {{$struct.Name}}* {{$struct.Name}}_DeepCopy(
struct MojomBuffer* in_buffer,
- struct {{$struct.Name}}* in_data);
+ struct {{$struct.Name}}* in_struct);
size_t {{$struct.Name}}_ComputeSerializedSize(
const struct {{$struct.Name}}* in_data);
@@ -68,6 +68,14 @@ const GenerateStructDefinitions = `
const {{$const.Type}} {{$const.Name}} = {{$const.Value}};
{{end -}}
+struct {{$struct.Name}}* {{$struct.Name}}_DeepCopy(
+ struct MojomBuffer* in_buffer,
+ struct {{$struct.Name}}* in_struct) {
+ return (struct {{$struct.Name}}*)MojomStruct_DeepCopy(
+ in_buffer, &{{$struct.Name}}__TypeDesc,
+ (struct MojomStructHeader*)in_struct);
+}
+
size_t {{$struct.Name}}_ComputeSerializedSize(
const struct {{$struct.Name}}* in_data) {
return MojomStruct_ComputeSerializedSize(

Powered by Google App Engine
This is Rietveld 408576698