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

Side by Side Diff: runtime/bin/file_impl.dart

Issue 10829459: Deprecate Math object in corelib in favor of dart:math library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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 | « pkg/unittest/interactive_html_config.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class _FileInputStream extends _BaseDataInputStream implements InputStream { 5 class _FileInputStream extends _BaseDataInputStream implements InputStream {
6 _FileInputStream(String name) 6 _FileInputStream(String name)
7 : _data = const [], 7 : _data = const [],
8 _position = 0, 8 _position = 0,
9 _filePosition = 0 { 9 _filePosition = 0 {
10 var file = new File(name); 10 var file = new File(name);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 _openedFile.close().then((ignore) { 53 _openedFile.close().then((ignore) {
54 _streamMarkedClosed = true; 54 _streamMarkedClosed = true;
55 _checkScheduleCallbacks(); 55 _checkScheduleCallbacks();
56 }); 56 });
57 } 57 }
58 } 58 }
59 59
60 void _fillBuffer() { 60 void _fillBuffer() {
61 Expect.equals(_position, _data.length); 61 Expect.equals(_position, _data.length);
62 if (_openedFile == null) return; // Called before the file is opened. 62 if (_openedFile == null) return; // Called before the file is opened.
63 int size = Math.min(_bufferLength, _fileLength - _filePosition); 63 int size = min(_bufferLength, _fileLength - _filePosition);
64 if (size == 0) { 64 if (size == 0) {
65 _closeFile(); 65 _closeFile();
66 return; 66 return;
67 } 67 }
68 // If there is currently a _fillBuffer call waiting on readList, 68 // If there is currently a _fillBuffer call waiting on readList,
69 // let it fill the buffer instead of us. 69 // let it fill the buffer instead of us.
70 if (_activeFillBufferCall) return; 70 if (_activeFillBufferCall) return;
71 _activeFillBufferCall = true; 71 _activeFillBufferCall = true;
72 if (_data.length != size) { 72 if (_data.length != size) {
73 _data = new Uint8List(size); 73 _data = new Uint8List(size);
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 new FileIOException("File closed '$_name'")); 1161 new FileIOException("File closed '$_name'"));
1162 }); 1162 });
1163 return completer.future; 1163 return completer.future;
1164 } 1164 }
1165 1165
1166 final String _name; 1166 final String _name;
1167 int _id; 1167 int _id;
1168 1168
1169 SendPort _fileService; 1169 SendPort _fileService;
1170 } 1170 }
OLDNEW
« no previous file with comments | « pkg/unittest/interactive_html_config.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698