diff options
Diffstat (limited to 'www/waterfox/files/patch-bug1470260')
-rw-r--r-- | www/waterfox/files/patch-bug1470260 | 164 |
1 files changed, 0 insertions, 164 deletions
diff --git a/www/waterfox/files/patch-bug1470260 b/www/waterfox/files/patch-bug1470260 deleted file mode 100644 index ed3fb35f10fe..000000000000 --- a/www/waterfox/files/patch-bug1470260 +++ /dev/null @@ -1,164 +0,0 @@ -commit bb90f9b13b2d -Author: Mats Palmgren <mats@mozilla.com> -Date: Sat Jun 30 01:08:54 2018 +0200 - - Bug 1470260 part 1 - Ensure that 'this' stays alive for the duration of the TickRefreshDriver call. r=emilio a=lizzard - - --HG-- - extra : source : 89db79608a7565ead4ceca4db9e2417b1373e41d ---- - layout/base/nsRefreshDriver.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git layout/base/nsRefreshDriver.cpp layout/base/nsRefreshDriver.cpp -index 3e468c17ad300..446fcf3f243a8 100644 ---- layout/base/nsRefreshDriver.cpp -+++ layout/base/nsRefreshDriver.cpp -@@ -537,6 +537,9 @@ private: - - bool NotifyVsync(TimeStamp aVsyncTimestamp) override - { -+ // IMPORTANT: All paths through this method MUST hold a strong ref on -+ // |this| for the duration of the TickRefreshDriver callback. -+ - if (!NS_IsMainThread()) { - MOZ_ASSERT(XRE_IsParentProcess()); - // Compress vsync notifications such that only 1 may run at a time -@@ -571,6 +574,7 @@ private: - return true; - } - -+ RefPtr<RefreshDriverVsyncObserver> kungFuDeathGrip(this); - TickRefreshDriver(aVsyncTimestamp); - } - - -commit 06c64e041c90 -Author: Mats Palmgren <mats@mozilla.com> -Date: Mon Jul 2 19:19:29 2018 +0300 - - Bug 1470260 part 2 - Make RefreshDriverTimer ref-counted and hold a strong ref on it on the stack when nsRefreshDriver::Tick can be reached. r=emilio a=lizzard - - --HG-- - extra : rebase_source : 817d92ed5dc53ff45d6d2818ccf8b08538cf397b ---- - layout/base/nsRefreshDriver.cpp | 42 ++++++++++++++++++++--------------------- - 1 file changed, 21 insertions(+), 21 deletions(-) - -diff --git layout/base/nsRefreshDriver.cpp layout/base/nsRefreshDriver.cpp -index 446fcf3f243a8..fd7b268d90d07 100644 ---- layout/base/nsRefreshDriver.cpp -+++ layout/base/nsRefreshDriver.cpp -@@ -148,11 +148,7 @@ public: - { - } - -- virtual ~RefreshDriverTimer() -- { -- MOZ_ASSERT(mContentRefreshDrivers.Length() == 0, "Should have removed all content refresh drivers from here by now!"); -- MOZ_ASSERT(mRootRefreshDrivers.Length() == 0, "Should have removed all root refresh drivers from here by now!"); -- } -+ NS_INLINE_DECL_REFCOUNTING(RefreshDriverTimer) - - virtual void AddRefreshDriver(nsRefreshDriver* aDriver) - { -@@ -259,6 +255,12 @@ public: - } - - protected: -+ virtual ~RefreshDriverTimer() -+ { -+ MOZ_ASSERT(mContentRefreshDrivers.Length() == 0, "Should have removed all content refresh drivers from here by now!"); -+ MOZ_ASSERT(mRootRefreshDrivers.Length() == 0, "Should have removed all root refresh drivers from here by now!"); -+ } -+ - virtual void StartTimer() = 0; - virtual void StopTimer() = 0; - virtual void ScheduleNextTick(TimeStamp aNowTime) = 0; -@@ -336,10 +338,11 @@ protected: - nsTArray<RefPtr<nsRefreshDriver>> mRootRefreshDrivers; - - // useful callback for nsITimer-based derived classes, here -- // bacause of c++ protected shenanigans -+ // because of c++ protected shenanigans - static void TimerTick(nsITimer* aTimer, void* aClosure) - { -- RefreshDriverTimer *timer = static_cast<RefreshDriverTimer*>(aClosure); -+ RefPtr<RefreshDriverTimer> timer = -+ static_cast<RefreshDriverTimer*>(aClosure); - timer->Tick(); - } - }; -@@ -471,9 +474,7 @@ public: - private: - // Since VsyncObservers are refCounted, but the RefreshDriverTimer are - // explicitly shutdown. We create an inner class that has the VsyncObserver -- // and is shutdown when the RefreshDriverTimer is deleted. The alternative is -- // to (a) make all RefreshDriverTimer RefCounted or (b) use different -- // VsyncObserver types. -+ // and is shutdown when the RefreshDriverTimer is deleted. - class RefreshDriverVsyncObserver final : public VsyncObserver - { - public: -@@ -674,7 +675,9 @@ private: - // the scheduled TickRefreshDriver() runs. Check mVsyncRefreshDriverTimer - // before use. - if (mVsyncRefreshDriverTimer) { -- mVsyncRefreshDriverTimer->RunRefreshDrivers(aVsyncTimestamp); -+ RefPtr<VsyncRefreshDriverTimer> timer = mVsyncRefreshDriverTimer; -+ timer->RunRefreshDrivers(aVsyncTimestamp); -+ // Note: mVsyncRefreshDriverTimer might be null now. - } - - if (!XRE_IsParentProcess()) { -@@ -956,7 +959,8 @@ protected: - - static void TimerTickOne(nsITimer* aTimer, void* aClosure) - { -- InactiveRefreshDriverTimer *timer = static_cast<InactiveRefreshDriverTimer*>(aClosure); -+ RefPtr<InactiveRefreshDriverTimer> timer = -+ static_cast<InactiveRefreshDriverTimer*>(aClosure); - timer->TickOne(); - } - -@@ -967,8 +971,8 @@ protected: - - } // namespace mozilla - --static RefreshDriverTimer* sRegularRateTimer; --static InactiveRefreshDriverTimer* sThrottledRateTimer; -+static StaticRefPtr<RefreshDriverTimer> sRegularRateTimer; -+static StaticRefPtr<InactiveRefreshDriverTimer> sThrottledRateTimer; - - static void - CreateContentVsyncRefreshTimer(void*) -@@ -1042,9 +1046,6 @@ GetFirstFrameDelay(imgIRequest* req) - nsRefreshDriver::Shutdown() - { - // clean up our timers -- delete sRegularRateTimer; -- delete sThrottledRateTimer; -- - sRegularRateTimer = nullptr; - sThrottledRateTimer = nullptr; - } -@@ -2292,16 +2293,15 @@ nsRefreshDriver::PVsyncActorCreated(VsyncChild* aVsyncChild) - { - MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(!XRE_IsParentProcess()); -- auto* vsyncRefreshDriverTimer = -- new VsyncRefreshDriverTimer(aVsyncChild); -+ RefPtr<RefreshDriverTimer> vsyncRefreshDriverTimer = -+ new VsyncRefreshDriverTimer(aVsyncChild); - - // If we are using software timer, swap current timer to - // VsyncRefreshDriverTimer. - if (sRegularRateTimer) { - sRegularRateTimer->SwapRefreshDrivers(vsyncRefreshDriverTimer); -- delete sRegularRateTimer; - } -- sRegularRateTimer = vsyncRefreshDriverTimer; -+ sRegularRateTimer = vsyncRefreshDriverTimer.forget(); - } - - void |