commit | 3b39fc70403e55e9637041f18480aa383928b0e8 | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Sat Jun 22 19:05:23 2019 +0100 |
committer | Primiano Tucci <primiano@google.com> | Sat Jun 22 19:05:23 2019 +0100 |
tree | 12be138e32202859f195e80476e42184d35b426a | |
parent | 7afb8a45a3894a2641f478fb2c69ee0721e3241a [diff] |
Make auto-generated c++ classes hermetic, intorudce CopyablePtr This is the first step towards switching from libprotobuf to protozero. This change makes the headers of auto-generated C++ core classes independent from each other (i.e. if A has a nested field B, A.h does not include anymore B.h, only the .cc does). This CL breaks the header dependency turning message-type fields from nested objects to heap-based pointers, allowing to keep only the forward declaration in the header. In order to do so this CL introduced a base::CopyablePtr<T> which is a simple pointer wrapper, similar to unique_ptr, that behaves like a std::vector<T> of fixed size = 1. This CL also updates the code generator to use CopyablePtr. Bug: 132880619 Test: perfetto_unittests --gtest_filter=CopyablePtrTest.* + builds Change-Id: If71015a05740952353ea77b3a5af673f7f9dabf0
Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.
See www.perfetto.dev for docs.