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

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

Issue 2779403002: Migrate jumplist update task from FILE thread to base/task_scheduler (Closed)
Patch Set: Fix nits. 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.cc ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // if it is. 102 // if it is.
103 if (base::IsDirectoryEmpty(path) && 103 if (base::IsDirectoryEmpty(path) &&
104 !::RemoveDirectory(path.value().c_str())) { 104 !::RemoveDirectory(path.value().c_str())) {
105 delete_status = FAIL_REMOVE_RAW_DIRECTORY; 105 delete_status = FAIL_REMOVE_RAW_DIRECTORY;
106 } 106 }
107 return delete_status; 107 return delete_status;
108 } 108 }
109 109
110 void DeleteDirectoryAndLogResults(const base::FilePath& path, 110 void DeleteDirectoryAndLogResults(const base::FilePath& path,
111 int max_file_deleted) { 111 int max_file_deleted) {
112 FolderDeleteResult delete_status = DeleteDirectory(path, max_file_deleted); 112 DirectoryStatus dir_status = NON_EXIST;
113 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIconsOld",
114 delete_status, END);
115 113
116 DirectoryStatus dir_status = NON_EXIST; 114 if (base::DirectoryExists(path)) {
117 if (base::DirectoryExists(path)) 115 FolderDeleteResult delete_status = DeleteDirectory(path, max_file_deleted);
116 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIconsOld",
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 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIconsOld", 121 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIconsOld",
121 dir_status, DIRECTORY_STATUS_END); 122 dir_status, DIRECTORY_STATUS_END);
122 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/win/jumplist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698