mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Remove the Dark Matter Detector (DMD) Memeory debugger component.
This resolves #376.
This commit is contained in:
parent
4f9e1b3147
commit
92fbd042f5
55 changed files with 6 additions and 6544 deletions
|
|
@ -766,65 +766,3 @@ nsMemoryInfoDumper::DumpMemoryInfoToTempDir(const nsAString& aIdentifier,
|
|||
aAnonymize, aMinimizeMemoryUsage, identifier);
|
||||
}
|
||||
|
||||
#ifdef MOZ_DMD
|
||||
dmd::DMDFuncs::Singleton dmd::DMDFuncs::sSingleton;
|
||||
|
||||
nsresult
|
||||
nsMemoryInfoDumper::OpenDMDFile(const nsAString& aIdentifier, int aPid,
|
||||
FILE** aOutFile)
|
||||
{
|
||||
if (!dmd::IsRunning()) {
|
||||
*aOutFile = nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Create a filename like dmd-<identifier>-<pid>.json.gz, which will be used
|
||||
// if DMD is enabled.
|
||||
nsCString dmdFilename;
|
||||
MakeFilename("dmd", aIdentifier, aPid, "json.gz", dmdFilename);
|
||||
|
||||
// Open a new DMD file named |dmdFilename| in NS_OS_TEMP_DIR for writing,
|
||||
// and dump DMD output to it. This must occur after the memory reporters
|
||||
// have been run (above), but before the memory-reports file has been
|
||||
// renamed (so scripts can detect the DMD file, if present).
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIFile> dmdFile;
|
||||
rv = nsDumpUtils::OpenTempFile(dmdFilename,
|
||||
getter_AddRefs(dmdFile),
|
||||
NS_LITERAL_CSTRING("memory-reports"));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
rv = dmdFile->OpenANSIFileDesc("wb", aOutFile);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "OpenANSIFileDesc failed");
|
||||
|
||||
// Print the path, because on some platforms (e.g. Mac) it's not obvious.
|
||||
nsCString path;
|
||||
rv = dmdFile->GetNativePath(path);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
dmd::StatusMsg("opened %s for writing\n", path.get());
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsMemoryInfoDumper::DumpDMDToFile(FILE* aFile)
|
||||
{
|
||||
RefPtr<nsGZFileWriter> gzWriter = new nsGZFileWriter();
|
||||
nsresult rv = gzWriter->InitANSIFileDesc(aFile);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Dump DMD's memory reports analysis to the file.
|
||||
dmd::Analyze(MakeUnique<GZWriterWrapper>(gzWriter));
|
||||
|
||||
rv = gzWriter->Finish();
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Finish failed");
|
||||
return rv;
|
||||
}
|
||||
#endif // MOZ_DMD
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue