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

Issue 871193010: Add FileHandleFileWriter (Closed)

Created:
5 years, 10 months ago by Mark Mentovai
Modified:
5 years, 10 months ago
Reviewers:
Robert Sesek, scottmg
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

Add WeakFileHandleFileWriter, a FileWriterInterface implementation that deals solely with a weak FileHandle. CrashReportDatabase::PrepareNewCrashReport() provides its caller with both a FileHandle and a FilePath. While it’s possible to create a FileWriter from the FilePath, it’s not necessary to have two FileHandles open to the same file. Also, there’s no FileWriteMode::kReuseOrFail option because it didn’t seem necessary[1], and although it would actually be the most desirable option for a FileWriter here, allowing the FileHandle to be used directly without reopening the file sidesteps the problem entirely. FileWriter is adapted to use WeakFileHandleFileWriter to minimize duplication. [1] https://codereview.chromium.org/818433002/diff/80001/util/file/file_io.h#newcode138 R=rsesek@chromium.org, scottmg@chromium.org Committed: https://chromium.googlesource.com/crashpad/crashpad/+/222f91f5c6e875929fabc00c6ba37698a2808172

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rename to WeakFileHandleFileWriter #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -23 lines) Patch
M util/file/file_io.h View 1 chunk +5 lines, -0 lines 0 comments Download
M util/file/file_writer.h View 1 2 chunks +45 lines, -0 lines 0 comments Download
M util/file/file_writer.cc View 1 4 chunks +53 lines, -23 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Mark Mentovai
5 years, 10 months ago (2015-02-04 21:02:22 UTC) #2
scottmg
Code LGTM, but the name doesn't really communicate the non-opening/closing-ness to me. I can't think ...
5 years, 10 months ago (2015-02-04 21:14:10 UTC) #3
Mark Mentovai
It varies from FileWriter in two ways: the non-owning behavior and the fact that it ...
5 years, 10 months ago (2015-02-04 21:17:57 UTC) #4
scottmg
On 2015/02/04 21:17:57, Mark Mentovai wrote: > It varies from FileWriter in two ways: the ...
5 years, 10 months ago (2015-02-04 21:20:34 UTC) #5
Robert Sesek
LGTM, maybe a test, but since it's already implicitly tested as part of the implementation, ...
5 years, 10 months ago (2015-02-04 21:25:01 UTC) #6
Mark Mentovai
Renamed. WeakFileHandleFileWriter is wordy, but slightly better than NonOwningFileHandleFileWriter. No new test for now, this ...
5 years, 10 months ago (2015-02-04 21:32:40 UTC) #9
Robert Sesek
Still LGTM
5 years, 10 months ago (2015-02-04 22:15:47 UTC) #10
Mark Mentovai
5 years, 10 months ago (2015-02-04 22:26:22 UTC) #11
Message was sent while issue was closed.
Committed patchset #2 (id:40001) manually as
222f91f5c6e875929fabc00c6ba37698a2808172 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698