diff --git a/xpcom/base/CycleCollectedJSContext.cpp b/xpcom/base/CycleCollectedJSContext.cpp index 220775d1a..12456b3bf 100644 --- a/xpcom/base/CycleCollectedJSContext.cpp +++ b/xpcom/base/CycleCollectedJSContext.cpp @@ -1421,6 +1421,8 @@ CycleCollectedJSContext::ProcessStableStateQueue() MOZ_RELEASE_ASSERT(!mDoingStableStates); mDoingStableStates = true; + // When run, one event can add another event to the mStableStateEvents, as + // such you can't use iterators here. for (uint32_t i = 0; i < mStableStateEvents.Length(); ++i) { nsCOMPtr event = mStableStateEvents[i].forget(); event->Run(); @@ -1508,7 +1510,7 @@ CycleCollectedJSContext::AfterProcessMicrotasks() } uint32_t -CycleCollectedJSContext::RecursionDepth() +CycleCollectedJSContext::RecursionDepth() const { return mOwningThread->RecursionDepth(); } diff --git a/xpcom/base/CycleCollectedJSContext.h b/xpcom/base/CycleCollectedJSContext.h index 9faa16671..b312a689f 100644 --- a/xpcom/base/CycleCollectedJSContext.h +++ b/xpcom/base/CycleCollectedJSContext.h @@ -364,7 +364,7 @@ public: virtual void BeforeProcessTask(bool aMightBlock); virtual void AfterProcessTask(uint32_t aRecursionDepth); - uint32_t RecursionDepth(); + uint32_t RecursionDepth() const; // Run in stable state (call through nsContentUtils) void RunInStableState(already_AddRefed&& aRunnable); @@ -404,12 +404,12 @@ public: } } - bool IsInMicroTask() + bool IsInMicroTask() const { return mMicroTaskLevel != 0; } - uint32_t MicroTaskLevel() + uint32_t MicroTaskLevel() const { return mMicroTaskLevel; } @@ -423,7 +423,7 @@ public: void PerformDebuggerMicroTaskCheckpoint(); - bool IsInStableOrMetaStableState() + bool IsInStableOrMetaStableState() const { return mDoingStableStates; }