Reland "Upgrade image file management for Win 10 native notification"
This is a reland of b011ab56 In the original change, NotificationImageRetainerTest.CleanupFilesFromPrevSessions and NotificationImageRetainerTest.RegisterTemporaryImage failed on Win and Win64 trunk official.desktop.continuous builders. The root cause is that for some reason, chrome::DIR_USER_DATA used in the test alternated between the chrome-bot directory (i.e., C:/Users/chrome-bot/AppData...) and the full directory (i.e., C:/Users/CHROME~1/AppData). From the test results, they clearly referred to the same file, so the code is working fine in production. However, the mismatch of the two strings failed the string comparison in the tests. This CL attempted to fix it. Original change's description: > Upgrade image file management for Win 10 native notification > > This CL makes the following changes: > 1) Change to run image folder cleanup after Chrome startup using a background > task, rather than running it at Chrome shutdown using a high priority task. > 2) Retain the image folder to avoid deleting and creating it repeatedly. > 3) Remove <subdir> from the full path for the temp file, which is unnecessary. > 4) Delete the temp files in batch. > > These changes have the following benefits: > 1) Fix the issue of Chrome shutdown being blocked by image file IO for some users > as in the current implementation. > 2) Save some disk IO related to the sub-directories in the image folder and the > image folder itself. > 3) Avoid creating a deletion task for each file, otherwise the overhead can be > large when there is a steady stream of notifications coming rapidly. > > Bug: 888276 > Change-Id: I214680aa00bd7f19e84e207e82ada553583a094b > Reviewed-on: https://chromium-review.googlesource.com/c/1260498 > Commit-Queue: Xi Cheng <chengx@chromium.org> > Reviewed-by: Ilya Sherman <isherman@chromium.org> > Reviewed-by: Greg Thompson <grt@chromium.org> > Cr-Commit-Position: refs/heads/master@{#601227} TBR=isherman@chromium.org, grt@chromium.org, finnur@chromium.org Bug: 888276, 897352 Change-Id: I9b1bde98be8545f8634473e7540b0a2a3bee7172 Reviewed-on: https://chromium-review.googlesource.com/c/1292894Reviewed-by:Xi Cheng <chengx@chromium.org> Commit-Queue: Xi Cheng <chengx@chromium.org> Cr-Commit-Position: refs/heads/master@{#601819}
Showing
This diff is collapsed.
Please register or sign in to comment