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

Issue 9839053: Add error handling to random access file (Closed)

Created:
8 years, 9 months ago by Søren Gjesse
Modified:
8 years, 9 months ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add error handling to random access file Now all both sync and async methods on File and RandomAccessFile should have correct error handling. Changed readByte and readByteSync to return -1 instead of reporting an error when end of file is reached. It seems to make the most sense. The amount of boiler-plate code in both the native functions and native port functions in file.cc is growing. Maybe we should consider some refactoring, e.g. with a table of the expected argument types for each native port functions together with known position of the FILE* argument. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5812

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed review comments #

Patch Set 3 : Rebased to r5810 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+582 lines, -373 lines) Patch
M runtime/bin/dartutils.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/bin/dartutils.cc View 2 chunks +8 lines, -0 lines 0 comments Download
M runtime/bin/file.h View 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/bin/file.cc View 11 chunks +215 lines, -112 lines 0 comments Download
M runtime/bin/file.dart View 2 chunks +5 lines, -3 lines 0 comments Download
M runtime/bin/file_impl.dart View 31 chunks +158 lines, -203 lines 0 comments Download
M runtime/bin/file_linux.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/bin/file_macos.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/bin/file_win.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/standalone/src/io/FileErrorTest.dart View 8 chunks +170 lines, -13 lines 0 comments Download
M tests/standalone/src/io/FileTest.dart View 12 chunks +14 lines, -34 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years, 9 months ago (2012-03-23 14:24:54 UTC) #1
Mads Ager (google)
LGTM! Great to get all this error information propagated to the user! I agree with ...
8 years, 9 months ago (2012-03-23 23:17:57 UTC) #2
Søren Gjesse
8 years, 9 months ago (2012-03-26 05:47:40 UTC) #3
http://codereview.chromium.org/9839053/diff/1/runtime/bin/http_impl.dart
File runtime/bin/http_impl.dart (right):

http://codereview.chromium.org/9839053/diff/1/runtime/bin/http_impl.dart#newc...
runtime/bin/http_impl.dart:183: _streamErrorHandler = callback;
On 2012/03/23 23:17:57, Mads Ager wrote:
> This looks like a left-over from the previous change.

Yes, the svn rebase was in between the two.

http://codereview.chromium.org/9839053/diff/1/runtime/bin/io.dart
File runtime/bin/io.dart (right):

http://codereview.chromium.org/9839053/diff/1/runtime/bin/io.dart#newcode14
runtime/bin/io.dart:14: #import("dart:builtin");
On 2012/03/23 23:17:57, Mads Ager wrote:
> Remove again before commit.

Sorry, removed - we should have a presubmit check for this :-).

Powered by Google App Engine
This is Rietveld 408576698