Fix ImportantFileWriter leaking a .tmp file when passed an invalid path
When passed an invalid path (ex. "bad/../path"), ImportantFileWriter
creates a temp file, sees that it's invalid, then returns without deleting it.
The file being invalid is an implementation detail of base::File's
Initialize() method, which sets an error field to
FILE_ERROR_ACCESS_DENIED if the file's path contains the parent ".." operator.
This stops ImportantFileWriterTest.FailedWriteWithObserver from leaking
a temp file.
BUG=691388
Review-Url: https://codereview.chromium.org/2711523002
Cr-Commit-Position: refs/heads/master@{#452266}
CrOS-Libchrome-Original-Commit: 05db50c5c72b8368af872b768cb637c294e99f44
1 file changed