Bug 1494195 - Back out bug 1491946, using '.fxsnapshot.gz' for memory heap snapshots. r=fitzgen

This commit is contained in:
Jim Blandy 2018-10-11 15:13:47 -07:00
parent adeba320b0
commit 4c4f2bf1a3
8 changed files with 15 additions and 18 deletions

View File

@ -27,7 +27,7 @@ snapshot.io.save.window=Save Snapshot
snapshot.io.import.window=Import Snapshot
# LOCALIZATION NOTE (snapshot.io.filter): The title for the filter used to
# filter file types (*.fxsnapshot.gz)
# filter file types (*.fxsnapshot)
snapshot.io.filter=Firefox Snapshots
# LOCALIZATION NOTE (aggregate.mb): The label annotating the number of bytes (in

View File

@ -19,8 +19,7 @@ exports.pickFileAndExportSnapshot = function(snapshot) {
const outputFile = await openFilePicker({
title: L10N.getFormatStr("snapshot.io.save.window"),
defaultName: OS.Path.basename(snapshot.path),
filters: [[L10N.getFormatStr("snapshot.io.filter"),
"*.fxsnapshot; *.fxsnapshot.gz"]],
filters: [[L10N.getFormatStr("snapshot.io.filter"), "*.fxsnapshot"]],
mode: "save",
});
@ -54,8 +53,7 @@ exports.pickFileAndImportSnapshotAndCensus = function(heapWorker) {
return async function(dispatch, getState) {
const input = await openFilePicker({
title: L10N.getFormatStr("snapshot.io.import.window"),
filters: [[L10N.getFormatStr("snapshot.io.filter"),
"*.fxsnapshot; *.fxsnapshot.gz"]],
filters: [[L10N.getFormatStr("snapshot.io.filter"), "*.fxsnapshot"]],
mode: "open",
});

View File

@ -126,7 +126,7 @@ function waitUntilCensusState(store, getCensus, expected) {
}
async function createTempFile() {
const file = FileUtils.getFile("TmpD", ["tmp.fxsnapshot.gz"]);
const file = FileUtils.getFile("TmpD", ["tmp.fxsnapshot"]);
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
const destPath = file.path;
const stat = await OS.File.stat(destPath);

View File

@ -42,9 +42,8 @@ exports.getSnapshotTitle = function(snapshot) {
}
if (snapshot.imported) {
// Strip out the extension if it's the expected ".fxsnapshot.gz"
// (".gz" optional)
return OS.Path.basename(snapshot.path.replace(/\.fxsnapshot(?:\.gz)?$/, ""));
// Strip out the extension if it's the expected ".fxsnapshot"
return OS.Path.basename(snapshot.path.replace(/\.fxsnapshot$/, ""));
}
const date = new Date(snapshot.creationTime / 1000);

View File

@ -1449,7 +1449,7 @@ HeapSnapshot::CreateUniqueCoreDumpFile(ErrorResult& rv,
return nullptr;
auto ms = msSinceProcessCreation(now);
rv = file->AppendNative(nsPrintfCString("%lu.fxsnapshot.gz", ms));
rv = file->AppendNative(nsPrintfCString("%lu.fxsnapshot", ms));
if (NS_WARN_IF(rv.Failed()))
return nullptr;
@ -1464,7 +1464,7 @@ HeapSnapshot::CreateUniqueCoreDumpFile(ErrorResult& rv,
// The snapshot ID must be computed in the process that created the
// temp file, because TmpD may not be the same in all processes.
outSnapshotId.Assign(Substring(outFilePath, tempPath.Length() + 1,
outFilePath.Length() - tempPath.Length() - sizeof(".fxsnapshot.gz")));
outFilePath.Length() - tempPath.Length() - sizeof(".fxsnapshot")));
return file.forget();
}

View File

@ -116,7 +116,7 @@ public:
uint32_t size,
ErrorResult& rv);
// Creates the `$TEMP_DIR/XXXXXX-XXX.fxsnapshot.gz` core dump file that heap
// Creates the `$TEMP_DIR/XXXXXX-XXX.fxsnapshot` core dump file that heap
// snapshots are serialized into.
static already_AddRefed<nsIFile> CreateUniqueCoreDumpFile(ErrorResult& rv,
const TimeStamp& now,

View File

@ -15,8 +15,8 @@
//
// The heap snapshot file path conventions permits the following forms:
//
// $TEMP_DIRECTORY/XXXXXXXXXX.fxsnapshot.gz
// $TEMP_DIRECTORY/XXXXXXXXXX-XXXXX.fxsnapshot.gz
// $TEMP_DIRECTORY/XXXXXXXXXX.fxsnapshot
// $TEMP_DIRECTORY/XXXXXXXXXX-XXXXX.fxsnapshot
//
// Where the strings of "X" are zero or more digits.
@ -28,7 +28,7 @@ loader.lazyRequireGetter(this, "FileUtils",
loader.lazyRequireGetter(this, "OS", "resource://gre/modules/osfile.jsm", true);
function getHeapSnapshotFileTemplate() {
return OS.Path.join(OS.Constants.Path.tmpDir, `${Date.now()}.fxsnapshot.gz`);
return OS.Path.join(OS.Constants.Path.tmpDir, `${Date.now()}.fxsnapshot`);
}
/**
@ -63,7 +63,7 @@ exports.getHeapSnapshotTempFilePath = function(snapshotId) {
if (!isValidSnapshotFileId(snapshotId)) {
return null;
}
return OS.Path.join(OS.Constants.Path.tmpDir, snapshotId + ".fxsnapshot.gz");
return OS.Path.join(OS.Constants.Path.tmpDir, snapshotId + ".fxsnapshot");
};
/**

View File

@ -36,7 +36,7 @@ namespace ChromeUtils {
* @returns The path to the file the heap snapshot was written
* to. This is guaranteed to be within the temp
* directory and its file name will match the regexp
* `\d+(\-\d+)?\.fxsnapshot.gz`.
* `\d+(\-\d+)?\.fxsnapshot`.
*/
[Throws]
DOMString saveHeapSnapshot(optional HeapSnapshotBoundaries boundaries);
@ -46,7 +46,7 @@ namespace ChromeUtils {
*
* @returns The snapshot ID of the file. This is the file name
* without the temp directory or the trailing
* `.fxsnapshot.gz`.
* `.fxsnapshot`.
*/
[Throws]
DOMString saveHeapSnapshotGetId(optional HeapSnapshotBoundaries boundaries);