зеркало из https://github.com/mozilla/gecko-dev.git
Bug 831193 (part 21) - Make NumGhostsReporter a subclass of MemoryReporterBase. r=jlebar.
--HG-- extra : rebase_source : 8777a4dabebdb5928c200401445d7c29f5bf3bcb
This commit is contained in:
Родитель
0560a01150
Коммит
12d6eb61be
|
@ -752,47 +752,6 @@ GhostURLsReporter::CollectReports(
|
|||
return reportGhostWindowsEnumData.rv;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsWindowMemoryReporter::NumGhostsReporter,
|
||||
nsIMemoryReporter)
|
||||
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::NumGhostsReporter(
|
||||
nsWindowMemoryReporter *aWindowReporter)
|
||||
: mWindowReporter(aWindowReporter)
|
||||
{}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::GetProcess(nsACString& aProcess)
|
||||
{
|
||||
aProcess.AssignLiteral("");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::GetPath(nsACString& aPath)
|
||||
{
|
||||
aPath.AssignLiteral("ghost-windows");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::GetKind(int32_t* aKind)
|
||||
{
|
||||
*aKind = KIND_OTHER;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::GetUnits(int32_t* aUnits)
|
||||
{
|
||||
*aUnits = nsIMemoryReporter::UNITS_COUNT;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::GetDescription(nsACString& aDesc)
|
||||
|
@ -812,14 +771,11 @@ in the browser or add-ons.",
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowMemoryReporter::
|
||||
NumGhostsReporter::GetAmount(int64_t* aAmount)
|
||||
int64_t
|
||||
nsWindowMemoryReporter::NumGhostsReporter::Amount()
|
||||
{
|
||||
nsTHashtable<nsUint64HashKey> ghostWindows;
|
||||
ghostWindows.Init();
|
||||
mWindowReporter->CheckForGhostWindows(&ghostWindows);
|
||||
|
||||
*aAmount = ghostWindows.Count();
|
||||
return NS_OK;
|
||||
return ghostWindows.Count();
|
||||
}
|
||||
|
|
|
@ -142,15 +142,20 @@ private:
|
|||
* nsGhostWindowReporter generates the "ghost-windows" single-report, which
|
||||
* counts the number of ghost windows present.
|
||||
*/
|
||||
class NumGhostsReporter MOZ_FINAL : public nsIMemoryReporter
|
||||
class NumGhostsReporter MOZ_FINAL : public mozilla::MemoryReporterBase
|
||||
{
|
||||
public:
|
||||
NumGhostsReporter(nsWindowMemoryReporter* aWindowReporter);
|
||||
NumGhostsReporter(nsWindowMemoryReporter* aWindowReporter)
|
||||
// Description is "???" because we define GetDescription below.
|
||||
: MemoryReporterBase("ghost-windows", KIND_OTHER, UNITS_COUNT, "???")
|
||||
, mWindowReporter(aWindowReporter)
|
||||
{}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIMEMORYREPORTER
|
||||
NS_IMETHOD GetDescription(nsACString& aDesc);
|
||||
|
||||
private:
|
||||
int64_t Amount() MOZ_OVERRIDE;
|
||||
|
||||
nsRefPtr<nsWindowMemoryReporter> mWindowReporter;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче