#include "src/trace_processor/util/gzip_utils.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <vector>
#include "perfetto/base/build_config.h"
#if PERFETTO_BUILDFLAG(PERFETTO_ZLIB)
#include <zconf.h>
#include <zlib.h>
#else
struct z_stream_s {};
#endif
namespace perfetto::trace_processor::util {
bool IsGzipSupported() { … }
#if PERFETTO_BUILDFLAG(PERFETTO_ZLIB)
GzipDecompressor::GzipDecompressor(InputMode mode)
: … { … }
void GzipDecompressor::Reset() { … }
void GzipDecompressor::Feed(const uint8_t* data, size_t size) { … }
GzipDecompressor::Result GzipDecompressor::ExtractOutput(uint8_t* out,
size_t out_size) { … }
size_t GzipDecompressor::AvailIn() const { … }
void GzipDecompressor::Deleter::operator()(z_stream_s* stream) const { … }
#else
GzipDecompressor::GzipDecompressor(InputMode) {}
void GzipDecompressor::Reset() {}
void GzipDecompressor::Feed(const uint8_t*, size_t) {}
GzipDecompressor::Result GzipDecompressor::ExtractOutput(uint8_t*, size_t) {
return Result{ResultCode::kError, 0};
}
size_t GzipDecompressor::AvailIn() const {
return 0;
}
void GzipDecompressor::Deleter::operator()(z_stream_s*) const {}
#endif
std::vector<uint8_t> GzipDecompressor::DecompressFully(const uint8_t* data,
size_t len) { … }
}