metrics: add typechecking to metric result protos

This CL adds the ability to check the types of fields returned from
SQL proto builder functions to ensure that the generated protos are
well formed. We also set the foundation for proper support for nested
repeated fields here.

Finally, add support for null messages resulting in the proto field
not being set.

Bug: 133300274
Change-Id: I0f0df97215239b05bea7ea534221042f815f95ee
diff --git a/protos/BUILD b/protos/BUILD
index 579fd21..8d1834a 100644
--- a/protos/BUILD
+++ b/protos/BUILD
@@ -758,6 +758,24 @@
     ],
 )
 
+# GN target: //protos/perfetto/trace_processor:metrics_impl_zero_gen
+proto_library(
+    name = "trace_processor_metrics_impl_zero",
+    srcs = [
+        "perfetto/trace_processor/metrics_impl.proto",
+    ],
+)
+
+# GN target: //protos/perfetto/trace_processor:metrics_impl_zero_gen
+pbzero_cc_proto_library(
+    name = "trace_processor_metrics_impl_zero_cc_proto",
+    src_proto_library = "//third_party/perfetto/protos:trace_processor_metrics_impl_zero",
+    deps = [
+        "//third_party/perfetto:libprotozero",
+        "//third_party/perfetto/google:gtest_prod",
+    ],
+)
+
 # GN target: //protos/perfetto/trace/profiling:lite_gen
 proto_library(
     name = "trace_profiling",