#include "src/trace_processor/util/proto_to_args_parser.h"
#include <stdint.h>
#include "perfetto/base/status.h"
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/protozero/proto_utils.h"
#include "protos/perfetto/common/descriptor.pbzero.h"
#include "src/trace_processor/util/descriptors.h"
#include "src/trace_processor/util/status_macros.h"
namespace perfetto {
namespace trace_processor {
namespace util {
namespace {
PRFI;
void AppendProtoType(std::string& target, const std::string& value) { … }
}
ProtoToArgsParser::Key::Key() = default;
ProtoToArgsParser::Key::Key(const std::string& k) : … { … }
ProtoToArgsParser::Key::Key(const std::string& fk, const std::string& k)
: … { … }
ProtoToArgsParser::Key::~Key() = default;
ProtoToArgsParser::ScopedNestedKeyContext::ScopedNestedKeyContext(Key& key)
: … { … }
ProtoToArgsParser::ScopedNestedKeyContext::ScopedNestedKeyContext(
ProtoToArgsParser::ScopedNestedKeyContext&& other) noexcept
: … { … }
ProtoToArgsParser::ScopedNestedKeyContext::~ScopedNestedKeyContext() { … }
void ProtoToArgsParser::ScopedNestedKeyContext::RemoveFieldSuffix() { … }
ProtoToArgsParser::Delegate::~Delegate() = default;
ProtoToArgsParser::ProtoToArgsParser(const DescriptorPool& pool) : … { … }
base::Status ProtoToArgsParser::ParseMessage(
const protozero::ConstBytes& cb,
const std::string& type,
const std::vector<uint32_t>* allowed_fields,
Delegate& delegate,
int* unknown_extensions) { … }
base::Status ProtoToArgsParser::ParseMessageInternal(
ScopedNestedKeyContext& key_context,
const protozero::ConstBytes& cb,
const std::string& type,
const std::vector<uint32_t>* allowed_fields,
Delegate& delegate,
int* unknown_extensions) { … }
base::Status ProtoToArgsParser::ParseField(
const FieldDescriptor& field_descriptor,
int repeated_field_number,
protozero::Field field,
Delegate& delegate,
int* unknown_extensions) { … }
base::Status ProtoToArgsParser::ParsePackedField(
const FieldDescriptor& field_descriptor,
std::unordered_map<size_t, int>& repeated_field_index,
protozero::Field field,
Delegate& delegate,
int* unknown_extensions) { … }
void ProtoToArgsParser::AddParsingOverrideForField(
const std::string& field,
ParsingOverrideForField func) { … }
void ProtoToArgsParser::AddParsingOverrideForType(const std::string& type,
ParsingOverrideForType func) { … }
std::optional<base::Status> ProtoToArgsParser::MaybeApplyOverrideForField(
const protozero::Field& field,
Delegate& delegate) { … }
std::optional<base::Status> ProtoToArgsParser::MaybeApplyOverrideForType(
const std::string& message_type,
ScopedNestedKeyContext& key,
const protozero::ConstBytes& data,
Delegate& delegate) { … }
base::Status ProtoToArgsParser::ParseSimpleField(
const FieldDescriptor& descriptor,
const protozero::Field& field,
Delegate& delegate) { … }
ProtoToArgsParser::ScopedNestedKeyContext ProtoToArgsParser::EnterArray(
size_t index) { … }
ProtoToArgsParser::ScopedNestedKeyContext ProtoToArgsParser::EnterDictionary(
const std::string& name) { … }
}
}
}