Bug 1521191, part 3 - Add a function to create a negative leak. r=froydnj

This is needed to test the test harness's handling of a negative leak
being reported by the XPCOM leak checker.

Depends on D17535

Differential Revision: https://phabricator.services.mozilla.com/D17536

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2019-01-24 21:29:40 +00:00
Родитель 16351e63ce
Коммит 5c1bc6074f
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -329,6 +329,12 @@ interface nsIXPCComponents_Utils : nsISupports
*/
void intentionallyLeak();
/*
* In a debug build, cause the XPCOM leak checker to report a negative leak.
* This is needed to test leak checking.
*/
void intentionallyLeakNegatively();
/*
* In a debug build, make XPCOM not print out a bloat log in this process.
* This is needed to test leak checking.

Просмотреть файл

@ -1758,6 +1758,16 @@ nsXPCComponents_Utils::IntentionallyLeak() {
#endif
}
NS_IMETHODIMP
nsXPCComponents_Utils::IntentionallyLeakNegatively() {
#ifdef DEBUG
MOZ_COUNT_DTOR(IntentionallyLeakedObject);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
}
NS_IMETHODIMP
nsXPCComponents_Utils::DisableDumpStatistics() {
#ifdef DEBUG