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

Issue 12326107: Fix net::FileStream to handle all errors correctly. (Closed)

Created:
7 years, 10 months ago by Sergey Ulanov
Modified:
7 years, 10 months ago
Reviewers:
mmenke
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. 4. On Windows OVERLAPPED struct wasn't set to zeros as necessary. Also added unittests to check that error codes are handled correctly now. TBR=mmenke@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184577

Patch Set 1 : #

Patch Set 2 : #

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

Messages

Total messages: 2 (0 generated)
Sergey Ulanov
Third attempt to land https://codereview.chromium.org/12320003/ . Verified that this version passes tests on XP now. ...
7 years, 10 months ago (2013-02-26 01:49:14 UTC) #1
Sergey Ulanov
7 years, 10 months ago (2013-02-26 03:21:15 UTC) #2
Message was sent while issue was closed.
Committed patchset #2 manually as r184577 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698