• gcasto's avatar
    Revert of mojo filesystem: Simplify full file reading/writing. (patchset #5... · 47a6da61
    gcasto authored
    Revert of mojo filesystem: Simplify full file reading/writing. (patchset #5 id:80001 of https://codereview.chromium.org/1634293002/ )
    
    Reason for revert:
    Broke the Windows build.
    
    https://build.chromium.org/p/chromium.win/builders/Win%20x64%20GN/builds/10430/steps/compile/logs/stdio
    
    FAILED: ninja -t msvc -e environment.x64 -- E:\b\build\goma/gomacc.exe "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64/cl.exe" /nologo /showIncludes /FC @obj/components/filesystem/lib/directory_impl.obj.rsp /c ../../components/filesystem/directory_impl.cc /Foobj/components/filesystem/lib/directory_impl.obj /Fdobj/components/filesystem/lib_cc.pdb
    e:\b\build\slave\win_x64_gn\build\src\components\filesystem\directory_impl.cc(274) : error C2220: warning treated as error - no 'object' file generated
    e:\b\build\slave\win_x64_gn\build\src\components\filesystem\directory_impl.cc(274) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
    ninja: build stopped: subcommand failed.
    
    Original issue's description:
    > mojo filesystem: Simplify full file reading/writing.
    >
    > 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
    >
    > Committed: https://crrev.com/fd918ae590f61f145d75c800abb8eb050ca32b06
    > Cr-Commit-Position: refs/heads/master@{#371845}
    
    TBR=sky@chromium.org,erg@chromium.org
    # Skipping CQ checks because original CL landed less than 1 days ago.
    NOPRESUBMIT=true
    NOTREECHECKS=true
    NOTRY=true
    BUG=557405
    
    Review URL: https://codereview.chromium.org/1643733002
    
    Cr-Commit-Position: refs/heads/master@{#371863}
    47a6da61
directory_impl.cc 6.46 KB