Skip to content

Commit fbf93a0

Browse files
committed
Bug 1505522: Part 3 - Remove unused getHeapAllocatedAsync method. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D13873 UltraBlame original commit: fba99cab2299592c3bb7a055aaa320d35bafe5f1
1 parent c680fba commit fbf93a0

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

xpcom/base/nsIMemoryReporter.idl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,6 @@ interface nsIMemoryReporterManager : nsISupports
419419
[infallible] readonly attribute boolean isDMDEnabled;
420420
[infallible] readonly attribute boolean isDMDRunning;
421421

422-
/*
423-
* Asynchronously gets attribute 'heapAllocated'. The value is returned in
424-
* the callback argument.
425-
*/
426-
[must_use] void getHeapAllocatedAsync(in nsIHeapAllocatedCallback callback);
427-
428422
/*
429423
* Run a series of GC/CC's in an attempt to minimize the application's memory
430424
* usage. When we're finished, we invoke the given runnable if it's not

xpcom/base/nsMemoryReporterManager.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,49 +2404,6 @@ nsMemoryReporterManager::GetHeapAllocated(int64_t* aAmount) {
24042404
#endif
24052405
}
24062406

2407-
NS_IMETHODIMP
2408-
nsMemoryReporterManager::GetHeapAllocatedAsync(
2409-
nsIHeapAllocatedCallback* aCallback) {
2410-
#ifdef HAVE_JEMALLOC_STATS
2411-
if (!mThreadPool) {
2412-
return NS_ERROR_UNEXPECTED;
2413-
}
2414-
2415-
RefPtr<nsIMemoryReporterManager> self{this};
2416-
nsMainThreadPtrHandle<nsIHeapAllocatedCallback> mainThreadCallback(
2417-
new nsMainThreadPtrHolder<nsIHeapAllocatedCallback>(
2418-
"HeapAllocatedCallback", aCallback));
2419-
2420-
nsCOMPtr<nsIRunnable> getHeapAllocatedRunnable = NS_NewRunnableFunction(
2421-
"nsMemoryReporterManager::GetHeapAllocatedAsync",
2422-
[self, mainThreadCallback]() mutable {
2423-
MOZ_ASSERT(!NS_IsMainThread());
2424-
2425-
int64_t heapAllocated = 0;
2426-
nsresult rv = self->GetHeapAllocated(&heapAllocated);
2427-
2428-
nsCOMPtr<nsIRunnable> resultCallbackRunnable = NS_NewRunnableFunction(
2429-
"nsMemoryReporterManager::GetHeapAllocatedAsync",
2430-
[mainThreadCallback, heapAllocated, rv]() mutable {
2431-
MOZ_ASSERT(NS_IsMainThread());
2432-
2433-
if (NS_FAILED(rv)) {
2434-
mainThreadCallback->Callback(0);
2435-
return;
2436-
}
2437-
2438-
mainThreadCallback->Callback(heapAllocated);
2439-
});
2440-
2441-
Unused << NS_DispatchToMainThread(resultCallbackRunnable);
2442-
});
2443-
2444-
return mThreadPool->Dispatch(getHeapAllocatedRunnable, NS_DISPATCH_NORMAL);
2445-
#else
2446-
return NS_ERROR_NOT_AVAILABLE;
2447-
#endif
2448-
}
2449-
24502407

24512408
NS_IMETHODIMP
24522409
nsMemoryReporterManager::GetHeapOverheadFraction(int64_t* aAmount) {

0 commit comments

Comments
 (0)