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

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

Issue 9285017: Comment and white-space cleanup in IO libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More of the same. Created 8 years, 11 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/eventhandler.dart ('k') | runtime/bin/output_stream.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(File file) { 6 _FileInputStream(File file) {
7 _file = file.openSync(); 7 _file = file.openSync();
8 _length = _file.lengthSync(); 8 _length = _file.lengthSync();
9 _streamMarkedClosed = true; 9 _streamMarkedClosed = true;
10 _checkScheduleCallbacks(); 10 _checkScheduleCallbacks();
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 void setPositionSync(int position) { 946 void setPositionSync(int position) {
947 if (_asyncUsed) { 947 if (_asyncUsed) {
948 throw new FileIOException( 948 throw new FileIOException(
949 "Mixed use of synchronous and asynchronous API"); 949 "Mixed use of synchronous and asynchronous API");
950 } 950 }
951 bool result = _FileUtils.setPosition(_id, position); 951 bool result = _FileUtils.setPosition(_id, position);
952 if (result == false) { 952 if (result == false) {
953 throw new FileIOException("setPosition failed"); 953 throw new FileIOException("setPosition failed");
954 } 954 }
955 } 955 }
956 956
957 void truncate(int length) { 957 void truncate(int length) {
958 _asyncUsed = true; 958 _asyncUsed = true;
959 var handler = (_truncateHandler != null) ? _truncateHandler : () => null; 959 var handler = (_truncateHandler != null) ? _truncateHandler : () => null;
960 var handleTruncateResult = (result, ignored) { 960 var handleTruncateResult = (result, ignored) {
961 if (result == false && _errorHandler != null) { 961 if (result == false && _errorHandler != null) {
962 _errorHandler("truncate failed"); 962 _errorHandler("truncate failed");
963 return; 963 return;
964 } 964 }
965 handler(); 965 handler();
966 }; 966 };
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 var _readByteHandler; 1082 var _readByteHandler;
1083 var _readListHandler; 1083 var _readListHandler;
1084 var _noPendingWriteHandler; 1084 var _noPendingWriteHandler;
1085 var _positionHandler; 1085 var _positionHandler;
1086 var _setPositionHandler; 1086 var _setPositionHandler;
1087 var _truncateHandler; 1087 var _truncateHandler;
1088 var _lengthHandler; 1088 var _lengthHandler;
1089 var _flushHandler; 1089 var _flushHandler;
1090 var _errorHandler; 1090 var _errorHandler;
1091 } 1091 }
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler.dart ('k') | runtime/bin/output_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698