Skip to content

Commit

Permalink
[Cleanup] Remove some temporary filename migration logic.
Browse files Browse the repository at this point in the history
R=gsennton@chromium.org

Bug: 719120
Change-Id: Ia79a95b278d1f1af6ba8c00a522d39a94f32b03f
Reviewed-on: https://chromium-review.googlesource.com/616253
Reviewed-by: Gustav Sennton <gsennton@chromium.org>
Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org>
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496044}
  • Loading branch information
ishermandom authored and Commit Bot committed Aug 21, 2017
1 parent 182db0e commit 788cbde
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.components.minidump_uploader.CrashFileManager;
import org.chromium.components.minidump_uploader.MinidumpUploaderDelegate;
import org.chromium.components.minidump_uploader.util.CrashReportingPermissionManager;
import org.chromium.components.minidump_uploader.util.NetworkPermissionUtil;
Expand Down Expand Up @@ -88,12 +87,4 @@ public void recordUploadSuccess(File minidump) {}

@Override
public void recordUploadFailure(File minidump) {}

@Override
public void migrateMinidumpFilenamesIfNeeded(CrashFileManager crashFileManager) {
File[] minidumpFilesUsingOldNamingScheme = crashFileManager.getMinidumpsSansLogcat();
for (File minidump : minidumpFilesUsingOldNamingScheme) {
CrashFileManager.trySetReadyForUpload(minidump);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.os.PersistableBundle;

import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
import org.chromium.components.minidump_uploader.CrashFileManager;
import org.chromium.components.minidump_uploader.MinidumpUploaderDelegate;
import org.chromium.components.minidump_uploader.util.CrashReportingPermissionManager;
import org.chromium.components.minidump_uploader.util.NetworkPermissionUtil;
Expand Down Expand Up @@ -99,10 +98,4 @@ public void recordUploadSuccess(File minidump) {
public void recordUploadFailure(File minidump) {
MinidumpUploadService.incrementCrashFailureUploadCount(minidump.getAbsolutePath());
}

@Override
public void migrateMinidumpFilenamesIfNeeded(CrashFileManager crashFileManager) {
// Minidump filenames are migrated as part of attaching logcats within the
// ProcessInitializationHandler, and hence there is no need to migrate them here.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ public class CrashFileManager {
private static final Pattern MINIDUMP_READY_FOR_UPLOAD_PATTERN =
Pattern.compile("\\.(dmp|forced)([0-9]*)(\\.try([0-9]+))\\z");

// TODO(isherman): The ".tryN" suffix is currently optional, so that old uploaded minidump files
// will continue to be detected as such. However, new uploads are guaranteed to include this
// suffix. Tighten this regex (by removing the final '?') in roughly the M61 timeframe:
// http://crbug.com/719120
private static final Pattern UPLOADED_MINIDUMP_PATTERN =
Pattern.compile("\\.up([0-9]*)(\\.try([0-9]+))?\\z");
Pattern.compile("\\.up([0-9]*)(\\.try([0-9]+))\\z");

private static final String NOT_YET_UPLOADED_MINIDUMP_SUFFIX = ".dmp";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,4 @@ public interface MinidumpUploaderDelegate {
* @param minidump The minidump filename, prior to the upload attempt.
*/
void recordUploadFailure(File minidump);

/**
* Prior to M60, the ".tryN" suffix was optional for files ready to be uploaded; it is now
* required. Clients may implement this method to migrate previously saved minidumps to the new
* naming scheme, if necessary.
* Note: Because renaming files is a file operation, this method should never be called on the
* UI thread; only on a background thread.
* @param crashfileManager The file manager responsible for the set of minidumps that might need
* migration.
* TODO(isherman): This is temporary migration logic, and can be removed in M61:
* http://crbug.com/719120.
*/
void migrateMinidumpFilenamesIfNeeded(CrashFileManager crashFileManager);
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,6 @@ public void run() {
}
}

// Prior to M60, the ".tryN" suffix was optional for files ready to be uploaded; it is
// now required. Give clients a chance to migrate previously saved off minidumps to the
// new naming scheme, if necessary. Do this after attempting to upload existing crash
// dumps, to ensure that if the task is rescheduled, it has a chance to make progress on
// the most important task first.
mDelegate.migrateMinidumpFilenamesIfNeeded(fileManager);

// Clean out old/uploaded minidumps. Note that this clean-up method is more strict than
// our copying mechanism in the sense that it keeps fewer minidumps.
fileManager.cleanOutAllNonFreshMinidumpFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,4 @@ public void recordUploadSuccess(File minidump) {}

@Override
public void recordUploadFailure(File minidump) {}

@Override
public void migrateMinidumpFilenamesIfNeeded(CrashFileManager crashFileManager) {}
}

0 comments on commit 788cbde

Please sign in to comment.