| 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";
|
| +}
|
|
|