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

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

Issue 2281373002: [Android] Do not immediately delete skipped crash dump uploads. (Closed)
Patch Set: Created 4 years, 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java b/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
index 01b0aa10566e898bbd87ab90f66ad52d08a82095..15fb25a7097bce3f1a93b2b3593f5eb94a707a90 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
@@ -98,16 +98,16 @@ public class MinidumpUploadCallable implements Callable<Integer> {
Log.i(TAG, "Minidump upload enabled for tests, skipping other checks.");
} else {
if (!mPermManager.isUploadUserPermitted()) {
- Log.i(TAG, "Minidump upload is not permitted by user. Marking file as uploaded for "
- + "cleanup to prevent future uploads.");
- cleanupMinidumpFile();
+ Log.i(TAG, "Minidump upload is not permitted by user. Marking file as skipped for "
+ + "cleanup to prevent future uploads.");
+ CrashFileManager.markUploadSkipped(mFileToUpload);
return UPLOAD_USER_DISABLED;
}
if (!mPermManager.isClientInMetricsSample()) {
- Log.i(TAG, "Minidump upload skipped due to sampling. Marking file as uploaded for "
+ Log.i(TAG, "Minidump upload skipped due to sampling. Marking file as skipped for "
+ "cleanup to prevent future uploads.");
- cleanupMinidumpFile();
+ CrashFileManager.markUploadSkipped(mFileToUpload);
return UPLOAD_DISABLED_BY_SAMPLING;
}
@@ -189,7 +189,7 @@ public class MinidumpUploadCallable implements Callable<Integer> {
// TODO(acleung): MinidumpUploadService is in charge of renaming while this class is
// in charge of deleting. We should move all the file system operations into
// MinidumpUploadService instead.
- cleanupMinidumpFile();
+ CrashFileManager.markUploadSuccess(mFileToUpload);
try {
appendUploadedEntryToLog(id);
@@ -260,21 +260,6 @@ public class MinidumpUploadCallable implements Callable<Integer> {
}
/**
- * Mark file we just uploaded for cleanup later.
- *
- * We do not immediately delete the file for testing reasons,
- * but if marking the file fails, we do delete it right away.
- */
- private void cleanupMinidumpFile() {
- if (!CrashFileManager.tryMarkAsUploaded(mFileToUpload)) {
- Log.w(TAG, "Unable to mark " + mFileToUpload + " as uploaded.");
- if (!mFileToUpload.delete()) {
- Log.w(TAG, "Cannot delete " + mFileToUpload);
- }
- }
- }
-
- /**
* Returns whether the response code indicates a successful HTTP request.
*
* @param responseCode the response code

Powered by Google App Engine
This is Rietveld 408576698