Descriptionbase::ReadFile() should return the number of read bytes on Windows.
base::ReadFile() has inconsistent behavior between Linux/Mac and Windows.
When the passed |size| argument is larger than file's size, ReadFile() on Linux/Mac returns the number of read bytes, but ReadFile() on Windows returns -1.
We can workaround this behavior by calling GetFileSize() first, but there are already many clients which treat |size| as max size (They're passing the size of buffer).
I think we should make behavior on Windows be consistent with Linux/Mac.
BUG=243885
TEST=run base_unittests
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=264768
Patch Set 1 : Add unit test which intentionally make try bot on Windows fail. #Patch Set 2 : Return the number of read bytes from ReadFile on Windows. #Patch Set 3 : Add missing parenthesis. #
Total comments: 10
Patch Set 4 : Correct comments and how to return value on error cases. #
Messages
Total messages: 6 (0 generated)
|