summaryrefslogtreecommitdiffstats
path: root/remoting/base/decompressor_zlib.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/decompressor_zlib.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/decompressor_zlib.h')
-rw-r--r--remoting/base/decompressor_zlib.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/remoting/base/decompressor_zlib.h b/remoting/base/decompressor_zlib.h
new file mode 100644
index 0000000..b762480
--- /dev/null
+++ b/remoting/base/decompressor_zlib.h
@@ -0,0 +1,32 @@
+// 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_ZLIB_H_
+#define REMOTING_BASE_DECOMPRESSOR_ZLIB_H_
+
+#include "base/scoped_ptr.h"
+#include "remoting/base/decompressor.h"
+
+typedef struct z_stream_s z_stream;
+
+namespace remoting {
+
+// A lossless decompressor using zlib.
+class DecompressorZlib : public Decompressor {
+ public:
+ DecompressorZlib();
+ virtual ~DecompressorZlib();
+
+ // Decompressor implementations.
+ virtual bool Process(const uint8* input_data, int input_size,
+ uint8* output_data, int output_size,
+ int* consumed, int* written);
+
+ private:
+ scoped_ptr<z_stream> stream_;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_BASE_DECOMPRESSOR_ZLIB_H_