| Index: remoting/base/decompressor_zlib.cc
|
| diff --git a/remoting/base/decompressor_zlib.cc b/remoting/base/decompressor_zlib.cc
|
| index e3060bd8d38e425c4418926772375ea2d48d1afc..bb4a83d205d06029e0cca9d8361d94ed1387535d 100644
|
| --- a/remoting/base/decompressor_zlib.cc
|
| +++ b/remoting/base/decompressor_zlib.cc
|
| @@ -21,18 +21,16 @@
|
| namespace remoting {
|
|
|
| DecompressorZlib::DecompressorZlib() {
|
| - stream_.reset(new z_stream());
|
| -
|
| - stream_->next_in = Z_NULL;
|
| - stream_->zalloc = Z_NULL;
|
| - stream_->zfree = Z_NULL;
|
| - stream_->opaque = Z_NULL;
|
| -
|
| - inflateInit(stream_.get());
|
| + InitStream();
|
| }
|
|
|
| DecompressorZlib::~DecompressorZlib() {
|
| + Reset();
|
| +}
|
| +
|
| +void DecompressorZlib::Reset() {
|
| inflateEnd(stream_.get());
|
| + InitStream();
|
| }
|
|
|
| bool DecompressorZlib::Process(const uint8* input_data, int input_size,
|
| @@ -60,4 +58,15 @@ bool DecompressorZlib::Process(const uint8* input_data, int input_size,
|
| return ret == Z_OK || ret == Z_BUF_ERROR;
|
| }
|
|
|
| +void DecompressorZlib::InitStream() {
|
| + stream_.reset(new z_stream());
|
| +
|
| + stream_->next_in = Z_NULL;
|
| + stream_->zalloc = Z_NULL;
|
| + stream_->zfree = Z_NULL;
|
| + stream_->opaque = Z_NULL;
|
| +
|
| + inflateInit(stream_.get());
|
| +}
|
| +
|
| } // namespace remoting
|
|
|