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

Side by Side Diff: sdk/lib/io/file_impl.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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 | « sdk/lib/io/chunked_stream.dart ('k') | sdk/lib/io/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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 } 243 }
244 244
245 void set onClosed(void callback()) { 245 void set onClosed(void callback()) {
246 _onClosed = callback; 246 _onClosed = callback;
247 } 247 }
248 248
249 void _processPendingOperations() { 249 void _processPendingOperations() {
250 _pendingOperations.forEach((buffer) { 250 _pendingOperations.forEach((buffer) {
251 if (buffer is _PendingOperation) { 251 if (buffer is _PendingOperation) {
252 if (buffer === _PendingOperation.CLOSE) { 252 if (identical(buffer, _PendingOperation.CLOSE)) {
253 close(); 253 close();
254 } else { 254 } else {
255 assert(buffer === _PendingOperation.FLUSH); 255 assert(identical(buffer, _PendingOperation.FLUSH));
256 flush(); 256 flush();
257 } 257 }
258 } else { 258 } else {
259 write(buffer); 259 write(buffer);
260 } 260 }
261 }); 261 });
262 _pendingOperations = null; 262 _pendingOperations = null;
263 } 263 }
264 264
265 void _write(List<int> buffer, int offset, int len) { 265 void _write(List<int> buffer, int offset, int len) {
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 new FileIOException("File closed '$_name'")); 1080 new FileIOException("File closed '$_name'"));
1081 }); 1081 });
1082 return completer.future; 1082 return completer.future;
1083 } 1083 }
1084 1084
1085 final String _name; 1085 final String _name;
1086 int _id; 1086 int _id;
1087 1087
1088 SendPort _fileService; 1088 SendPort _fileService;
1089 } 1089 }
OLDNEW
« no previous file with comments | « sdk/lib/io/chunked_stream.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698