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

Unified Diff: components/tracing/core/trace_buffer_writer.cc

Issue 2281903002: Tracing V2: Trace buffer writer uses proto. (Closed)
Patch Set: nit Created 4 years, 4 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 | « components/tracing/BUILD.gn ('k') | components/tracing/proto/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/core/trace_buffer_writer.cc
diff --git a/components/tracing/core/trace_buffer_writer.cc b/components/tracing/core/trace_buffer_writer.cc
index 7cd9b1356b5aee78d9b54fc051621b953530862b..b811eeb9419cea535a141365aecaf4b95afb18ad 100644
--- a/components/tracing/core/trace_buffer_writer.cc
+++ b/components/tracing/core/trace_buffer_writer.cc
@@ -7,23 +7,14 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "components/tracing/core/proto_utils.h"
+#include "components/tracing/proto/events_chunk.pbzero.h"
namespace tracing {
namespace v2 {
namespace {
-// TODO(primiano) remove this in next CLs. This should just be taken from the
-// C++ class autogenerated from events_chunk.proto (crbug.com/608721).
-struct ChunkProto {
- enum : uint32_t {
- kWriterIdFieldNumber = 1,
- kSeqIdInStreamFieldNumber = 2,
- kEventsFieldNumber = 3,
- kFirstEventContinuesFromPrevChunkFieldNumber = 4,
- kLastEventContinuesOnNextChunkFieldNumber = 5
- };
-};
+using ChunkProto = pbzero::tracing::proto::EventsChunk;
const size_t kEventPreambleSize = 1 + proto::kMessageLengthFieldSize;
@@ -160,9 +151,9 @@ ContiguousMemoryRange TraceBufferWriter::AcquireNewChunk(
chunk_proto = proto::WriteVarInt(writer_id_, chunk_proto);
proto::StaticAssertSingleBytePreamble<
- ChunkProto::kSeqIdInStreamFieldNumber>();
+ ChunkProto::kSeqIdFieldNumber>();
*chunk_proto++ = static_cast<uint8_t>(
- proto::MakeTagVarInt(ChunkProto::kSeqIdInStreamFieldNumber));
+ proto::MakeTagVarInt(ChunkProto::kSeqIdFieldNumber));
chunk_proto = proto::WriteVarInt(chunk_seq_id_, chunk_proto);
if (is_fragmenting_event) {
« no previous file with comments | « components/tracing/BUILD.gn ('k') | components/tracing/proto/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698