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

Issue 2732313002: Move JumplistIcon to JumplistIconOld only via renaming, not copy-n-delete (Closed)

Created:
3 years, 9 months ago by chengx
Modified:
3 years, 9 months ago
CC:
chromium-reviews, brucedawson
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move JumplistIcon to JumplistIconOld only via renaming, not copy-n-delete In jumplist related IO operations, one step is to move folder JumplistIcon to JumplistIconOld using base::Move(). The method tries to rename the folder and copy-n-delete if renaming fails. For users with these folders corrupted and bloated already, copy-n-delete is very expensive and may lead those icon files to be never deleted when e.g., copy succeeds yet delete fails. As folders JumplistIcon and JumplistIconOld are in the same disk volume, renaming should be working fine and enough for users whose jumplists are working normally. So this change won't affect those Chrome users at all. Local tests have been done on my machine and proved it. This CL also updates the logic when deletion of folder JumplistIcon fails. Previous logic is that if base::DeleteFile() function call fails, updating jumplist is skipped. This can be potentially wrong if deletion of the content in JumplistIcon succeeds but deletion of folder alone fails. In this case, we should still continue with jumplist update, which is fixed in this CL. UMA histogram is also updated to record this change. UMA metrics will be kept being monitored for this change. BUG=40407, 179576 Review-Url: https://codereview.chromium.org/2732313002 Cr-Commit-Position: refs/heads/master@{#456505} Committed: https://chromium.googlesource.com/chromium/src/+/2d05b7ac09a50214f67c7a87c875c9cd6544dce1

Patch Set 1 #

Total comments: 19

Patch Set 2 : Address comments. #

Total comments: 2

Patch Set 3 : Update folder_operation_status. #

Patch Set 4 : Add a new metric in histograms.xml #

Total comments: 4

Patch Set 5 : Fix comments in histograms.xml #

Total comments: 2

Patch Set 6 : Address comments. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -20 lines) Patch
M chrome/browser/win/jumplist.cc View 1 2 3 4 5 5 chunks +55 lines, -20 lines 1 comment Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 3 chunks +120 lines, -0 lines 0 comments Download

Messages

Total messages: 55 (38 generated)
chengx
PTAL~
3 years, 9 months ago (2017-03-07 21:25:59 UTC) #7
grt (UTC plus 2)
Are you aware that MoveFile on a directory will fail if any file within the ...
3 years, 9 months ago (2017-03-08 09:14:06 UTC) #9
chengx
On 2017/03/08 09:14:06, grt (UTC plus 1) wrote: > Are you aware that MoveFile on ...
3 years, 9 months ago (2017-03-08 18:06:32 UTC) #10
grt (UTC plus 2)
if base::Move is being handled by the copy-n-delete path in the wild, then it's most ...
3 years, 9 months ago (2017-03-09 10:11:49 UTC) #11
chengx
Thanks for pointing this out. Honestly, I am confused by how base::DeleteFile() proceeds. Say one ...
3 years, 9 months ago (2017-03-09 23:57:36 UTC) #16
grt (UTC plus 2)
Yes, DeleteFile is imperfect at the moment. I have it on my plate to fix ...
3 years, 9 months ago (2017-03-10 09:24:06 UTC) #17
chengx
isherman@, could you please take a look at histograms.xml? grt@, comments addressed in the new ...
3 years, 9 months ago (2017-03-10 21:49:40 UTC) #29
Ilya Sherman
I'd recommend renaming the metric, since you're changing its semantics.
3 years, 9 months ago (2017-03-10 22:59:58 UTC) #30
chengx
Hi Ilya, I have renamed the metric. PTAL, thanks!
3 years, 9 months ago (2017-03-10 23:19:54 UTC) #33
Ilya Sherman
Metrics LGTM % comments: https://codereview.chromium.org/2732313002/diff/60001/chrome/browser/win/jumplist.cc File chrome/browser/win/jumplist.cc (right): https://codereview.chromium.org/2732313002/diff/60001/chrome/browser/win/jumplist.cc#newcode294 chrome/browser/win/jumplist.cc:294: "WinJumplist.DetailedFolderResultsDeleteUpdated", Optional nit: I'd suggest ...
3 years, 9 months ago (2017-03-10 23:30:16 UTC) #34
chengx
isherman@, commented addressed in the new patch set. Thanks! grt@, please refer to patch set ...
3 years, 9 months ago (2017-03-10 23:58:51 UTC) #39
grt (UTC plus 2)
https://codereview.chromium.org/2732313002/diff/1/chrome/browser/win/jumplist.cc File chrome/browser/win/jumplist.cc (right): https://codereview.chromium.org/2732313002/diff/1/chrome/browser/win/jumplist.cc#newcode310 chrome/browser/win/jumplist.cc:310: if (!base::DeleteFile(icon_dir, true)) { On 2017/03/10 21:49:40, chengx wrote: ...
3 years, 9 months ago (2017-03-13 09:03:20 UTC) #42
chengx
On 2017/03/13 09:03:20, grt (UTC plus 1) wrote: > Yes, that's exactly my question. I ...
3 years, 9 months ago (2017-03-13 20:24:10 UTC) #45
chengx
PATL~ https://codereview.chromium.org/2732313002/diff/80001/chrome/browser/win/jumplist.cc File chrome/browser/win/jumplist.cc (right): https://codereview.chromium.org/2732313002/diff/80001/chrome/browser/win/jumplist.cc#newcode313 chrome/browser/win/jumplist.cc:313: } else { On 2017/03/13 09:03:20, grt (UTC ...
3 years, 9 months ago (2017-03-13 20:38:30 UTC) #46
grt (UTC plus 2)
lgtm given that Windows does something sane when jumplist icons disappear. thanks. https://codereview.chromium.org/2732313002/diff/100001/chrome/browser/win/jumplist.cc File chrome/browser/win/jumplist.cc ...
3 years, 9 months ago (2017-03-13 20:38:39 UTC) #47
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/2732313002/100001
3 years, 9 months ago (2017-03-13 21:56:54 UTC) #52
commit-bot: I haz the power
3 years, 9 months ago (2017-03-13 22:12:21 UTC) #55
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/2d05b7ac09a50214f67c7a87c875...

Powered by Google App Engine
This is Rietveld 408576698