From 0b41b8c34d92c4d0965c2b507b4820e1e62bb55e Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Thu, 15 Jun 2017 19:44:32 +0300 Subject: [PATCH] Bug 1373067 - Ensure CC isn't started too often, r=mccr8 --- dom/base/nsJSEnvironment.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 6cf4fe0a132c..8571ee45c934 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2315,6 +2315,11 @@ nsJSContext::MaybePokeCC() return; } + uint32_t sinceLastCCEnd = TimeUntilNow(sLastCCEndTime); + if (sinceLastCCEnd && sinceLastCCEnd < NS_CC_DELAY) { + return; + } + if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) { sCCRunnerFireCount = 0;