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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java

Issue 2469403002: Post-commit review comments for CrashFileManager (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java b/chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java
index f7c4679b3a2c2179a2c66aa8f9d95d44d717789c..cd16f373eec1ef156dbf55ca1beff547c21daf1d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java
@@ -292,7 +292,7 @@ public class CrashFileManager {
*/
@VisibleForTesting
static File[] getFilesBelowMaxTries(File[] unfilteredFiles, int maxTries) {
- List<File> filesBelowMaxTries = new ArrayList<>(unfilteredFiles.length);
+ List<File> filesBelowMaxTries = new ArrayList<>();
for (File file : unfilteredFiles) {
if (readAttemptNumber(file.getName()) < maxTries) {
filesBelowMaxTries.add(file);
@@ -301,6 +301,9 @@ public class CrashFileManager {
return filesBelowMaxTries.toArray(new File[filesBelowMaxTries.size()]);
}
+ /**
+ * Returns a sorted and filtered list of files within the crash directory.
+ */
@VisibleForTesting
File[] listCrashFiles(@Nullable final Pattern pattern) {
File crashDir = getCrashDirectory();
@@ -314,13 +317,13 @@ public class CrashFileManager {
}
};
}
- File[] minidumps = crashDir.listFiles(filter);
- if (minidumps == null) {
+ File[] foundFiles = crashDir.listFiles(filter);
+ if (foundFiles == null) {
Log.w(TAG, crashDir.getAbsolutePath() + " does not exist or is not a directory");
return new File[] {};
}
- Arrays.sort(minidumps, sFileComparator);
- return minidumps;
+ Arrays.sort(foundFiles, sFileComparator);
+ return foundFiles;
}
@VisibleForTesting
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698