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

Side by Side Diff: chrome/browser/win/jumplist_file_util.cc

Issue 2807883002: Separate JumpListIcons delete task and update task (Closed)
Patch Set: Update comments and better variables. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/win/jumplist_file_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/win/jumplist_file_util.h" 5 #include "chrome/browser/win/jumplist_file_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (base::DirectoryExists(path)) { 114 if (base::DirectoryExists(path)) {
115 FolderDeleteResult delete_status = DeleteDirectory(path, max_file_deleted); 115 FolderDeleteResult delete_status = DeleteDirectory(path, max_file_deleted);
116 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIconsOld", 116 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIconsOld",
117 delete_status, FolderDeleteResult::END); 117 delete_status, FolderDeleteResult::END);
118 dir_status = base::IsDirectoryEmpty(path) ? EMPTY : NON_EMPTY; 118 dir_status = base::IsDirectoryEmpty(path) ? EMPTY : NON_EMPTY;
119 } 119 }
120 120
121 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIconsOld", 121 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIconsOld",
122 dir_status, DIRECTORY_STATUS_END); 122 dir_status, DIRECTORY_STATUS_END);
123 } 123 }
124
125 void DeleteDirectoryContentAndLogResults(const base::FilePath& path,
126 int max_file_deleted) {
127 DirectoryStatus dir_status = NON_EXIST;
128
129 // Delete the content in |path|. If |path| doesn't exist, create one.
130 if (base::DirectoryExists(path)) {
131 FolderDeleteResult delete_status =
132 DeleteDirectoryContent(path, kFileDeleteLimit);
133
134 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIcons",
135 delete_status, FolderDeleteResult::END);
136
137 if (base::DirectoryExists(path))
138 dir_status = base::IsDirectoryEmpty(path) ? EMPTY : NON_EMPTY;
139 } else if (base::CreateDirectory(path)) {
140 dir_status = EMPTY;
141 }
142
143 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIcons",
144 dir_status, DIRECTORY_STATUS_END);
145 }
OLDNEW
« no previous file with comments | « chrome/browser/win/jumplist_file_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698