Loading layout/base/PresShell.cpp +20 −33 Original line number Diff line number Diff line Loading @@ -738,8 +738,8 @@ void PresShell::AddWeakFrame(WeakFrame* aWeakFrame) { if (aWeakFrame->GetFrame()) { aWeakFrame->GetFrame()->AddStateBits(NS_FRAME_EXTERNAL_REFERENCE); } MOZ_ASSERT(!mWeakFrames.GetEntry(aWeakFrame)); mWeakFrames.PutEntry(aWeakFrame); MOZ_ASSERT(!mWeakFrames.Contains(aWeakFrame)); mWeakFrames.Insert(aWeakFrame); } void PresShell::RemoveAutoWeakFrame(AutoWeakFrame* aWeakFrame) { Loading @@ -757,8 +757,8 @@ void PresShell::RemoveAutoWeakFrame(AutoWeakFrame* aWeakFrame) { } void PresShell::RemoveWeakFrame(WeakFrame* aWeakFrame) { MOZ_ASSERT(mWeakFrames.GetEntry(aWeakFrame)); mWeakFrames.RemoveEntry(aWeakFrame); MOZ_ASSERT(mWeakFrames.Contains(aWeakFrame)); mWeakFrames.Remove(aWeakFrame); } already_AddRefed<nsFrameSelection> PresShell::FrameSelection() { Loading Loading @@ -1458,11 +1458,8 @@ void PresShell::Destroy() { while (mAutoWeakFrames) { mAutoWeakFrames->Clear(this); } nsTArray<WeakFrame*> toRemove(mWeakFrames.Count()); for (auto iter = mWeakFrames.ConstIter(); !iter.Done(); iter.Next()) { toRemove.AppendElement(iter.Get()->GetKey()); } for (WeakFrame* weakFrame : toRemove) { const nsTArray<WeakFrame*> weakFrames = ToArray(mWeakFrames); for (WeakFrame* weakFrame : weakFrames) { weakFrame->Clear(this); } Loading Loading @@ -2242,12 +2239,12 @@ void PresShell::NotifyDestroyingFrame(nsIFrame* aFrame) { } } mFramesToDirty.RemoveEntry(aFrame); mFramesToDirty.Remove(aFrame); nsIScrollableFrame* scrollableFrame = do_QueryFrame(aFrame); if (scrollableFrame) { mPendingScrollAnchorSelection.RemoveEntry(scrollableFrame); mPendingScrollAnchorAdjustment.RemoveEntry(scrollableFrame); mPendingScrollAnchorSelection.Remove(scrollableFrame); mPendingScrollAnchorAdjustment.Remove(scrollableFrame); } } } Loading Loading @@ -2669,13 +2666,11 @@ void PresShell::VerifyHasDirtyRootAncestor(nsIFrame* aFrame) { void PresShell::PostPendingScrollAnchorSelection( mozilla::layout::ScrollAnchorContainer* aContainer) { mPendingScrollAnchorSelection.PutEntry(aContainer->ScrollableFrame()); mPendingScrollAnchorSelection.Insert(aContainer->ScrollableFrame()); } void PresShell::FlushPendingScrollAnchorSelections() { for (auto iter = mPendingScrollAnchorSelection.ConstIter(); !iter.Done(); iter.Next()) { nsIScrollableFrame* scroll = iter.Get()->GetKey(); for (nsIScrollableFrame* scroll : mPendingScrollAnchorSelection) { scroll->Anchor()->SelectAnchor(); } mPendingScrollAnchorSelection.Clear(); Loading @@ -2683,13 +2678,11 @@ void PresShell::FlushPendingScrollAnchorSelections() { void PresShell::PostPendingScrollAnchorAdjustment( ScrollAnchorContainer* aContainer) { mPendingScrollAnchorAdjustment.PutEntry(aContainer->ScrollableFrame()); mPendingScrollAnchorAdjustment.Insert(aContainer->ScrollableFrame()); } void PresShell::FlushPendingScrollAnchorAdjustments() { for (auto iter = mPendingScrollAnchorAdjustment.ConstIter(); !iter.Done(); iter.Next()) { nsIScrollableFrame* scroll = iter.Get()->GetKey(); for (nsIScrollableFrame* scroll : mPendingScrollAnchorAdjustment) { scroll->Anchor()->ApplyAdjustments(); } mPendingScrollAnchorAdjustment.Clear(); Loading Loading @@ -2879,7 +2872,7 @@ void PresShell::FrameNeedsToContinueReflow(nsIFrame* aFrame) { NS_ASSERTION(aFrame->HasAnyStateBits(NS_FRAME_IN_REFLOW), "Frame passed in not in reflow?"); mFramesToDirty.PutEntry(aFrame); mFramesToDirty.Insert(aFrame); } already_AddRefed<nsIContent> PresShell::GetContentForScrolling() const { Loading Loading @@ -3076,8 +3069,7 @@ void PresShell::ClearFrameRefs(nsIFrame* aFrame) { } AutoTArray<WeakFrame*, 4> toRemove; for (auto iter = mWeakFrames.ConstIter(); !iter.Done(); iter.Next()) { WeakFrame* weakFrame = iter.Get()->GetKey(); for (WeakFrame* weakFrame : mWeakFrames) { if (weakFrame->GetFrame() == aFrame) { toRemove.AppendElement(weakFrame); } Loading Loading @@ -5831,8 +5823,7 @@ void PresShell::MarkFramesInListApproximatelyVisible( void PresShell::DecApproximateVisibleCount( VisibleFrames& aFrames, const Maybe<OnNonvisible>& aNonvisibleAction /* = Nothing() */) { for (auto iter = aFrames.ConstIter(); !iter.Done(); iter.Next()) { nsIFrame* frame = iter.Get()->GetKey(); for (nsIFrame* frame : aFrames) { // Decrement the frame's visible count if we're still tracking its // visibility. (We may not be, if the frame disabled visibility tracking // after we added it to the visible frames list.) Loading Loading @@ -9658,11 +9649,9 @@ bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible, bool interrupted = mPresContext->HasPendingInterrupt(); if (interrupted) { // Make sure target gets reflowed again. for (auto iter = mFramesToDirty.ConstIter(); !iter.Done(); iter.Next()) { for (const auto& key : mFramesToDirty) { // Mark frames dirty until target frame. const nsPtrHashKey<nsIFrame>* p = iter.Get(); for (nsIFrame* f = p->GetKey(); f && !f->IsSubtreeDirty(); f = f->GetParent()) { for (nsIFrame* f = key; f && !f->IsSubtreeDirty(); f = f->GetParent()) { f->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); if (f->IsFlexItem()) { nsFlexContainerFrame::MarkCachedFlexMeasurementsDirty(f); Loading Loading @@ -10999,10 +10988,8 @@ nsresult PresShell::UpdateImageLockingState() { if (locked) { // Request decodes for visible image frames; we want to start decoding as // quickly as possible when we get foregrounded to minimize flashing. for (auto iter = mApproximatelyVisibleFrames.ConstIter(); !iter.Done(); iter.Next()) { nsImageFrame* imageFrame = do_QueryFrame(iter.Get()->GetKey()); if (imageFrame) { for (const auto& key : mApproximatelyVisibleFrames) { if (nsImageFrame* imageFrame = do_QueryFrame(key)) { imageFrame->MaybeDecodeForPredictedSize(); } } Loading layout/base/PresShell.h +9 −9 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ #include "nsRefreshObservers.h" #include "nsStringFwd.h" #include "nsStubDocumentObserver.h" #include "nsTHashtable.h" #include "nsTHashSet.h" #include "nsThreadUtils.h" #include "nsWeakReference.h" Loading Loading @@ -157,7 +157,7 @@ class PresShell final : public nsStubDocumentObserver, // A set type for tracking visible frames, for use by the visibility code in // PresShell. The set contains nsIFrame* pointers. typedef nsTHashtable<nsPtrHashKey<nsIFrame>> VisibleFrames; typedef nsTHashSet<nsIFrame*> VisibleFrames; public: explicit PresShell(Document* aDocument); Loading Loading @@ -1705,14 +1705,14 @@ class PresShell final : public nsStubDocumentObserver, void RecordAlloc(void* aPtr) { #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED MOZ_DIAGNOSTIC_ASSERT(!mAllocatedPointers.Contains(aPtr)); mAllocatedPointers.PutEntry(aPtr); mAllocatedPointers.Insert(aPtr); #endif } void RecordFree(void* aPtr) { #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED MOZ_DIAGNOSTIC_ASSERT(mAllocatedPointers.Contains(aPtr)); mAllocatedPointers.RemoveEntry(aPtr); mAllocatedPointers.Remove(aPtr); #endif } Loading Loading @@ -2810,7 +2810,7 @@ class PresShell final : public nsStubDocumentObserver, #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED // We track allocated pointers in a debug-only hashtable to assert against // missing/double frees. nsTHashtable<nsPtrHashKey<void>> mAllocatedPointers; nsTHashSet<void*> mAllocatedPointers; #endif // A list of stack weak frames. This is a pointer to the last item in the Loading @@ -2818,7 +2818,7 @@ class PresShell final : public nsStubDocumentObserver, AutoWeakFrame* mAutoWeakFrames; // A hash table of heap allocated weak frames. nsTHashtable<nsPtrHashKey<WeakFrame>> mWeakFrames; nsTHashSet<WeakFrame*> mWeakFrames; class DirtyRootsList { public: Loading Loading @@ -2912,9 +2912,9 @@ class PresShell final : public nsStubDocumentObserver, nsCOMArray<nsIContent> mCurrentEventContentStack; // Set of frames that we should mark with NS_FRAME_HAS_DIRTY_CHILDREN after // we finish reflowing mCurrentReflowRoot. nsTHashtable<nsPtrHashKey<nsIFrame>> mFramesToDirty; nsTHashtable<nsPtrHashKey<nsIScrollableFrame>> mPendingScrollAnchorSelection; nsTHashtable<nsPtrHashKey<nsIScrollableFrame>> mPendingScrollAnchorAdjustment; nsTHashSet<nsIFrame*> mFramesToDirty; nsTHashSet<nsIScrollableFrame*> mPendingScrollAnchorSelection; nsTHashSet<nsIScrollableFrame*> mPendingScrollAnchorAdjustment; nsCallbackEventRequest* mFirstCallbackEventRequest = nullptr; nsCallbackEventRequest* mLastCallbackEventRequest = nullptr; Loading layout/base/RestyleManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1310,7 +1310,7 @@ void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) { MaybeClearDestroyedFrames maybeClear(mDestroyedFrames); if (!mDestroyedFrames) { mDestroyedFrames = MakeUnique<nsTHashtable<nsPtrHashKey<const nsIFrame>>>(); mDestroyedFrames = MakeUnique<nsTHashSet<const nsIFrame*>>(); } AUTO_PROFILER_LABEL("RestyleManager::ProcessRestyledFrames", LAYOUT); Loading layout/base/RestyleManager.h +3 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "nsPresContext.h" #include "nsPresContextInlines.h" // XXX Shouldn't be included by header though #include "nsStringFwd.h" #include "nsTHashSet.h" class nsAttrValue; class nsCSSFrameConstructor; Loading Loading @@ -245,7 +246,7 @@ class RestyleManager { // If ProcessRestyledFrames is tracking frames which have been // destroyed (to avoid re-visiting them), add this one to its set. if (mDestroyedFrames) { mDestroyedFrames->PutEntry(aFrame); mDestroyedFrames->Insert(aFrame); } } Loading Loading @@ -515,8 +516,7 @@ class RestyleManager { // Used to keep track of frames that have been destroyed during // ProcessRestyledFrames, so we don't try to touch them again even if // they're referenced again later in the changelist. mozilla::UniquePtr<nsTHashtable<nsPtrHashKey<const nsIFrame>>> mDestroyedFrames; mozilla::UniquePtr<nsTHashSet<const nsIFrame*>> mDestroyedFrames; protected: // True if we're in the middle of a nsRefreshDriver refresh Loading layout/base/nsRefreshDriver.cpp +9 −10 Original line number Diff line number Diff line Loading @@ -1315,10 +1315,10 @@ void nsRefreshDriver::RemovePostRefreshObserver( bool nsRefreshDriver::AddImageRequest(imgIRequest* aRequest) { uint32_t delay = GetFirstFrameDelay(aRequest); if (delay == 0) { mRequests.PutEntry(aRequest); mRequests.Insert(aRequest); } else { auto* const start = mStartTable.GetOrInsertNew(delay); start->mEntries.PutEntry(aRequest); start->mEntries.Insert(aRequest); } EnsureTimerStarted(); Loading @@ -1329,12 +1329,12 @@ bool nsRefreshDriver::AddImageRequest(imgIRequest* aRequest) { void nsRefreshDriver::RemoveImageRequest(imgIRequest* aRequest) { // Try to remove from both places, just in case, because we can't tell // whether RemoveEntry() succeeds. mRequests.RemoveEntry(aRequest); mRequests.Remove(aRequest); uint32_t delay = GetFirstFrameDelay(aRequest); if (delay != 0) { ImageStartData* start = mStartTable.Get(delay); if (start) { start->mEntries.RemoveEntry(aRequest); start->mEntries.Remove(aRequest); } } } Loading Loading @@ -2261,9 +2261,8 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) { // images to refresh, and then we refresh each image in that array. nsCOMArray<imgIContainer> imagesToRefresh(mRequests.Count()); for (auto iter = mRequests.ConstIter(); !iter.Done(); iter.Next()) { const nsISupportsHashKey* entry = iter.Get(); auto req = static_cast<imgIRequest*>(entry->GetKey()); for (nsISupports* entry : mRequests) { auto* req = static_cast<imgIRequest*>(entry); MOZ_ASSERT(req, "Unable to retrieve the image request"); nsCOMPtr<imgIContainer> image; if (NS_SUCCEEDED(req->GetImage(getter_AddRefs(image)))) { Loading Loading @@ -2411,11 +2410,11 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) { void nsRefreshDriver::BeginRefreshingImages(RequestTable& aEntries, mozilla::TimeStamp aDesired) { for (auto iter = aEntries.ConstIter(); !iter.Done(); iter.Next()) { auto req = static_cast<imgIRequest*>(iter.Get()->GetKey()); for (const auto& key : aEntries) { auto* req = static_cast<imgIRequest*>(key); MOZ_ASSERT(req, "Unable to retrieve the image request"); mRequests.PutEntry(req); mRequests.Insert(req); nsCOMPtr<imgIContainer> image; if (NS_SUCCEEDED(req->GetImage(getter_AddRefs(image)))) { Loading Loading
layout/base/PresShell.cpp +20 −33 Original line number Diff line number Diff line Loading @@ -738,8 +738,8 @@ void PresShell::AddWeakFrame(WeakFrame* aWeakFrame) { if (aWeakFrame->GetFrame()) { aWeakFrame->GetFrame()->AddStateBits(NS_FRAME_EXTERNAL_REFERENCE); } MOZ_ASSERT(!mWeakFrames.GetEntry(aWeakFrame)); mWeakFrames.PutEntry(aWeakFrame); MOZ_ASSERT(!mWeakFrames.Contains(aWeakFrame)); mWeakFrames.Insert(aWeakFrame); } void PresShell::RemoveAutoWeakFrame(AutoWeakFrame* aWeakFrame) { Loading @@ -757,8 +757,8 @@ void PresShell::RemoveAutoWeakFrame(AutoWeakFrame* aWeakFrame) { } void PresShell::RemoveWeakFrame(WeakFrame* aWeakFrame) { MOZ_ASSERT(mWeakFrames.GetEntry(aWeakFrame)); mWeakFrames.RemoveEntry(aWeakFrame); MOZ_ASSERT(mWeakFrames.Contains(aWeakFrame)); mWeakFrames.Remove(aWeakFrame); } already_AddRefed<nsFrameSelection> PresShell::FrameSelection() { Loading Loading @@ -1458,11 +1458,8 @@ void PresShell::Destroy() { while (mAutoWeakFrames) { mAutoWeakFrames->Clear(this); } nsTArray<WeakFrame*> toRemove(mWeakFrames.Count()); for (auto iter = mWeakFrames.ConstIter(); !iter.Done(); iter.Next()) { toRemove.AppendElement(iter.Get()->GetKey()); } for (WeakFrame* weakFrame : toRemove) { const nsTArray<WeakFrame*> weakFrames = ToArray(mWeakFrames); for (WeakFrame* weakFrame : weakFrames) { weakFrame->Clear(this); } Loading Loading @@ -2242,12 +2239,12 @@ void PresShell::NotifyDestroyingFrame(nsIFrame* aFrame) { } } mFramesToDirty.RemoveEntry(aFrame); mFramesToDirty.Remove(aFrame); nsIScrollableFrame* scrollableFrame = do_QueryFrame(aFrame); if (scrollableFrame) { mPendingScrollAnchorSelection.RemoveEntry(scrollableFrame); mPendingScrollAnchorAdjustment.RemoveEntry(scrollableFrame); mPendingScrollAnchorSelection.Remove(scrollableFrame); mPendingScrollAnchorAdjustment.Remove(scrollableFrame); } } } Loading Loading @@ -2669,13 +2666,11 @@ void PresShell::VerifyHasDirtyRootAncestor(nsIFrame* aFrame) { void PresShell::PostPendingScrollAnchorSelection( mozilla::layout::ScrollAnchorContainer* aContainer) { mPendingScrollAnchorSelection.PutEntry(aContainer->ScrollableFrame()); mPendingScrollAnchorSelection.Insert(aContainer->ScrollableFrame()); } void PresShell::FlushPendingScrollAnchorSelections() { for (auto iter = mPendingScrollAnchorSelection.ConstIter(); !iter.Done(); iter.Next()) { nsIScrollableFrame* scroll = iter.Get()->GetKey(); for (nsIScrollableFrame* scroll : mPendingScrollAnchorSelection) { scroll->Anchor()->SelectAnchor(); } mPendingScrollAnchorSelection.Clear(); Loading @@ -2683,13 +2678,11 @@ void PresShell::FlushPendingScrollAnchorSelections() { void PresShell::PostPendingScrollAnchorAdjustment( ScrollAnchorContainer* aContainer) { mPendingScrollAnchorAdjustment.PutEntry(aContainer->ScrollableFrame()); mPendingScrollAnchorAdjustment.Insert(aContainer->ScrollableFrame()); } void PresShell::FlushPendingScrollAnchorAdjustments() { for (auto iter = mPendingScrollAnchorAdjustment.ConstIter(); !iter.Done(); iter.Next()) { nsIScrollableFrame* scroll = iter.Get()->GetKey(); for (nsIScrollableFrame* scroll : mPendingScrollAnchorAdjustment) { scroll->Anchor()->ApplyAdjustments(); } mPendingScrollAnchorAdjustment.Clear(); Loading Loading @@ -2879,7 +2872,7 @@ void PresShell::FrameNeedsToContinueReflow(nsIFrame* aFrame) { NS_ASSERTION(aFrame->HasAnyStateBits(NS_FRAME_IN_REFLOW), "Frame passed in not in reflow?"); mFramesToDirty.PutEntry(aFrame); mFramesToDirty.Insert(aFrame); } already_AddRefed<nsIContent> PresShell::GetContentForScrolling() const { Loading Loading @@ -3076,8 +3069,7 @@ void PresShell::ClearFrameRefs(nsIFrame* aFrame) { } AutoTArray<WeakFrame*, 4> toRemove; for (auto iter = mWeakFrames.ConstIter(); !iter.Done(); iter.Next()) { WeakFrame* weakFrame = iter.Get()->GetKey(); for (WeakFrame* weakFrame : mWeakFrames) { if (weakFrame->GetFrame() == aFrame) { toRemove.AppendElement(weakFrame); } Loading Loading @@ -5831,8 +5823,7 @@ void PresShell::MarkFramesInListApproximatelyVisible( void PresShell::DecApproximateVisibleCount( VisibleFrames& aFrames, const Maybe<OnNonvisible>& aNonvisibleAction /* = Nothing() */) { for (auto iter = aFrames.ConstIter(); !iter.Done(); iter.Next()) { nsIFrame* frame = iter.Get()->GetKey(); for (nsIFrame* frame : aFrames) { // Decrement the frame's visible count if we're still tracking its // visibility. (We may not be, if the frame disabled visibility tracking // after we added it to the visible frames list.) Loading Loading @@ -9658,11 +9649,9 @@ bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible, bool interrupted = mPresContext->HasPendingInterrupt(); if (interrupted) { // Make sure target gets reflowed again. for (auto iter = mFramesToDirty.ConstIter(); !iter.Done(); iter.Next()) { for (const auto& key : mFramesToDirty) { // Mark frames dirty until target frame. const nsPtrHashKey<nsIFrame>* p = iter.Get(); for (nsIFrame* f = p->GetKey(); f && !f->IsSubtreeDirty(); f = f->GetParent()) { for (nsIFrame* f = key; f && !f->IsSubtreeDirty(); f = f->GetParent()) { f->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); if (f->IsFlexItem()) { nsFlexContainerFrame::MarkCachedFlexMeasurementsDirty(f); Loading Loading @@ -10999,10 +10988,8 @@ nsresult PresShell::UpdateImageLockingState() { if (locked) { // Request decodes for visible image frames; we want to start decoding as // quickly as possible when we get foregrounded to minimize flashing. for (auto iter = mApproximatelyVisibleFrames.ConstIter(); !iter.Done(); iter.Next()) { nsImageFrame* imageFrame = do_QueryFrame(iter.Get()->GetKey()); if (imageFrame) { for (const auto& key : mApproximatelyVisibleFrames) { if (nsImageFrame* imageFrame = do_QueryFrame(key)) { imageFrame->MaybeDecodeForPredictedSize(); } } Loading
layout/base/PresShell.h +9 −9 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ #include "nsRefreshObservers.h" #include "nsStringFwd.h" #include "nsStubDocumentObserver.h" #include "nsTHashtable.h" #include "nsTHashSet.h" #include "nsThreadUtils.h" #include "nsWeakReference.h" Loading Loading @@ -157,7 +157,7 @@ class PresShell final : public nsStubDocumentObserver, // A set type for tracking visible frames, for use by the visibility code in // PresShell. The set contains nsIFrame* pointers. typedef nsTHashtable<nsPtrHashKey<nsIFrame>> VisibleFrames; typedef nsTHashSet<nsIFrame*> VisibleFrames; public: explicit PresShell(Document* aDocument); Loading Loading @@ -1705,14 +1705,14 @@ class PresShell final : public nsStubDocumentObserver, void RecordAlloc(void* aPtr) { #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED MOZ_DIAGNOSTIC_ASSERT(!mAllocatedPointers.Contains(aPtr)); mAllocatedPointers.PutEntry(aPtr); mAllocatedPointers.Insert(aPtr); #endif } void RecordFree(void* aPtr) { #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED MOZ_DIAGNOSTIC_ASSERT(mAllocatedPointers.Contains(aPtr)); mAllocatedPointers.RemoveEntry(aPtr); mAllocatedPointers.Remove(aPtr); #endif } Loading Loading @@ -2810,7 +2810,7 @@ class PresShell final : public nsStubDocumentObserver, #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED // We track allocated pointers in a debug-only hashtable to assert against // missing/double frees. nsTHashtable<nsPtrHashKey<void>> mAllocatedPointers; nsTHashSet<void*> mAllocatedPointers; #endif // A list of stack weak frames. This is a pointer to the last item in the Loading @@ -2818,7 +2818,7 @@ class PresShell final : public nsStubDocumentObserver, AutoWeakFrame* mAutoWeakFrames; // A hash table of heap allocated weak frames. nsTHashtable<nsPtrHashKey<WeakFrame>> mWeakFrames; nsTHashSet<WeakFrame*> mWeakFrames; class DirtyRootsList { public: Loading Loading @@ -2912,9 +2912,9 @@ class PresShell final : public nsStubDocumentObserver, nsCOMArray<nsIContent> mCurrentEventContentStack; // Set of frames that we should mark with NS_FRAME_HAS_DIRTY_CHILDREN after // we finish reflowing mCurrentReflowRoot. nsTHashtable<nsPtrHashKey<nsIFrame>> mFramesToDirty; nsTHashtable<nsPtrHashKey<nsIScrollableFrame>> mPendingScrollAnchorSelection; nsTHashtable<nsPtrHashKey<nsIScrollableFrame>> mPendingScrollAnchorAdjustment; nsTHashSet<nsIFrame*> mFramesToDirty; nsTHashSet<nsIScrollableFrame*> mPendingScrollAnchorSelection; nsTHashSet<nsIScrollableFrame*> mPendingScrollAnchorAdjustment; nsCallbackEventRequest* mFirstCallbackEventRequest = nullptr; nsCallbackEventRequest* mLastCallbackEventRequest = nullptr; Loading
layout/base/RestyleManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1310,7 +1310,7 @@ void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) { MaybeClearDestroyedFrames maybeClear(mDestroyedFrames); if (!mDestroyedFrames) { mDestroyedFrames = MakeUnique<nsTHashtable<nsPtrHashKey<const nsIFrame>>>(); mDestroyedFrames = MakeUnique<nsTHashSet<const nsIFrame*>>(); } AUTO_PROFILER_LABEL("RestyleManager::ProcessRestyledFrames", LAYOUT); Loading
layout/base/RestyleManager.h +3 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "nsPresContext.h" #include "nsPresContextInlines.h" // XXX Shouldn't be included by header though #include "nsStringFwd.h" #include "nsTHashSet.h" class nsAttrValue; class nsCSSFrameConstructor; Loading Loading @@ -245,7 +246,7 @@ class RestyleManager { // If ProcessRestyledFrames is tracking frames which have been // destroyed (to avoid re-visiting them), add this one to its set. if (mDestroyedFrames) { mDestroyedFrames->PutEntry(aFrame); mDestroyedFrames->Insert(aFrame); } } Loading Loading @@ -515,8 +516,7 @@ class RestyleManager { // Used to keep track of frames that have been destroyed during // ProcessRestyledFrames, so we don't try to touch them again even if // they're referenced again later in the changelist. mozilla::UniquePtr<nsTHashtable<nsPtrHashKey<const nsIFrame>>> mDestroyedFrames; mozilla::UniquePtr<nsTHashSet<const nsIFrame*>> mDestroyedFrames; protected: // True if we're in the middle of a nsRefreshDriver refresh Loading
layout/base/nsRefreshDriver.cpp +9 −10 Original line number Diff line number Diff line Loading @@ -1315,10 +1315,10 @@ void nsRefreshDriver::RemovePostRefreshObserver( bool nsRefreshDriver::AddImageRequest(imgIRequest* aRequest) { uint32_t delay = GetFirstFrameDelay(aRequest); if (delay == 0) { mRequests.PutEntry(aRequest); mRequests.Insert(aRequest); } else { auto* const start = mStartTable.GetOrInsertNew(delay); start->mEntries.PutEntry(aRequest); start->mEntries.Insert(aRequest); } EnsureTimerStarted(); Loading @@ -1329,12 +1329,12 @@ bool nsRefreshDriver::AddImageRequest(imgIRequest* aRequest) { void nsRefreshDriver::RemoveImageRequest(imgIRequest* aRequest) { // Try to remove from both places, just in case, because we can't tell // whether RemoveEntry() succeeds. mRequests.RemoveEntry(aRequest); mRequests.Remove(aRequest); uint32_t delay = GetFirstFrameDelay(aRequest); if (delay != 0) { ImageStartData* start = mStartTable.Get(delay); if (start) { start->mEntries.RemoveEntry(aRequest); start->mEntries.Remove(aRequest); } } } Loading Loading @@ -2261,9 +2261,8 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) { // images to refresh, and then we refresh each image in that array. nsCOMArray<imgIContainer> imagesToRefresh(mRequests.Count()); for (auto iter = mRequests.ConstIter(); !iter.Done(); iter.Next()) { const nsISupportsHashKey* entry = iter.Get(); auto req = static_cast<imgIRequest*>(entry->GetKey()); for (nsISupports* entry : mRequests) { auto* req = static_cast<imgIRequest*>(entry); MOZ_ASSERT(req, "Unable to retrieve the image request"); nsCOMPtr<imgIContainer> image; if (NS_SUCCEEDED(req->GetImage(getter_AddRefs(image)))) { Loading Loading @@ -2411,11 +2410,11 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) { void nsRefreshDriver::BeginRefreshingImages(RequestTable& aEntries, mozilla::TimeStamp aDesired) { for (auto iter = aEntries.ConstIter(); !iter.Done(); iter.Next()) { auto req = static_cast<imgIRequest*>(iter.Get()->GetKey()); for (const auto& key : aEntries) { auto* req = static_cast<imgIRequest*>(key); MOZ_ASSERT(req, "Unable to retrieve the image request"); mRequests.PutEntry(req); mRequests.Insert(req); nsCOMPtr<imgIContainer> image; if (NS_SUCCEEDED(req->GetImage(getter_AddRefs(image)))) { Loading