From ac6abff2ab55e6b1472296959c5c1caa3a5c1964 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 17 Sep 2012 17:06:12 +1200 Subject: [PATCH] Bug 468568. Part 0.6: Assert when ScheduleViewManagerFlush is called on a non-root. r=mattwoodrow --HG-- extra : rebase_source : cf014da5cd7472fa036a5922c4ca9fff9aa93eac --- layout/base/nsRefreshDriver.cpp | 9 +++++++++ layout/base/nsRefreshDriver.h | 5 +---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index ea52ba03b89d..db68a1144830 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -518,6 +518,15 @@ nsRefreshDriver::IsRefreshObserver(nsARefreshObserver *aObserver, } #endif +void +nsRefreshDriver::ScheduleViewManagerFlush() +{ + NS_ASSERTION(mPresContext->IsRoot(), + "Should only schedule view manager flush on root prescontexts"); + mViewManagerFlushIsPending = true; + EnsureTimerStarted(false); +} + void nsRefreshDriver::ScheduleFrameRequestCallbacks(nsIDocument* aDocument) { diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h index cd5a691a76d0..c750659d0c13 100644 --- a/layout/base/nsRefreshDriver.h +++ b/layout/base/nsRefreshDriver.h @@ -148,10 +148,7 @@ public: /** * Remember whether our presshell's view manager needs a flush */ - void ScheduleViewManagerFlush() { - mViewManagerFlushIsPending = true; - EnsureTimerStarted(false); - } + void ScheduleViewManagerFlush(); void RevokeViewManagerFlush() { mViewManagerFlushIsPending = false; }