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

Issue 811823003: Cross platform low level file IO wrappers (Closed)

Created:
6 years ago by scottmg
Modified:
6 years ago
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

Cross platform low level file IO wrappers Rename fd_io to file_io, and ReadFD to ReadFile, etc. file_io.cc is the higher level versions that call the basic ReadFile/WriteFile and then file_io_posix.cc and file_io_win.cc are the implementations of those functions. The Windows path is as yet untested, lacking the ability to link the test binary. R=cpu@chromium.org, mark@chromium.org BUG=crashpad:1 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/10165ce449849509b71687890e4ac32b1e5366af

Patch Set 1 #

Patch Set 2 : Work towards cross-platform file IO #

Patch Set 3 : fd to file #

Patch Set 4 : remove clang-format change #

Patch Set 5 : . #

Patch Set 6 : closefd to closefile #

Patch Set 7 : add _win #

Patch Set 8 : comment #

Total comments: 5

Patch Set 9 : whitespace #

Total comments: 24

Patch Set 10 : various fixes #

Total comments: 13

Patch Set 11 : . #

Total comments: 4

Patch Set 12 : . #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+250 lines, -586 lines) Patch
M snapshot/mac/mach_o_image_annotations_reader_test.cc View 1 2 3 4 4 chunks +5 lines, -5 lines 0 comments Download
M snapshot/mac/process_reader_test.cc View 1 2 3 4 10 chunks +36 lines, -35 lines 0 comments Download
D util/file/fd_io.h View 1 chunk +0 lines, -125 lines 0 comments Download
D util/file/fd_io.cc View 1 chunk +0 lines, -135 lines 0 comments Download
A + util/file/file_io.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +81 lines, -67 lines 1 comment Download
A + util/file/file_io.cc View 1 2 3 4 5 6 7 8 9 4 chunks +13 lines, -74 lines 0 comments Download
A + util/file/file_io_posix.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -59 lines 0 comments Download
A + util/file/file_io_win.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +52 lines, -32 lines 0 comments Download
M util/file/file_writer.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M util/mach/child_port_handshake.cc View 1 2 4 chunks +8 lines, -7 lines 0 comments Download
M util/mach/exception_ports_test.cc View 1 2 5 chunks +6 lines, -6 lines 0 comments Download
M util/mach/mach_message_server_test.cc View 1 2 6 chunks +7 lines, -7 lines 0 comments Download
M util/mach/scoped_task_suspend_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M util/net/http_body.cc View 1 2 3 4 5 3 chunks +4 lines, -4 lines 0 comments Download
M util/net/http_transport_test.cc View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M util/test/mac/mach_multiprocess.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M util/test/multiprocess_exec_test.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M util/test/multiprocess_test.cc View 1 2 3 chunks +15 lines, -15 lines 0 comments Download
M util/util.gyp View 1 2 3 4 5 6 8 9 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (14 generated)
scottmg
https://codereview.chromium.org/811823003/diff/260001/util/file/file_io.cc File util/file/file_io.cc (right): https://codereview.chromium.org/811823003/diff/260001/util/file/file_io.cc#newcode26 util/file/file_io.cc:26: PLOG(ERROR) << "read"; The error messages being "read" is ...
6 years ago (2014-12-16 21:29:45 UTC) #7
Mark Mentovai
Cool! https://codereview.chromium.org/811823003/diff/260001/util/file/file_io.cc File util/file/file_io.cc (right): https://codereview.chromium.org/811823003/diff/260001/util/file/file_io.cc#newcode26 util/file/file_io.cc:26: PLOG(ERROR) << "read"; scottmg wrote: > The error ...
6 years ago (2014-12-16 22:40:26 UTC) #8
scottmg
Thanks! https://codereview.chromium.org/811823003/diff/260001/util/file/file_io.cc File util/file/file_io.cc (right): https://codereview.chromium.org/811823003/diff/260001/util/file/file_io.cc#newcode26 util/file/file_io.cc:26: PLOG(ERROR) << "read"; On 2014/12/16 22:40:25, Mark Mentovai ...
6 years ago (2014-12-17 00:22:58 UTC) #15
Mark Mentovai
Nice. https://codereview.chromium.org/811823003/diff/270001/util/file/file_io_posix.cc File util/file/file_io_posix.cc (right): https://codereview.chromium.org/811823003/diff/270001/util/file/file_io_posix.cc#newcode69 util/file/file_io_posix.cc:69: ssize_t ReadFile(int fd, void* buffer, size_t size) { ...
6 years ago (2014-12-17 01:05:24 UTC) #16
scottmg
https://codereview.chromium.org/811823003/diff/400001/util/file/file_io.h File util/file/file_io.h (right): https://codereview.chromium.org/811823003/diff/400001/util/file/file_io.h#newcode68 util/file/file_io.h:68: //! `ReadFile` return values, if the underlying ReadFile() fails, ...
6 years ago (2014-12-17 01:50:28 UTC) #17
Mark Mentovai
https://codereview.chromium.org/811823003/diff/400001/util/file/file_io_win.cc File util/file/file_io_win.cc (right): https://codereview.chromium.org/811823003/diff/400001/util/file/file_io_win.cc#newcode31 util/file/file_io_win.cc:31: if (!success && GetLastError() != ERROR_MORE_DATA) scottmg wrote: > ...
6 years ago (2014-12-17 05:39:16 UTC) #18
scottmg
https://codereview.chromium.org/811823003/diff/420001/util/file/file_io.h File util/file/file_io.h (right): https://codereview.chromium.org/811823003/diff/420001/util/file/file_io.h#newcode132 util/file/file_io.h:132: //! If the underlying functions fails, this function causes ...
6 years ago (2014-12-17 20:18:33 UTC) #20
scottmg
+cpu too. Trying to write a equivalent to POSIX "read from fd" in util/file/file_io_win.cc ReadFile. ...
6 years ago (2014-12-17 20:22:46 UTC) #22
Mark Mentovai
Wow. I definitely learned a lot here. Thanks for sticking with it, and for all ...
6 years ago (2014-12-17 20:24:47 UTC) #23
scottmg
On 2014/12/17 20:24:47, Mark Mentovai wrote: > Wow. I definitely learned a lot here. Me ...
6 years ago (2014-12-17 20:37:30 UTC) #24
cpu_(ooo_6.6-7.5)
I haven't read the code yet so I don't know how relevant is trivia below ...
6 years ago (2014-12-17 21:58:10 UTC) #25
cpu_(ooo_6.6-7.5)
looks fine, I only looked at the new files (A+) My big question is don't ...
6 years ago (2014-12-17 22:10:17 UTC) #26
scottmg
Thanks On 2014/12/17 22:10:17, cpu wrote: > looks fine, I only looked at the new ...
6 years ago (2014-12-17 22:28:59 UTC) #27
scottmg
Committed patchset #12 (id:460001) manually as 10165ce449849509b71687890e4ac32b1e5366af (presubmit successful).
6 years ago (2014-12-17 22:35:23 UTC) #28
Mark Mentovai
6 years ago (2014-12-17 22:39:38 UTC) #29
Message was sent while issue was closed.
base/files didn’t have an interface that fit what I needed too well. That’s how
we wound up with file_io in Crashpad.

Powered by Google App Engine
This is Rietveld 408576698