• erg's avatar
    mojo filesystem: Simplify full file reading/writing. · 95b81056
    erg authored
    [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
    
    Review URL: https://codereview.chromium.org/1646673002
    
    Cr-Commit-Position: refs/heads/master@{#371953}
    95b81056
directory.mojom 2.83 KB