Bug 1543315 - part 14: Mark PresShell::WillPaintWindow() and PresShell::DidPaintWindow() as MOZ_CAN_RUN_SCRIPT r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D30009

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Masayuki Nakano 2019-05-06 13:01:48 +00:00
parent 8d503c6d14
commit 4fd67bb3f1
5 changed files with 9 additions and 8 deletions

View File

@ -1034,13 +1034,13 @@ class PresShell final : public nsStubDocumentObserver,
* Fires on the presshell for the painted widget.
* This is issued at a time when it's safe to modify widget geometry.
*/
void WillPaintWindow();
MOZ_CAN_RUN_SCRIPT void WillPaintWindow();
/**
* Notify that we called Paint with PaintFlags::PaintComposite.
* Fires on the presshell for the painted widget.
* This is issued at a time when it's safe to modify widget geometry.
*/
void DidPaintWindow();
MOZ_CAN_RUN_SCRIPT void DidPaintWindow();
bool IsVisible();
MOZ_CAN_RUN_SCRIPT

View File

@ -394,6 +394,7 @@ class nsView final : public nsIWidgetListener {
MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual bool PaintWindow(nsIWidget* aWidget,
LayoutDeviceIntRegion aRegion) override;
MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual void DidPaintWindow() override;
virtual void DidCompositeWindow(
mozilla::layers::TransactionId aTransactionId,

View File

@ -658,16 +658,15 @@ void nsViewManager::InvalidateViews(nsView* aView) {
}
void nsViewManager::WillPaintWindow(nsIWidget* aWidget) {
RefPtr<nsIWidget> widget(aWidget);
if (widget) {
nsView* view = nsView::GetViewFor(widget);
LayerManager* manager = widget->GetLayerManager();
if (aWidget) {
nsView* view = nsView::GetViewFor(aWidget);
LayerManager* manager = aWidget->GetLayerManager();
if (view &&
(view->ForcedRepaint() || !manager->NeedsWidgetInvalidation())) {
ProcessPendingUpdates();
// Re-get the view pointer here since the ProcessPendingUpdates might have
// destroyed it during CallWillPaintOnObservers.
view = nsView::GetViewFor(widget);
view = nsView::GetViewFor(aWidget);
if (view) {
view->SetForcedRepaint(false);
}

View File

@ -386,7 +386,7 @@ class nsViewManager final {
MOZ_CAN_RUN_SCRIPT void WillPaintWindow(nsIWidget* aWidget);
MOZ_CAN_RUN_SCRIPT
bool PaintWindow(nsIWidget* aWidget, const LayoutDeviceIntRegion& aRegion);
void DidPaintWindow();
MOZ_CAN_RUN_SCRIPT void DidPaintWindow();
// Call this when you need to let the viewmanager know that it now has
// pending updates.

View File

@ -156,6 +156,7 @@ class nsIWidgetListener {
* this widget or of other widgets.
* Must be called after every call to PaintWindow.
*/
MOZ_CAN_RUN_SCRIPT_BOUNDARY
virtual void DidPaintWindow();
virtual void DidCompositeWindow(mozilla::layers::TransactionId aTransactionId,