Use protozero in .gen.cc proto->C++ classes
This CL is the major step towards geting rid of the
libprotobuf runtime dep (see go/perfetto-libprotobuf).
It switches the .gen.cc files to uses protozero for the
proto<>c++ conversions.
As-is it still support the legacy conversion from
libprotobuf-lite classes, but that is done going via
raw binary. So FromProto() now goes
pblite -> raw bytes -> pbzero decoder and ToProto() goes
pbzero -> raw_bytes -> pblite.
Effectively this doubles the round-trip for these two methods.
The next CLs will get rid of the FromProto/ToProto methods
and will switch the IPC layer to just use the .gen.cc classes
instead of the pblite ones.
Bug: 132880619
Change-Id: I721876c95dfa987b9aaa5a1009eeb64baa7e37dc
diff --git a/src/protozero/BUILD.gn b/src/protozero/BUILD.gn
index b2cc13a..3fcb869 100644
--- a/src/protozero/BUILD.gn
+++ b/src/protozero/BUILD.gn
@@ -28,6 +28,7 @@
"../../include/perfetto/ext/base", # TODO(primiano): remove this
]
sources = [
+ "field.cc",
"message.cc",
"message_handle.cc",
"packed_repeated_fields.cc",
@@ -49,6 +50,7 @@
testonly = true
deps = [
":protozero",
+ ":testing_messages_cpp",
":testing_messages_lite",
":testing_messages_zero",
"../../gn:default_deps",
@@ -63,6 +65,7 @@
"proto_decoder_unittest.cc",
"proto_utils_unittest.cc",
"scattered_stream_writer_unittest.cc",
+ "test/cppgen_conformance_unittest.cc",
"test/fake_scattered_buffer.cc",
"test/fake_scattered_buffer.h",
"test/protozero_conformance_unittest.cc",
@@ -72,10 +75,6 @@
# Generates both xxx.pbzero.h and xxx.pb.h (official proto).
perfetto_proto_library("testing_messages_@TYPE@") {
- proto_generators = [
- "lite",
- "zero",
- ]
sources = [
"test/example_proto/library.proto",
"test/example_proto/library_internals/galaxies.proto",