| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 |
| 6 class _FilterImpl implements Filter { |
| 7 _FilterImpl() { |
| 8 } |
| 9 |
| 10 Future<List<int>> process(List<int> data) { |
| 11 var c = new Completer<List<int>>(); |
| 12 try { |
| 13 c.complete(_Process(data)); |
| 14 } catch (e) { |
| 15 c.completeException(e); |
| 16 } |
| 17 return c.future; |
| 18 } |
| 19 |
| 20 void end() { |
| 21 _End(); |
| 22 } |
| 23 |
| 24 List<int> _Process(List<int> data) native "Filter_Process"; |
| 25 void _End() native "Filter_End"; |
| 26 } |
| 27 |
| 28 class _ZLibFilterImpl extends _FilterImpl { |
| 29 _ZLibFilterImpl() { |
| 30 var result = _Init(); |
| 31 if (result is Exception) { |
| 32 throw result; // ??? |
| 33 } |
| 34 } |
| 35 |
| 36 bool _Init() native "Filter_CreateZLIB"; |
| 37 } |
| OLD | NEW |