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

Issue 12320003: Fix net::FileStream to handle POSIX errors correctly. (Closed)

Created:
7 years, 10 months ago by Sergey Ulanov
Modified:
7 years, 10 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, sail+watch_chromium.org
Visibility:
Public.

Description

Fix net::FileStream to handle all errors correctly. This CL adds FileStream::Context::IOResult struct that's used to pass results of IO operations inside FileStream::Context. Following bugs are fixes: 1. On POSIX net::FileStream::Read() and net::FileStream::Write() would return a positive result in case of an error. This happens because POSIX errors are positive integers and FileStream was written with assumption that they are negative. 2. On Windows Seek() and Flush() errors were not handled correctly. This is because CheckForIOError() was assuming that all error codes are negative, but RecordAndMapError() was mapping positive errors. 3. On Windows results of asynchronous ReadFile() and WriteFile() were not handled correctly - ERR_IO_PENDING would be returned even when operation completes synchronously. Also added unittests to check that error codes are handled correctly now. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184257

Patch Set 1 #

Patch Set 2 : #

Total comments: 16

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -151 lines) Patch
M net/base/file_stream_context.h View 1 2 2 chunks +23 lines, -27 lines 0 comments Download
M net/base/file_stream_context.cc View 1 2 3 4 6 chunks +63 lines, -38 lines 0 comments Download
M net/base/file_stream_context_posix.cc View 1 3 chunks +34 lines, -26 lines 0 comments Download
M net/base/file_stream_context_win.cc View 1 2 3 4 5 4 chunks +58 lines, -60 lines 0 comments Download
M net/base/file_stream_unittest.cc View 1 1 chunk +38 lines, -0 lines 0 comments Download
M net/base/net_errors_win.cc View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Sergey Ulanov
7 years, 10 months ago (2013-02-20 04:10:06 UTC) #1
willchan no longer on Chromium
Sorry for the delay, I missed this earlier. Redirecting to mmenke.
7 years, 10 months ago (2013-02-20 22:15:31 UTC) #2
mmenke
On 2013/02/20 22:15:31, willchan wrote: > Sorry for the delay, I missed this earlier. Redirecting ...
7 years, 10 months ago (2013-02-21 19:41:05 UTC) #3
mmenke
On 2013/02/21 19:41:05, mmenke wrote: > On 2013/02/20 22:15:31, willchan wrote: > > Sorry for ...
7 years, 10 months ago (2013-02-21 19:50:18 UTC) #4
mmenke
On 2013/02/21 19:41:05, mmenke wrote: > On 2013/02/20 22:15:31, willchan wrote: > > Sorry for ...
7 years, 10 months ago (2013-02-21 19:57:23 UTC) #5
Sergey Ulanov
On 2013/02/21 19:57:23, mmenke wrote: > On 2013/02/21 19:41:05, mmenke wrote: > > On 2013/02/20 ...
7 years, 10 months ago (2013-02-21 22:23:51 UTC) #6
mmenke
On 2013/02/21 22:23:51, sergeyu wrote: > On 2013/02/21 19:57:23, mmenke wrote: > > On 2013/02/21 ...
7 years, 10 months ago (2013-02-21 22:45:22 UTC) #7
mmenke
On 2013/02/21 22:45:22, mmenke wrote: > On 2013/02/21 22:23:51, sergeyu wrote: > > On 2013/02/21 ...
7 years, 10 months ago (2013-02-21 22:47:18 UTC) #8
Sergey Ulanov
On Thu, Feb 21, 2013 at 2:47 PM, <mmenke@chromium.org> wrote: > On 2013/02/21 22:45:22, mmenke ...
7 years, 10 months ago (2013-02-21 22:54:40 UTC) #9
mmenke
On 2013/02/21 22:54:40, sergeyu wrote: > On Thu, Feb 21, 2013 at 2:47 PM, <mailto:mmenke@chromium.org> ...
7 years, 10 months ago (2013-02-21 22:57:00 UTC) #10
Sergey Ulanov
PTAL - added IOResult struct that's now used to pass results of IO operations
7 years, 10 months ago (2013-02-22 08:39:25 UTC) #11
mmenke
https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc#newcode26 net/base/file_stream_context.cc:26: : result(0), Maybe result(OK)? https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc#newcode196 net/base/file_stream_context.cc:196: return OpenResult(file, IOResult(0, ...
7 years, 10 months ago (2013-02-22 16:24:59 UTC) #12
Sergey Ulanov
https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc#newcode26 net/base/file_stream_context.cc:26: : result(0), On 2013/02/22 16:24:59, mmenke wrote: > Maybe ...
7 years, 10 months ago (2013-02-22 21:04:06 UTC) #13
mmenke
LGTM https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc#newcode196 net/base/file_stream_context.cc:196: return OpenResult(file, IOResult(0, 0)); On 2013/02/22 21:04:06, sergeyu ...
7 years, 10 months ago (2013-02-22 21:13:17 UTC) #14
mmenke
On 2013/02/22 21:13:17, mmenke wrote: > LGTM > > https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc > File net/base/file_stream_context.cc (right): > ...
7 years, 10 months ago (2013-02-22 21:16:27 UTC) #15
Sergey Ulanov
https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/12320003/diff/19003/net/base/file_stream_context.cc#newcode196 net/base/file_stream_context.cc:196: return OpenResult(file, IOResult(0, 0)); On 2013/02/22 21:13:17, mmenke wrote: ...
7 years, 10 months ago (2013-02-22 21:51:47 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergeyu@chromium.org/12320003/6009
7 years, 10 months ago (2013-02-22 21:52:59 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergeyu@chromium.org/12320003/20017
7 years, 10 months ago (2013-02-22 22:01:34 UTC) #18
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 10 months ago (2013-02-22 23:01:34 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergeyu@chromium.org/12320003/11007
7 years, 10 months ago (2013-02-22 23:26:03 UTC) #20
commit-bot: I haz the power
7 years, 10 months ago (2013-02-23 02:08:05 UTC) #21
Message was sent while issue was closed.
Change committed as 184257

Powered by Google App Engine
This is Rietveld 408576698