summaryrefslogtreecommitdiffstats
path: root/layout/base/nsRefreshDriver.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-10 22:12:07 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-10 22:12:07 +0200
commit4c1f33b169b74dce2af414db30fcf113c4bf2a56 (patch)
tree557acf70c9ceb55f2ebe0efc743ea585dfa1dbb7 /layout/base/nsRefreshDriver.cpp
parent2e9c525a91b66038dafcc2ef97dd436164ab65f6 (diff)
downloadUXP-4c1f33b169b74dce2af414db30fcf113c4bf2a56.tar
UXP-4c1f33b169b74dce2af414db30fcf113c4bf2a56.tar.gz
UXP-4c1f33b169b74dce2af414db30fcf113c4bf2a56.tar.lz
UXP-4c1f33b169b74dce2af414db30fcf113c4bf2a56.tar.xz
UXP-4c1f33b169b74dce2af414db30fcf113c4bf2a56.zip
Bug 1470260 - Part 1: Ensure that 'this' stays alive for the duration of the TickRefreshDriver call.
Diffstat (limited to 'layout/base/nsRefreshDriver.cpp')
-rw-r--r--layout/base/nsRefreshDriver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp
index bc1a27852..8a62b517e 100644
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -478,6 +478,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
@@ -498,6 +501,7 @@ private:
aVsyncTimestamp);
NS_DispatchToMainThread(vsyncEvent);
} else {
+ RefPtr<RefreshDriverVsyncObserver> kungFuDeathGrip(this);
TickRefreshDriver(aVsyncTimestamp);
}