Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: remoting/base/decompressor.h

Issue 2815043: zlib decompression for chromoting (Closed)
Patch Set: git try Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/compressor_zlib_unittest.cc ('k') | remoting/base/decompressor_zlib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/decompressor.h
diff --git a/remoting/base/decompressor.h b/remoting/base/decompressor.h
new file mode 100644
index 0000000000000000000000000000000000000000..b688b3beeff018396853ee741e10caa029f2669d
--- /dev/null
+++ b/remoting/base/decompressor.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_BASE_DECOMPRESSOR_H_
+#define REMOTING_BASE_DECOMPRESSOR_H_
+
+#include "base/basictypes.h"
+
+namespace remoting {
+
+// An object to decompress data losslessly. This is used in pair with
+// a compressor.
+//
+// Note that a decompressor can only be used on one stream during its
+// lifetime. This object should be destroyed after use.
+class Decompressor {
+ public:
+ virtual ~Decompressor() {}
+
+ // Decompress |input_data| with |input_size| bytes.
+ //
+ // |output_data| is provided by the caller and |output_size| is the
+ // size of |output_data|. |output_size| must be greater than 0.
+ //
+ // Decompressed data is written to |output_data|. |consumed| will
+ // contain the number of bytes consumed from the input. |written|
+ // contains the number of bytes written to output.
+ //
+ // Returns true if this method needs to be called again because
+ // there is more bytes to be decompressed or more input data is
+ // needed.
+ virtual bool Process(const uint8* input_data, int input_size,
+ uint8* output_data, int output_size,
+ int* consumed, int* written) = 0;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_BASE_DECOMPRESSOR_H_
« no previous file with comments | « remoting/base/compressor_zlib_unittest.cc ('k') | remoting/base/decompressor_zlib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698