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

Unified Diff: runtime/bin/filter.h

Issue 130513003: [ZLIB] Add support for windowBits, memLevel, raw (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: integrate feedback Created 6 years, 10 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 | « no previous file | runtime/bin/filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/filter.h
diff --git a/runtime/bin/filter.h b/runtime/bin/filter.h
index 16f1c6e16896942401aadf3f94d644769010dfb7..424fb3625a81ceec941582ed51e50fabe2ebaec6 100644
--- a/runtime/bin/filter.h
+++ b/runtime/bin/filter.h
@@ -21,14 +21,12 @@ class Filter {
virtual bool Init() = 0;
/**
- * On a succesfull call to Process, Process will take ownership of data. On
+ * On a successful call to Process, Process will take ownership of data. On
* successive calls to either Processed or ~Filter, data will be freed with
* a delete[] call.
*/
virtual bool Process(uint8_t* data, intptr_t length) = 0;
- virtual intptr_t Processed(uint8_t* buffer,
- intptr_t length,
- bool finish,
+ virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
bool end) = 0;
static Dart_Handle SetFilterPointerNativeField(Dart_Handle filter,
@@ -54,20 +52,28 @@ class Filter {
class ZLibDeflateFilter : public Filter {
public:
- ZLibDeflateFilter(bool gzip = false, int32_t level = 6)
- : gzip_(gzip), level_(level), current_buffer_(NULL) {}
+ ZLibDeflateFilter(bool gzip, int32_t level, int32_t window_bits,
+ int32_t mem_level, int32_t strategy,
+ uint8_t* dictionary, bool raw)
+ : gzip_(gzip), level_(level), window_bits_(window_bits),
+ mem_level_(mem_level), strategy_(strategy), dictionary_(dictionary),
+ raw_(raw), current_buffer_(NULL)
+ {}
virtual ~ZLibDeflateFilter();
virtual bool Init();
virtual bool Process(uint8_t* data, intptr_t length);
- virtual intptr_t Processed(uint8_t* buffer,
- intptr_t length,
- bool finish,
+ virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
bool end);
private:
const bool gzip_;
const int32_t level_;
+ const int32_t window_bits_;
+ const int32_t mem_level_;
+ const int32_t strategy_;
+ uint8_t* dictionary_;
+ const bool raw_;
uint8_t* current_buffer_;
z_stream stream_;
@@ -76,17 +82,21 @@ class ZLibDeflateFilter : public Filter {
class ZLibInflateFilter : public Filter {
public:
- ZLibInflateFilter() : current_buffer_(NULL) {}
+ ZLibInflateFilter(int32_t window_bits, uint8_t* dictionary, bool raw)
+ : window_bits_(window_bits), dictionary_(dictionary), raw_(raw),
+ current_buffer_(NULL)
+ {}
virtual ~ZLibInflateFilter();
virtual bool Init();
virtual bool Process(uint8_t* data, intptr_t length);
- virtual intptr_t Processed(uint8_t* buffer,
- intptr_t length,
- bool finish,
+ virtual intptr_t Processed(uint8_t* buffer, intptr_t length, bool finish,
bool end);
private:
+ const int32_t window_bits_;
+ uint8_t* dictionary_;
+ const bool raw_;
uint8_t* current_buffer_;
z_stream stream_;
« no previous file with comments | « no previous file | runtime/bin/filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698