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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/filter.dart ('k') | runtime/bin/io_sources.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« 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