summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/src/XPCJSContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/xpconnect/src/XPCJSContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
index 8f3621f9c5..4125a90147 100644
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -25,6 +25,7 @@
#include "nsPrintfCString.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
+#include "mozilla/MemoryTelemetry.h"
#include "mozilla/Services.h"
#ifdef FUZZING
# include "mozilla/StaticPrefs_fuzzing.h"
@@ -1433,6 +1434,11 @@ void XPCJSContext::AfterProcessTask(uint32_t aNewRecursionDepth) {
nsJSContext::MaybePokeCC();
CycleCollectedJSContext::AfterProcessTask(aNewRecursionDepth);
+ // Poke the memory telemetry reporter
+ if (AppShutdown::GetCurrentShutdownPhase() == ShutdownPhase::NotInShutdown) {
+ MemoryTelemetry::Get().Poke();
+ }
+
// This exception might have been set if we called an XPCWrappedJS that threw,
// but now we're returning to the event loop, so nothing is going to look at
// this value again. Clear it to prevent leaks.