log_decoder.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_METRICS_LOG_DECODER_H_
  5. #define COMPONENTS_METRICS_LOG_DECODER_H_
  6. #include <string>
  7. namespace google {
  8. namespace protobuf {
  9. class MessageLite;
  10. } // namespace protobuf
  11. } // namespace google
  12. namespace metrics {
  13. // Other modules can call this function instead of directly calling gzip. This
  14. // prevents other modules from having to depend on zlib, or being aware of
  15. // metrics' use of gzip compression, which is a metrics implementation detail.
  16. // Returns true on success, false on failure.
  17. bool DecodeLogData(const std::string& compressed_log_data,
  18. std::string* log_data);
  19. // Decodes |compressed_log_data| and populates |proto| with the decompressed log
  20. // data. Returns true on success and false on failure.
  21. bool DecodeLogDataToProto(const std::string& compressed_log_data,
  22. google::protobuf::MessageLite* proto);
  23. } // namespace metrics
  24. #endif // COMPONENTS_METRICS_LOG_DECODER_H_