Descriptionmojo filesystem: Simplify full file reading/writing.
[This is the same patch as before, but this fixes the win x64 gn bot
which is a main waterfall tree closer, but doesn't have a default trybot
run.]
One common pattern that's coming up multiple times is that we want to
read or write the full contents of a file. The first attempt at an
interface to that had was put on the File object.
However, file seeking behaviour differs between platforms. Performing a
seek on an empty file is safe on posix and errors on Windows. And when
dealing with arbitrary File objects, we want to seek to the beginning
just in case there was any previous usage on the File object.
It was also cumbersome. The user was still responsible for opening the
file and closing it once they were done with it. Putting these
operations on Directory not only removes a bug, but also simplifies the
interface.
BUG=557405
First Review URL: https://codereview.chromium.org/1634293002
TBR=sky@chromium.org
Committed: https://crrev.com/95b810566de876251114b4b11827b093b8d05f11
Cr-Commit-Position: refs/heads/master@{#371953}
Patch Set 1 #Patch Set 2 : Take 2 at trying to fix compile. The release version is complaining about duplicate -1s and this is… #Messages
Total messages: 8 (5 generated)
|