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

Issue 1646673002: mojo filesystem: Simplify full file reading/writing. (Closed)

Created:
4 years, 11 months ago by Elliot Glaysher
Modified:
4 years, 11 months ago
Reviewers:
sky
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

mojo 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… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -79 lines) Patch
M components/filesystem/directory_impl.h View 1 chunk +5 lines, -0 lines 0 comments Download
M components/filesystem/directory_impl.cc View 3 chunks +67 lines, -1 line 0 comments Download
M components/filesystem/directory_impl_unittest.cc View 2 chunks +88 lines, -0 lines 0 comments Download
M components/filesystem/file_impl.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/filesystem/file_impl.cc View 1 chunk +0 lines, -22 lines 0 comments Download
M components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h View 2 chunks +1 line, -7 lines 0 comments Download
M components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc View 1 4 chunks +11 lines, -44 lines 0 comments Download
M components/filesystem/public/interfaces/directory.mojom View 1 chunk +6 lines, -0 lines 0 comments Download
M components/filesystem/public/interfaces/file.mojom View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 8 (5 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1646673002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1646673002/20001
4 years, 11 months ago (2016-01-28 00:48:34 UTC) #4
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 11 months ago (2016-01-28 01:29:34 UTC) #6
commit-bot: I haz the power
4 years, 11 months ago (2016-01-28 02:05:04 UTC) #8
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/95b810566de876251114b4b11827b093b8d05f11
Cr-Commit-Position: refs/heads/master@{#371953}

Powered by Google App Engine
This is Rietveld 408576698