summaryrefslogtreecommitdiffstats
path: root/remoting/base/compressor.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:17:44 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:17:44 +0000
commitbfb6a560ee1f95a5350e280e61a5a3d2e01b92c2 (patch)
tree2c4c231716b6aa30ace2c3dd1f83f172337368f0 /remoting/base/compressor.h
parent2e7c2aa7179907202155d4714913e0a0724e11a5 (diff)
downloadchromium_src-bfb6a560ee1f95a5350e280e61a5a3d2e01b92c2.zip
chromium_src-bfb6a560ee1f95a5350e280e61a5a3d2e01b92c2.tar.gz
chromium_src-bfb6a560ee1f95a5350e280e61a5a3d2e01b92c2.tar.bz2
zlib decompression for chromoting
Using zlib for decompression. Also revised the API and usage of zlib for compression. TEST=none BUG=none Review URL: http://codereview.chromium.org/2815043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base/compressor.h')
-rw-r--r--remoting/base/compressor.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/remoting/base/compressor.h b/remoting/base/compressor.h
index 4c242bd..fd4c412 100644
--- a/remoting/base/compressor.h
+++ b/remoting/base/compressor.h
@@ -21,27 +21,20 @@ class Compressor {
// Compress |input_data| with |input_size| bytes.
//
// |output_data| is provided by the caller and |output_size| is the
- // size of |output_data|.
+ // size of |output_data|. |output_size| must be greater than 0.
+ //
+ // |input_size| is set to 0 to indicate the end of input stream.
//
// Compressed 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.
- virtual void Write(const uint8* input_data, int input_size,
- uint8* output_data, int output_size,
- int* consumed, int* written) = 0;
-
- // Flush all the remaining data in the compressor.
- //
- // |output_data| is provided by the caller and |output_size| is called
- // with the size of |output_data|.
- //
- // Output data is written to |output_data| and |written| contains the
- // number of bytes written.
//
- // Returns true if |output_data| is not large enough to carry all
- // compressed data and caller needs to call Flush() again.
- virtual bool Flush(uint8* output_data, int output_size,
- int* written) = 0;
+ // Returns true if this method needs to be called again because
+ // there is more data to be written out. This is particularly
+ // useful for end of the compression stream.
+ virtual bool Process(const uint8* input_data, int input_size,
+ uint8* output_data, int output_size,
+ int* consumed, int* written) = 0;
};
} // namespace remoting