@@ -2404,49 +2404,6 @@ nsMemoryReporterManager::GetHeapAllocated(int64_t* aAmount) {
2404
2404
#endif
2405
2405
}
2406
2406
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
-
2450
2407
2451
2408
NS_IMETHODIMP
2452
2409
nsMemoryReporterManager::GetHeapOverheadFraction (int64_t * aAmount) {
0 commit comments