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

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

Issue 2859193005: Cache JumpList icons to avoid unnecessary creation and deletion (Closed)
Patch Set: Created 3 years, 7 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
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 #ifndef CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_ 5 #ifndef CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_
6 #define CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_ 6 #define CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_
7 7
8 #include <set>
9
8 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
9 11
10 // Maximum number of icon files allowed to delete per jumplist update. 12 // Maximum number of icon files allowed to delete per jumplist update.
11 const int kFileDeleteLimit = 30; 13 const int kFileDeleteLimit = 30;
12 14
13 // This method is similar to base::DeleteFileRecursive in 15 // This method is similar to base::DeleteFileRecursive in
14 // file_util_win.cc with the following differences. 16 // file_util_win.cc with the following differences.
15 // 1) It has an input parameter |max_file_deleted| to specify the maximum files 17 // 1) It has an input parameter |max_file_deleted| to specify the maximum files
16 // allowed to delete as well as the maximum attempt failures allowd per run. 18 // allowed to delete as well as the maximum attempt failures allowd per run.
17 // 2) It deletes only the files in |path|. All subdirectories in |path| are 19 // 2) It deletes only the files in |path|. All subdirectories in |path| are
(...skipping 14 matching lines...) Expand all
32 // This method firstly calls DeleteDirectoryContent() to delete the contents in 34 // This method firstly calls DeleteDirectoryContent() to delete the contents in
33 // |path|. If |path| is empty after the call, it is removed. 35 // |path|. If |path| is empty after the call, it is removed.
34 void DeleteDirectory(const base::FilePath& path, int max_file_deleted); 36 void DeleteDirectory(const base::FilePath& path, int max_file_deleted);
35 37
36 // Deletes the content in the folder at |path| and records the runtime to UMA. 38 // Deletes the content in the folder at |path| and records the runtime to UMA.
37 // TODO(chengx): Remove this method and use DeleteDirectoryContent after fixing 39 // TODO(chengx): Remove this method and use DeleteDirectoryContent after fixing
38 // http://crbug.com/40407. 40 // http://crbug.com/40407.
39 void DeleteDirectoryContentAndLogRuntime(const base::FilePath& path, 41 void DeleteDirectoryContentAndLogRuntime(const base::FilePath& path,
40 int max_file_deleted); 42 int max_file_deleted);
41 43
44 // Returns true if the directory at |path| has more than |max_files| files.
45 // Sub-directories are not taken into account here.
46 bool FilesExceedLimitInDir(const base::FilePath& path, int max_files);
47
48 // Deletes all files in the directory at |path| but not in set |iconpath_set|.
49 void DeleteNonCachedFiles(const base::FilePath& path,
50 const std::set<base::FilePath>& iconpath_set);
grt (UTC plus 2) 2017/05/11 20:29:13 nit: iconpath_set -> cached_files since these are
chengx 2017/05/12 01:04:24 Done.
51
42 #endif // CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_ 52 #endif // CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698