From 55dc8a6004ca95f34d7a13ad3f3ffb2076946f7c Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Sat, 13 Apr 2019 12:40:48 +0000 Subject: [PATCH] Bug 1543315 - part 6: Mark ProcessReflowCommands() as MOZ_CAN_RUN_SCRIPT r=smaug Differential Revision: https://phabricator.services.mozilla.com/D27222 --HG-- extra : moz-landing-system : lando --- layout/base/PresShell.cpp | 2 +- layout/base/PresShell.h | 5 +++++ layout/base/nsIPresShell.h | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index ed369d3e742b..216367083ad4 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -9276,7 +9276,7 @@ void nsIPresShell::DoVerifyReflow() { // used with Telemetry metrics #define NS_LONG_REFLOW_TIME_MS 5000 -bool nsIPresShell::ProcessReflowCommands(bool aInterruptible) { +bool PresShell::ProcessReflowCommands(bool aInterruptible) { if (mDirtyRoots.IsEmpty() && !mShouldUnsuppressPainting) { // Nothing to do; bail out return true; diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index 833e8e5b249b..326010ff0362 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -105,6 +105,7 @@ class PresShell final : public nsIPresShell, ResizeReflowOptions aOptions = ResizeReflowOptions::eBSizeExact) override; void DoFlushPendingNotifications(FlushType aType) override; + MOZ_CAN_RUN_SCRIPT_BOUNDARY void DoFlushPendingNotifications(ChangesToFlush aType) override; nsRectVisibility GetRectVisibility(nsIFrame* aFrame, const nsRect& aRect, @@ -358,6 +359,10 @@ class PresShell final : public nsIPresShell, friend class ::AutoPointerEventTargetUpdater; + // ProcessReflowCommands returns whether we processed all our dirty roots + // without interruptions. + MOZ_CAN_RUN_SCRIPT bool ProcessReflowCommands(bool aInterruptible); + /** * Initialize cached font inflation preference values and do an initial * computation to determine if font inflation is enabled. diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index c43097904101..5379303d6cbc 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -576,6 +576,7 @@ class nsIPresShell : public nsStubDocumentObserver { * Implementation methods for FlushPendingNotifications. */ virtual void DoFlushPendingNotifications(mozilla::FlushType aType) = 0; + MOZ_CAN_RUN_SCRIPT_BOUNDARY virtual void DoFlushPendingNotifications(mozilla::ChangesToFlush aType) = 0; public: @@ -1814,9 +1815,6 @@ class nsIPresShell : public nsStubDocumentObserver { * @param aInterruptible Whether or not reflow interruption is allowed. */ void DidDoReflow(bool aInterruptible); - // ProcessReflowCommands returns whether we processed all our dirty roots - // without interruptions. - bool ProcessReflowCommands(bool aInterruptible); // The callback for the mReflowContinueTimer timer. static void sReflowContinueCallback(nsITimer* aTimer, void* aPresShell); bool ScheduleReflowOffTimer();