#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/filter/gzip_source_stream.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/notreached.h"
#include "base/numerics/checked_math.h"
#include "net/base/io_buffer.h"
#include "third_party/zlib/zlib.h"
namespace net {
namespace {
const char kDeflate[] = …;
const char kGzip[] = …;
const int kMaxZlibHeaderSniffBytes = …;
}
GzipSourceStream::~GzipSourceStream() { … }
std::unique_ptr<GzipSourceStream> GzipSourceStream::Create(
std::unique_ptr<SourceStream> upstream,
SourceStream::SourceType type) { … }
GzipSourceStream::GzipSourceStream(std::unique_ptr<SourceStream> upstream,
SourceStream::SourceType type)
: … { … }
bool GzipSourceStream::Init() { … }
std::string GzipSourceStream::GetTypeAsString() const { … }
base::expected<size_t, Error> GzipSourceStream::FilterData(
IOBuffer* output_buffer,
size_t output_buffer_size,
IOBuffer* input_buffer,
size_t input_buffer_size,
size_t* consumed_bytes,
bool upstream_end_reached) { … }
bool GzipSourceStream::InsertZlibHeader() { … }
}