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

Unified Diff: mojo/dart/embedder/io/filter_patch.dart

Issue 1760523007: Add support for compression filters in the mojo dart:io (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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 | « mojo/dart/embedder/io/filter.cc ('k') | mojo/dart/embedder/io/internet_address.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/io/filter_patch.dart
diff --git a/mojo/dart/embedder/io/filter_patch.dart b/mojo/dart/embedder/io/filter_patch.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3a321703b62045bb99d2ef8ee17f2c098c001089
--- /dev/null
+++ b/mojo/dart/embedder/io/filter_patch.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+class _FilterImpl extends NativeFieldWrapperClass1 implements _Filter {
+ void process(List<int> data, int start, int end) native "Filter_Process";
+
+ List<int> processed({bool flush: true, bool end: false})
+ native "Filter_Processed";
+
+ void end() native "Filter_End";
+}
+
+class _ZLibInflateFilter extends _FilterImpl {
+ _ZLibInflateFilter(int windowBits, List<int> dictionary, bool raw) {
+ _init(windowBits, dictionary, raw);
+ }
+ void _init(int windowBits, List<int> dictionary, bool raw)
+ native "Filter_CreateZLibInflate";
+}
+
+class _ZLibDeflateFilter extends _FilterImpl {
+ _ZLibDeflateFilter(bool gzip, int level, int windowBits, int memLevel,
+ int strategy, List<int> dictionary, bool raw) {
+ _init(gzip, level, windowBits, memLevel, strategy, dictionary, raw);
+ }
+ void _init(bool gzip, int level, int windowBits, int memLevel,
+ int strategy, List<int> dictionary, bool raw)
+ native "Filter_CreateZLibDeflate";
+}
+
+patch class _Filter {
+ /* patch */ static _Filter _newZLibDeflateFilter(bool gzip, int level,
+ int windowBits, int memLevel,
+ int strategy,
+ List<int> dictionary,
+ bool raw) =>
+ new _ZLibDeflateFilter(gzip, level, windowBits, memLevel, strategy,
+ dictionary, raw);
+ /* patch */ static _Filter _newZLibInflateFilter(int windowBits,
+ List<int> dictionary,
+ bool raw) =>
+ new _ZLibInflateFilter(windowBits, dictionary, raw);
+}
« no previous file with comments | « mojo/dart/embedder/io/filter.cc ('k') | mojo/dart/embedder/io/internet_address.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698