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

Issue 2681643005: Report more relevant error code for windows base::ReplaceFile impl (Closed)

Created:
3 years, 10 months ago by Charlie Harrison
Modified:
3 years, 10 months ago
Reviewers:
engedy, dcheng
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Report more relevant error code for windows base::ReplaceFile impl The windows version of base::ReplaceFile performs a MoveFile, followed by a ReplaceFile if the move fails. However, if the to_path does not exist, and the MoveFile fails, the error reported by ReplaceFile will always be a NOT_FOUND, because ReplaceFile requires the to_path to exist. This patch just fowards the MoveFile error when the ReplaceFile's error is NOT_FOUND. It will be more or equally as relevant. BUG=689655 Review-Url: https://codereview.chromium.org/2681643005 Cr-Commit-Position: refs/heads/master@{#448970} Committed: https://chromium.googlesource.com/chromium/src/+/b281ba4e35f9d2f1b28c6e92cae971f048025eb6

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -2 lines) Patch
M base/files/file_util_win.cc View 2 chunks +10 lines, -2 lines 4 comments Download

Messages

Total messages: 16 (9 generated)
Charlie Harrison
Daniel, is this crazy? I think that if ReplaceFile returns NOT_FOUND and it is *not* ...
3 years, 10 months ago (2017-02-07 22:31:21 UTC) #4
dcheng
LGTM. I would personally find it more readable if it were broken out into two ...
3 years, 10 months ago (2017-02-07 23:24:51 UTC) #5
Charlie Harrison
Thanks! +engedy, how do you feel about this as a quick chance to start getting ...
3 years, 10 months ago (2017-02-07 23:31:23 UTC) #9
dcheng
https://codereview.chromium.org/2681643005/diff/1/base/files/file_util_win.cc File base/files/file_util_win.cc (right): https://codereview.chromium.org/2681643005/diff/1/base/files/file_util_win.cc#newcode152 base/files/file_util_win.cc:152: *error = replace_error == File::FILE_ERROR_NOT_FOUND ? move_error On 2017/02/07 ...
3 years, 10 months ago (2017-02-07 23:32:39 UTC) #10
engedy
The plan sounds awesome, thanks for jumping on this! LGTM.
3 years, 10 months ago (2017-02-08 12:41:28 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2681643005/1
3 years, 10 months ago (2017-02-08 12:59:48 UTC) #13
commit-bot: I haz the power
3 years, 10 months ago (2017-02-08 13:04:06 UTC) #16
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/b281ba4e35f9d2f1b28c6e92cae9...

Powered by Google App Engine
This is Rietveld 408576698