diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 0c8b0f6905ef..a177e3eca758 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2090,10 +2090,15 @@ CCRunnerFired(TimeStamp aDeadline, void* aData) // Our efforts to avoid a CC have failed, so we return to let the // timer fire once more to trigger a CC. - // Clear content unbinder before the first CC slice. - Element::ClearContentUnbinder(); - // And trigger deferred deletion too. - nsCycleCollector_doDeferredDeletion(); + if (!aDeadline.IsNull() && TimeStamp::Now() < aDeadline) { + // Clear content unbinder before the first CC slice. + Element::ClearContentUnbinder(); + + if (TimeStamp::Now() < aDeadline) { + // And trigger deferred deletion too. + nsCycleCollector_doDeferredDeletion(); + } + } return didDoWork; } } else { diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index f16c4bc6829b..a6c49cc85b9e 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -140,7 +140,7 @@ public: nsresult Dispatch() { nsCOMPtr self(this); - return NS_IdleDispatchToCurrentThread(self.forget(), 1000); + return NS_IdleDispatchToCurrentThread(self.forget(), 2500); } void Start(bool aContinuation = false, bool aPurge = false)