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

Unified Diff: chrome/browser/win/jumplist_file_util.h

Issue 2836363003: Retire some metrics and update file util methods for JumpList (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into retiresomejumplistmetrics 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/win/jumplist.cc ('k') | chrome/browser/win/jumplist_file_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist_file_util.h
diff --git a/chrome/browser/win/jumplist_file_util.h b/chrome/browser/win/jumplist_file_util.h
index b22638791e8419629385d493f2a58a53b6f60aca..6d53ec2595271bf78e2a04ba2735859baf45e628 100644
--- a/chrome/browser/win/jumplist_file_util.h
+++ b/chrome/browser/win/jumplist_file_util.h
@@ -10,53 +10,15 @@
// Maximum number of icon files allowed to delete per jumplist update.
const int kFileDeleteLimit = 30;
-// Folder delete status enumeration, used in Delete* methods below.
-// This is used for UMA. Do not delete entries, and keep in sync with
-// histograms.xml.
-enum FolderDeleteResult {
- SUCCEED = 0,
- // File name's length exceeds MAX_PATH. This shouldn't happen.
- FAIL_INVALID_FILE_PATH,
- // JumpListIcons{,Old} directories are read-only. This may heppen.
- FAIL_READ_ONLY_DIRECTORY,
- // Since JumpListIcons{,Old} are directories. This shouldn't happen.
- FAIL_DELETE_SINGLE_FILE,
- // JumpListIcons{,Old} should not have sub-directories, so this shouldn't
- // happen. If this happens, the root cause must be found.
- FAIL_SUBDIRECTORY_EXISTS,
- // Delete maximum files allowed succeeds. However, in the process of deleting
- // these files, it fails to delete some other files. This may happen.
- FAIL_DELETE_MAX_FILES_WITH_ERRORS,
- // Fail to delete maximum files allowed when the maximum attempt failures
- // are hit. This may heppen.
- FAIL_MAX_DELETE_FAILURES,
- // Fail to remove the raw empty directory. This may happen.
- FAIL_REMOVE_RAW_DIRECTORY,
- // Add new items before this one, always keep this one at the end.
- END
-};
-
-// An enumeration indicating if a directory exists or if it is empty or not.
-// This is used for UMA. Do not delete entries, and keep in sync with
-// histograms.xml.
-enum DirectoryStatus {
- EMPTY = 0,
- NON_EMPTY,
- NON_EXIST,
- // Add new items before this one, always keep this one at the end.
- DIRECTORY_STATUS_END
-};
-
// This method is similar to base::DeleteFileRecursive in
// file_util_win.cc with the following differences.
// 1) It has an input parameter |max_file_deleted| to specify the maximum files
// allowed to delete as well as the maximum attempt failures allowd per run.
// 2) It deletes only the files in |path|. All subdirectories in |path| are
// untouched but are considered as attempt failures.
-// 3) Detailed delete status is returned.
-FolderDeleteResult DeleteFiles(const base::FilePath& path,
- const base::FilePath::StringType& pattern,
- int max_file_deleted);
+void DeleteFiles(const base::FilePath& path,
+ const base::FilePath::StringType& pattern,
+ int max_file_deleted);
// This method is similar to base::DeleteFile in file_util_win.cc
// with the following differences.
@@ -65,21 +27,16 @@ FolderDeleteResult DeleteFiles(const base::FilePath& path,
// 2) It deletes only the files in |path|. All subdirectories in |path| are
// untouched but are considered as attempt failures.
// 3) |path| won't be removed even if all its contents are deleted successfully.
-// 4) Detailed delete status is returned.
-FolderDeleteResult DeleteDirectoryContent(const base::FilePath& path,
- int max_file_deleted);
+void DeleteDirectoryContent(const base::FilePath& path, int max_file_deleted);
// This method firstly calls DeleteDirectoryContent() to delete the contents in
// |path|. If |path| is empty after the call, it is removed.
-FolderDeleteResult DeleteDirectory(const base::FilePath& path,
- int max_file_deleted);
-
-// Deletes the directory at |path| and records the result to UMA.
-void DeleteDirectoryAndLogResults(const base::FilePath& path,
- int max_file_deleted);
+void DeleteDirectory(const base::FilePath& path, int max_file_deleted);
-// Deletes the content in the directory at |path| and records the result to UMA.
-void DeleteDirectoryContentAndLogResults(const base::FilePath& path,
+// Deletes the content in the folder at |path| and records the runtime to UMA.
+// TODO(chengx): Remove this method and use DeleteDirectoryContent after fixing
+// http://crbug.com/40407.
+void DeleteDirectoryContentAndLogRuntime(const base::FilePath& path,
int max_file_deleted);
#endif // CHROME_BROWSER_WIN_JUMPLIST_FILE_UTIL_H_
« no previous file with comments | « chrome/browser/win/jumplist.cc ('k') | chrome/browser/win/jumplist_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698