#include "components/reporting/compression/compression_module.h"
#include <optional>
#include <string>
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ref_counted.h"
#include "base/task/thread_pool.h"
#include "components/reporting/proto/synced/record.pb.h"
#include "components/reporting/resources/resource_manager.h"
#include "third_party/snappy/src/snappy.h"
namespace reporting {
BASE_FEATURE(…);
scoped_refptr<CompressionModule> CompressionModule::Create(
uint64_t compression_threshold,
CompressionInformation::CompressionAlgorithm compression_type) { … }
void CompressionModule::CompressRecord(
std::string record,
scoped_refptr<ResourceManager> memory_resource,
base::OnceCallback<void(std::string, std::optional<CompressionInformation>)>
cb) const { … }
bool CompressionModule::is_enabled() { … }
CompressionModule::CompressionModule(
uint64_t compression_threshold,
CompressionInformation::CompressionAlgorithm compression_type)
: … { … }
CompressionModule::~CompressionModule() = default;
void CompressionModule::CompressRecordSnappy(
std::string record,
base::OnceCallback<void(std::string, std::optional<CompressionInformation>)>
cb) const { … }
}