Merge "Move protolog_viewer_config parsing to TokenizePacket" into main
diff --git a/src/trace_processor/importers/proto/winscope/winscope_module.cc b/src/trace_processor/importers/proto/winscope/winscope_module.cc
index 9946a23..317374e 100644
--- a/src/trace_processor/importers/proto/winscope/winscope_module.cc
+++ b/src/trace_processor/importers/proto/winscope/winscope_module.cc
@@ -49,6 +49,23 @@
kWinscopeDescriptor.size());
}
+ModuleResult WinscopeModule::TokenizePacket(
+ const protos::pbzero::TracePacket::Decoder& decoder,
+ TraceBlobView* /*packet*/,
+ int64_t /*packet_timestamp*/,
+ RefPtr<PacketSequenceStateGeneration> /*state*/,
+ uint32_t field_id) {
+
+ switch (field_id) {
+ case TracePacket::kProtologViewerConfigFieldNumber:
+ protolog_parser_.ParseProtoLogViewerConfig(
+ decoder.protolog_viewer_config());
+ return ModuleResult::Handled();
+ }
+
+ return ModuleResult::Ignored();
+}
+
void WinscopeModule::ParseTracePacketData(const TracePacket::Decoder& decoder,
int64_t timestamp,
const TracePacketData& data,
@@ -73,10 +90,6 @@
protolog_parser_.ParseProtoLogMessage(
data.sequence_state.get(), decoder.protolog_message(), timestamp);
return;
- case TracePacket::kProtologViewerConfigFieldNumber:
- protolog_parser_.ParseProtoLogViewerConfig(
- decoder.protolog_viewer_config());
- return;
case TracePacket::kWinscopeExtensionsFieldNumber:
ParseWinscopeExtensionsData(decoder.winscope_extensions(), timestamp,
data);
diff --git a/src/trace_processor/importers/proto/winscope/winscope_module.h b/src/trace_processor/importers/proto/winscope/winscope_module.h
index 649e329..e14be59 100644
--- a/src/trace_processor/importers/proto/winscope/winscope_module.h
+++ b/src/trace_processor/importers/proto/winscope/winscope_module.h
@@ -36,6 +36,13 @@
public:
explicit WinscopeModule(TraceProcessorContext* context);
+ ModuleResult TokenizePacket(
+ const protos::pbzero::TracePacket::Decoder& decoder,
+ TraceBlobView* packet,
+ int64_t packet_timestamp,
+ RefPtr<PacketSequenceStateGeneration> state,
+ uint32_t field_id) override;
+
void ParseTracePacketData(const protos::pbzero::TracePacket::Decoder&,
int64_t ts,
const TracePacketData&,