Loading gfx/2d/Logging.h +1 −0 Original line number Diff line number Diff line Loading @@ -545,6 +545,7 @@ typedef Log<LOG_CRITICAL, CriticalLogger> CriticalLog; // while the critical error is // gfxCriticalError() << "Something to report and assert"; #define gfxCriticalNote gfxCriticalError(gfxCriticalError::DefaultOptions(false)) #define gfxCriticalNoteOnce static gfxCriticalError GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxCriticalNote // The "once" versions will only trigger the first time through. You can do this: // gfxCriticalErrorOnce() << "This message only shows up once; Loading layout/base/nsPresShell.cpp +35 −0 Original line number Diff line number Diff line Loading @@ -5549,6 +5549,9 @@ PresShell::MarkImagesInListVisible(const nsDisplayList& aList) void PresShell::ReportAnyBadState() { if (!NS_IsMainThread()) { gfxCriticalNote << "Got null image in image visibility: off-main-thread"; } if (mIsZombie) { gfxCriticalNote << "Got null image in image visibility: mIsZombie"; } Loading @@ -5575,6 +5578,12 @@ PresShell::ReportAnyBadState() } } void PresShell::SetInImageVisibility(bool aState) { mInImageVisibility = aState; } static void DecrementVisibleCount(nsTHashtable<nsRefPtrHashKey<nsIImageLoadingContent>>& aImages, uint32_t aNonvisibleAction, PresShell* aPresShell) Loading @@ -5585,7 +5594,9 @@ DecrementVisibleCount(nsTHashtable<nsRefPtrHashKey<nsIImageLoadingContent>>& aIm // help debug the crash (bug 1251150) aPresShell->ReportAnyBadState(); } aPresShell->SetInImageVisibility(true); iter.Get()->GetKey()->DecrementVisibleCount(aNonvisibleAction); aPresShell->SetInImageVisibility(false); } } Loading Loading @@ -5623,6 +5634,10 @@ PresShell::ClearImageVisibilityVisited(nsView* aView, bool aClear) void PresShell::ClearVisibleImagesList(uint32_t aNonvisibleAction) { if (mInImageVisibility) { gfxCriticalNoteOnce << "ClearVisibleImagesList is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } DecrementVisibleCount(mVisibleImages, aNonvisibleAction, this); mVisibleImages.Clear(); } Loading Loading @@ -5728,6 +5743,11 @@ PresShell::RebuildImageVisibility(nsRect* aRect, return; } if (mInImageVisibility) { gfxCriticalNoteOnce << "RebuildImageVisibility is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } // Remove the entries of the mVisibleImages hashtable and put them in // oldVisibleImages. nsTHashtable< nsRefPtrHashKey<nsIImageLoadingContent> > oldVisibleImages; Loading Loading @@ -5881,6 +5901,11 @@ PresShell::EnsureImageInVisibleList(nsIImageLoadingContent* aImage) } #endif if (mInImageVisibility) { gfxCriticalNoteOnce << "EnsureImageInVisibleList is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } if (!mVisibleImages.Contains(aImage)) { mVisibleImages.PutEntry(aImage); aImage->IncrementVisibleCount(); Loading @@ -5904,6 +5929,11 @@ PresShell::RemoveImageFromVisibleList(nsIImageLoadingContent* aImage) return; } if (mInImageVisibility) { gfxCriticalNoteOnce << "RemoveImageFromVisibleList is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } uint32_t count = mVisibleImages.Count(); mVisibleImages.RemoveEntry(aImage); if (mVisibleImages.Count() < count) { Loading Loading @@ -10668,6 +10698,11 @@ PresShell::UpdateImageLockingState() nsresult rv = mDocument->SetImageLockingState(locked); if (locked) { if (mInImageVisibility) { gfxCriticalNoteOnce << "UpdateImageLockingState is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } // Request decodes for visible images; we want to start decoding as // quickly as possible when we get foregrounded to minimize flashing. for (auto iter = mVisibleImages.Iter(); !iter.Done(); iter.Next()) { Loading layout/base/nsPresShell.h +4 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,8 @@ public: void ReportAnyBadState(); void SetInImageVisibility(bool aState); protected: virtual ~PresShell(); Loading Loading @@ -889,6 +891,8 @@ protected: // Whether the widget has received a paint message yet. bool mHasReceivedPaintMessage : 1; bool mInImageVisibility : 1; static bool sDisableNonTestMouseEvents; }; Loading Loading
gfx/2d/Logging.h +1 −0 Original line number Diff line number Diff line Loading @@ -545,6 +545,7 @@ typedef Log<LOG_CRITICAL, CriticalLogger> CriticalLog; // while the critical error is // gfxCriticalError() << "Something to report and assert"; #define gfxCriticalNote gfxCriticalError(gfxCriticalError::DefaultOptions(false)) #define gfxCriticalNoteOnce static gfxCriticalError GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxCriticalNote // The "once" versions will only trigger the first time through. You can do this: // gfxCriticalErrorOnce() << "This message only shows up once; Loading
layout/base/nsPresShell.cpp +35 −0 Original line number Diff line number Diff line Loading @@ -5549,6 +5549,9 @@ PresShell::MarkImagesInListVisible(const nsDisplayList& aList) void PresShell::ReportAnyBadState() { if (!NS_IsMainThread()) { gfxCriticalNote << "Got null image in image visibility: off-main-thread"; } if (mIsZombie) { gfxCriticalNote << "Got null image in image visibility: mIsZombie"; } Loading @@ -5575,6 +5578,12 @@ PresShell::ReportAnyBadState() } } void PresShell::SetInImageVisibility(bool aState) { mInImageVisibility = aState; } static void DecrementVisibleCount(nsTHashtable<nsRefPtrHashKey<nsIImageLoadingContent>>& aImages, uint32_t aNonvisibleAction, PresShell* aPresShell) Loading @@ -5585,7 +5594,9 @@ DecrementVisibleCount(nsTHashtable<nsRefPtrHashKey<nsIImageLoadingContent>>& aIm // help debug the crash (bug 1251150) aPresShell->ReportAnyBadState(); } aPresShell->SetInImageVisibility(true); iter.Get()->GetKey()->DecrementVisibleCount(aNonvisibleAction); aPresShell->SetInImageVisibility(false); } } Loading Loading @@ -5623,6 +5634,10 @@ PresShell::ClearImageVisibilityVisited(nsView* aView, bool aClear) void PresShell::ClearVisibleImagesList(uint32_t aNonvisibleAction) { if (mInImageVisibility) { gfxCriticalNoteOnce << "ClearVisibleImagesList is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } DecrementVisibleCount(mVisibleImages, aNonvisibleAction, this); mVisibleImages.Clear(); } Loading Loading @@ -5728,6 +5743,11 @@ PresShell::RebuildImageVisibility(nsRect* aRect, return; } if (mInImageVisibility) { gfxCriticalNoteOnce << "RebuildImageVisibility is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } // Remove the entries of the mVisibleImages hashtable and put them in // oldVisibleImages. nsTHashtable< nsRefPtrHashKey<nsIImageLoadingContent> > oldVisibleImages; Loading Loading @@ -5881,6 +5901,11 @@ PresShell::EnsureImageInVisibleList(nsIImageLoadingContent* aImage) } #endif if (mInImageVisibility) { gfxCriticalNoteOnce << "EnsureImageInVisibleList is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } if (!mVisibleImages.Contains(aImage)) { mVisibleImages.PutEntry(aImage); aImage->IncrementVisibleCount(); Loading @@ -5904,6 +5929,11 @@ PresShell::RemoveImageFromVisibleList(nsIImageLoadingContent* aImage) return; } if (mInImageVisibility) { gfxCriticalNoteOnce << "RemoveImageFromVisibleList is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } uint32_t count = mVisibleImages.Count(); mVisibleImages.RemoveEntry(aImage); if (mVisibleImages.Count() < count) { Loading Loading @@ -10668,6 +10698,11 @@ PresShell::UpdateImageLockingState() nsresult rv = mDocument->SetImageLockingState(locked); if (locked) { if (mInImageVisibility) { gfxCriticalNoteOnce << "UpdateImageLockingState is re-entering on " << (NS_IsMainThread() ? "" : "non-") << "main thread"; } // Request decodes for visible images; we want to start decoding as // quickly as possible when we get foregrounded to minimize flashing. for (auto iter = mVisibleImages.Iter(); !iter.Done(); iter.Next()) { Loading
layout/base/nsPresShell.h +4 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,8 @@ public: void ReportAnyBadState(); void SetInImageVisibility(bool aState); protected: virtual ~PresShell(); Loading Loading @@ -889,6 +891,8 @@ protected: // Whether the widget has received a paint message yet. bool mHasReceivedPaintMessage : 1; bool mInImageVisibility : 1; static bool sDisableNonTestMouseEvents; }; Loading