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

Unified Diff: runtime/bin/filter_impl.dart

Issue 11198034: Introduce (private) ZLibFilter to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « runtime/bin/filter.dart ('k') | runtime/bin/io_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/filter_impl.dart
diff --git a/runtime/bin/filter_impl.dart b/runtime/bin/filter_impl.dart
new file mode 100644
index 0000000000000000000000000000000000000000..602d955f81722aa31480547aecffe6cbcddb2773
--- /dev/null
+++ b/runtime/bin/filter_impl.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2012, 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 implements Filter {
+ _FilterImpl() {
+ }
+
+ Future<List<int>> process(List<int> data) {
+ var c = new Completer<List<int>>();
+ try {
+ c.complete(_Process(data));
+ } catch (e) {
+ c.completeException(e);
+ }
+ return c.future;
+ }
+
+ void end() {
+ _End();
+ }
+
+ List<int> _Process(List<int> data) native "Filter_Process";
+ void _End() native "Filter_End";
+}
+
+class _ZLibFilterImpl extends _FilterImpl {
+ _ZLibFilterImpl() {
+ var result = _Init();
+ if (result is Exception) {
+ throw result; // ???
+ }
+ }
+
+ bool _Init() native "Filter_CreateZLIB";
+}
« no previous file with comments | « runtime/bin/filter.dart ('k') | runtime/bin/io_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698