⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271171 in webkit


Ignore:
Timestamp:
Jan 5, 2021, 12:37:38 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Make WebPage::ForceRepaint use CompletionHandler instead of VoidCallback
https://bugs.webkit.org/show_bug.cgi?id=212269

Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-05
Reviewed by Chris Dumez.

Fix a few unsafe pointer uses along the way.
No change in behavior.

  • UIProcess/API/C/WKPage.cpp:

(WKPageForceRepaint):

  • UIProcess/ViewGestureController.cpp:

(WebKit::ViewGestureController::forceRepaintIfNeeded):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::forceRepaint):

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:

(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController _completedExitFullScreen]):

  • UIProcess/mac/WKFullScreenWindowController.h:
  • UIProcess/mac/WKFullScreenWindowController.mm:

(-[WKFullScreenWindowController dealloc]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):

  • WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:

(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):

  • WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
  • WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:

(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::renderNextFrame):

  • WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:

(WebKit::LayerTreeHost::forceRepaintAsync):

  • WebProcess/WebPage/DrawingArea.h:

(WebKit::DrawingArea::forceRepaintAsync):

  • WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::forceRepaint):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:
  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync):

Location:
trunk/Source/WebKit
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r271169 r271171  
     12021-01-05  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make WebPage::ForceRepaint use CompletionHandler instead of VoidCallback
     4        https://bugs.webkit.org/show_bug.cgi?id=212269
     5
     6        Reviewed by Chris Dumez.
     7
     8        Fix a few unsafe pointer uses along the way.
     9        No change in behavior.
     10
     11        * UIProcess/API/C/WKPage.cpp:
     12        (WKPageForceRepaint):
     13        * UIProcess/ViewGestureController.cpp:
     14        (WebKit::ViewGestureController::forceRepaintIfNeeded):
     15        * UIProcess/WebPageProxy.cpp:
     16        (WebKit::WebPageProxy::forceRepaint):
     17        * UIProcess/WebPageProxy.h:
     18        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
     19        (-[WKFullScreenWindowController enterFullScreen]):
     20        (-[WKFullScreenWindowController _completedExitFullScreen]):
     21        * UIProcess/mac/WKFullScreenWindowController.h:
     22        * UIProcess/mac/WKFullScreenWindowController.mm:
     23        (-[WKFullScreenWindowController dealloc]):
     24        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
     25        (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
     26        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
     27        (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
     28        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
     29        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
     30        (WebKit::LayerTreeHost::layerFlushTimerFired):
     31        (WebKit::LayerTreeHost::forceRepaintAsync):
     32        (WebKit::LayerTreeHost::renderNextFrame):
     33        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
     34        (WebKit::LayerTreeHost::forceRepaintAsync):
     35        * WebProcess/WebPage/DrawingArea.h:
     36        (WebKit::DrawingArea::forceRepaintAsync):
     37        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
     38        * WebProcess/WebPage/WebPage.cpp:
     39        (WebKit::WebPage::forceRepaint):
     40        * WebProcess/WebPage/WebPage.h:
     41        * WebProcess/WebPage/WebPage.messages.in:
     42        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
     43        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     44        (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync):
     45
    1462021-01-05  Sihui Liu  <sihui_liu@appe.com>
    247
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r271162 r271171  
    25742574void WKPageForceRepaint(WKPageRef pageRef, void* context, WKPageForceRepaintFunction callback)
    25752575{
    2576     toImpl(pageRef)->forceRepaint(VoidCallback::create([context, callback](WebKit::CallbackBase::Error error) {
    2577         callback(error == WebKit::CallbackBase::Error::None ? nullptr : toAPI(API::Error::create().ptr()), context);
    2578     }));
     2576    toImpl(pageRef)->forceRepaint([context, callback]() {
     2577        callback(nullptr, context);
     2578    });
    25792579}
    25802580
  • trunk/Source/WebKit/UIProcess/ViewGestureController.cpp

    r263825 r271171  
    561561    auto pageID = m_webPageProxy.identifier();
    562562    GestureID gestureID = m_currentGestureID;
    563     m_webPageProxy.forceRepaint(VoidCallback::create([pageID, gestureID] (CallbackBase::Error error) {
     563    m_webPageProxy.forceRepaint([pageID, gestureID] () {
    564564        if (auto gestureController = controllerForGesture(pageID, gestureID))
    565565            gestureController->removeSwipeSnapshot();
    566     }));
     566    });
    567567}
    568568
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r271169 r271171  
    41934193}
    41944194
    4195 void WebPageProxy::forceRepaint(RefPtr<VoidCallback>&& callback)
    4196 {
    4197     if (!hasRunningProcess()) {
    4198         // FIXME: If the page is invalid we should not call the callback. It'd be better to just return false from forceRepaint.
    4199         callback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
    4200         return;
    4201     }
    4202 
    4203     Function<void(CallbackBase::Error)> didForceRepaintCallback = [this, callback = WTFMove(callback)](CallbackBase::Error error) mutable {
    4204         if (error != CallbackBase::Error::None) {
    4205             callback->invalidate(error);
    4206             return;
    4207         }
    4208 
    4209         if (!hasRunningProcess()) {
    4210             callback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
    4211             return;
    4212         }
    4213    
    4214         callAfterNextPresentationUpdate([callback = WTFMove(callback)](CallbackBase::Error error) {
    4215             if (error != CallbackBase::Error::None) {
    4216                 callback->invalidate(error);
    4217                 return;
    4218             }
    4219 
    4220             callback->performCallback();
     4195void WebPageProxy::forceRepaint(CompletionHandler<void()>&& callback)
     4196{
     4197    if (!hasRunningProcess())
     4198        return callback();
     4199
     4200    m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
     4201
     4202    sendWithAsyncReply(Messages::WebPage::ForceRepaint(), [this, protectedThis = makeRef(*this), callback = WTFMove(callback)] () mutable {
     4203        callAfterNextPresentationUpdate([callback = WTFMove(callback)] (auto) mutable {
     4204            callback();
    42214205        });
    4222     };
    4223 
    4224     auto callbackID = m_callbacks.put(WTFMove(didForceRepaintCallback), m_process->throttler().backgroundActivity("WebPageProxy::forceRepaint"_s));
    4225     m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
    4226     send(Messages::WebPage::ForceRepaint(callbackID));
     4206    });
    42274207}
    42284208
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r271162 r271171  
    11491149    void runJavaScriptInMainFrame(WebCore::RunJavaScriptParameters&&, CompletionHandler<void(Expected<RefPtr<API::SerializedScriptValue>, WebCore::ExceptionDetails>&&)>&&);
    11501150    void runJavaScriptInFrameInScriptWorld(WebCore::RunJavaScriptParameters&&, Optional<WebCore::FrameIdentifier>, API::ContentWorld&, CompletionHandler<void(Expected<RefPtr<API::SerializedScriptValue>, WebCore::ExceptionDetails>&&)>&&);
    1151     void forceRepaint(RefPtr<VoidCallback>&&);
     1151    void forceRepaint(CompletionHandler<void()>&&);
    11521152
    11531153    float headerHeight(WebFrameProxy&);
  • trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm

    r269557 r271171  
    461461    RetainPtr<UIViewController> _rootViewController;
    462462
    463     RefPtr<WebKit::VoidCallback> _repaintCallback;
    464463    RetainPtr<UIViewController> _viewControllerForPresentation;
    465464    RetainPtr<WKFullScreenViewController> _fullscreenViewController;
     
    625624        page->setOverrideViewportArguments(arguments);
    626625
    627         _repaintCallback = WebKit::VoidCallback::create([protectedSelf = retainPtr(self), self](WebKit::CallbackBase::Error) {
    628             _repaintCallback = nullptr;
    629 
     626        page->forceRepaint([protectedSelf = retainPtr(self), self] {
    630627            if (_exitRequested) {
    631628                _exitRequested = NO;
     
    642639            [self _exitFullscreenImmediately];
    643640        });
    644         page->forceRepaint(_repaintCallback.copyRef());
    645641
    646642        [CATransaction commit];
     
    834830    _window = nil;
    835831
    836     if (_repaintCallback) {
    837         _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated);
    838         ASSERT(!_repaintCallback);
    839     }
    840 
    841     _repaintCallback = WebKit::VoidCallback::create([protectedSelf = retainPtr(self), self](WebKit::CallbackBase::Error) {
    842         _repaintCallback = nullptr;
     832    CompletionHandler<void()> completionHandler([protectedSelf = retainPtr(self), self] {
    843833        _webViewPlaceholder.get().parent = nil;
    844834        [_webViewPlaceholder removeFromSuperview];
     
    859849    auto* page = [self._webView _page].get();
    860850    if (page && page->isViewFocused())
    861         page->forceRepaint(_repaintCallback.copyRef());
     851        page->forceRepaint(WTFMove(completionHandler));
    862852    else
    863         _repaintCallback->performCallback();
     853        completionHandler();
    864854
    865855    [_fullscreenViewController setPrefersStatusBarHidden:YES];
  • trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h

    r267053 r271171  
    6363
    6464    double _savedScale;
    65     RefPtr<WebKit::VoidCallback> _repaintCallback;
    6665    float _savedTopContentInset;
    6766}
  • trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm

    r270069 r271171  
    156156    [[NSNotificationCenter defaultCenter] removeObserver:self];
    157157
    158     if (_repaintCallback) {
    159         _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated);
    160         // invalidate() calls completeFinishExitFullScreenAnimationAfterRepaint, which
    161         // clears _repaintCallback.
    162         ASSERT(!_repaintCallback);
    163     }
    164 
    165158    _videoFullscreenManagerProxyClient.setParent(nullptr);
    166159
     
    575568    _page->setTopContentInset(_savedTopContentInset);
    576569
    577     if (_repaintCallback) {
    578         _repaintCallback->invalidate(WebKit::CallbackBase::Error::OwnerWasInvalidated);
    579         // invalidate() calls completeFinishExitFullScreenAnimationAfterRepaint, which
    580         // clears _repaintCallback.
    581         ASSERT(!_repaintCallback);
    582     }
    583     _repaintCallback = WebKit::VoidCallback::create([self](WebKit::CallbackBase::Error) {
    584         [self completeFinishExitFullScreenAnimationAfterRepaint];
     570    _page->forceRepaint([weakSelf = WeakObjCPtr<WKFullScreenWindowController>(self)] {
     571        [weakSelf completeFinishExitFullScreenAnimationAfterRepaint];
    585572    });
    586     _page->forceRepaint(_repaintCallback.copyRef());
    587573
    588574    [CATransaction commit];
     
    606592    _webViewPlaceholder = nil;
    607593   
    608     _repaintCallback = nullptr;
    609594    _page->setSuppressVisibilityUpdates(false);
    610595    _page->setNeedsDOMWindowResizeEvent();
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp

    r268014 r271171  
    214214}
    215215
    216 bool DrawingAreaCoordinatedGraphics::forceRepaintAsync(CallbackID callbackID)
    217 {
    218     if (m_layerTreeStateIsFrozen)
    219         return false;
    220 
    221     return m_layerTreeHost && m_layerTreeHost->forceRepaintAsync(callbackID);
     216void DrawingAreaCoordinatedGraphics::forceRepaintAsync(WebPage& page, CompletionHandler<void()>&& completionHandler)
     217{
     218    if (m_layerTreeStateIsFrozen) {
     219        page.forceRepaintWithoutCallback();
     220        return completionHandler();
     221    }
     222
     223    if (m_layerTreeHost)
     224        m_layerTreeHost->forceRepaintAsync(WTFMove(completionHandler));
     225    else
     226        completionHandler();
    222227}
    223228
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h

    r268014 r271171  
    5252    void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
    5353    void forceRepaint() override;
    54     bool forceRepaintAsync(CallbackID) override;
     54    void forceRepaintAsync(WebPage&, CompletionHandler<void()>&&) override;
    5555
    5656    void setLayerTreeStateIsFrozen(bool) override;
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp

    r261616 r271171  
    142142    // If a force-repaint callback was registered, we should force a 'frame sync' that
    143143    // will guarantee us a call to renderNextFrame() once the update is complete.
    144     if (m_forceRepaintAsync.callbackID)
     144    if (m_forceRepaintAsync.callback)
    145145        m_coordinator.forceFrameSync();
    146146
     
    191191}
    192192
    193 bool LayerTreeHost::forceRepaintAsync(CallbackID callbackID)
     193void LayerTreeHost::forceRepaintAsync(CompletionHandler<void()>&& callback)
    194194{
    195195    scheduleLayerFlush();
     
    197197    // We want a clean repaint, meaning that if we're currently waiting for the renderer
    198198    // to finish an update, we'll have to schedule another flush when it's done.
    199     ASSERT(!m_forceRepaintAsync.callbackID);
    200     m_forceRepaintAsync.callbackID = OptionalCallbackID(callbackID);
     199    ASSERT(!m_forceRepaintAsync.callback);
     200    m_forceRepaintAsync.callback = WTFMove(callback);
    201201    m_forceRepaintAsync.needsFreshFlush = m_scheduledWhileWaitingForRenderer;
    202     return true;
    203202}
    204203
     
    406405    m_coordinator.renderNextFrame();
    407406
    408     if (m_forceRepaintAsync.callbackID) {
     407    if (m_forceRepaintAsync.callback) {
    409408        // If the asynchronous force-repaint needs a separate fresh flush, it was due to
    410409        // the force-repaint request being registered while CoordinatedLayerTreeHost was
     
    415414        // aren't needed. If they are, the callback will be executed when this function
    416415        // is called after the next update.
    417         if (!m_forceRepaintAsync.needsFreshFlush) {
    418             m_webPage.send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsync.callbackID.callbackID()));
    419             m_forceRepaintAsync.callbackID = OptionalCallbackID();
    420         }
     416        if (!m_forceRepaintAsync.needsFreshFlush)
     417            m_forceRepaintAsync.callback();
    421418        m_forceRepaintAsync.needsFreshFlush = false;
    422419    }
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h

    r262158 r271171  
    8080    void scrollNonCompositedContents(const WebCore::IntRect&);
    8181    void forceRepaint();
    82     bool forceRepaintAsync(CallbackID);
     82    void forceRepaintAsync(CompletionHandler<void()>&&);
    8383    void sizeDidChange(const WebCore::IntSize& newSize);
    8484
     
    194194    SimpleViewportController m_viewportController;
    195195    struct {
    196         OptionalCallbackID callbackID;
     196        CompletionHandler<void()> callback;
    197197        bool needsFreshFlush { false };
    198198    } m_forceRepaintAsync;
     
    214214inline void LayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect&) { }
    215215inline void LayerTreeHost::forceRepaint() { }
    216 inline bool LayerTreeHost::forceRepaintAsync(CallbackID) { return false; }
     216inline bool LayerTreeHost::forceRepaintAsync(CompletionHandler<void()>&) { return false; }
    217217inline void LayerTreeHost::sizeDidChange(const WebCore::IntSize&) { }
    218218inline void LayerTreeHost::pauseRendering() { }
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp

    r270699 r271171  
    209209}
    210210
    211 bool LayerTreeHost::forceRepaintAsync(CallbackID)
    212 {
    213     return false;
     211void LayerTreeHost::forceRepaintAsync(CompletionHandler<void()>&& completionHandler)
     212{
     213    completionHandler();
    214214}
    215215
  • trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.h

    r262172 r271171  
    6868    void scrollNonCompositedContents(const WebCore::IntRect&);
    6969    void forceRepaint();
    70     bool forceRepaintAsync(CallbackID);
     70    void forceRepaintAsync(CompletionHandler<void()>&&);
    7171    void sizeDidChange(const WebCore::IntSize& newSize);
    7272    void pauseRendering();
  • trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h

    r270387 r271171  
    8686    // FIXME: These should be pure virtual.
    8787    virtual void forceRepaint() { }
    88     virtual bool forceRepaintAsync(CallbackID) { return false; }
     88    virtual void forceRepaintAsync(WebPage&, CompletionHandler<void()>&&) = 0;
    8989    virtual void setLayerTreeStateIsFrozen(bool) { }
    9090    virtual bool layerTreeStateIsFrozen() const { return false; }
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h

    r269824 r271171  
    8888
    8989    void forceRepaint() override;
    90     bool forceRepaintAsync(CallbackID) override { return false; }
     90    void forceRepaintAsync(WebPage&, CompletionHandler<void()>&&) override;
    9191
    9292    void setViewExposedRect(Optional<WebCore::FloatRect>) override;
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm

    r269824 r271171  
    185185}
    186186
     187void RemoteLayerTreeDrawingArea::forceRepaintAsync(WebPage& page, CompletionHandler<void()>&& completionHandler)
     188{
     189    page.forceRepaintWithoutCallback();
     190    completionHandler();
     191}
     192
    187193#if PLATFORM(IOS_FAMILY)
    188194void RemoteLayerTreeDrawingArea::setDeviceScaleFactor(float deviceScaleFactor)
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r271162 r271171  
    37193719}
    37203720
    3721 void WebPage::forceRepaint(CallbackID callbackID)
    3722 {
    3723     if (m_drawingArea->forceRepaintAsync(callbackID))
    3724         return;
    3725 
    3726     forceRepaintWithoutCallback();
    3727     send(Messages::WebPageProxy::VoidCallback(callbackID));
     3721void WebPage::forceRepaint(CompletionHandler<void()>&& completionHandler)
     3722{
     3723    m_drawingArea->forceRepaintAsync(*this, WTFMove(completionHandler));
    37283724}
    37293725
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r271162 r271171  
    15681568    void runJavaScript(WebFrame*, WebCore::RunJavaScriptParameters&&, ContentWorldIdentifier, CompletionHandler<void(const IPC::DataReference&, const Optional<WebCore::ExceptionDetails>&)>&&);
    15691569    void runJavaScriptInFrameInScriptWorld(WebCore::RunJavaScriptParameters&&, Optional<WebCore::FrameIdentifier>, const std::pair<ContentWorldIdentifier, String>& worldData, CompletionHandler<void(const IPC::DataReference&, const Optional<WebCore::ExceptionDetails>&)>&&);
    1570     void forceRepaint(CallbackID);
     1570    void forceRepaint(CompletionHandler<void()>&&);
    15711571    void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, CallbackID);
    15721572
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in

    r271162 r271171  
    223223    RunJavaScriptInFrameInScriptWorld(struct WebCore::RunJavaScriptParameters parameters, Optional<WebCore::FrameIdentifier> frameID, std::pair<WebKit::ContentWorldIdentifier, String> world) -> (IPC::DataReference resultData, Optional<WebCore::ExceptionDetails> details) Async
    224224
    225     ForceRepaint(WebKit::CallbackID callbackID)
     225    ForceRepaint() -> () Async
    226226    SelectAll()
    227227    ScheduleFullEditorStateUpdate()
  • trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h

    r268014 r271171  
    6262
    6363    void forceRepaint() override;
    64     bool forceRepaintAsync(CallbackID) override;
     64    void forceRepaintAsync(WebPage&, CompletionHandler<void()>&&) override;
    6565    void setLayerTreeStateIsFrozen(bool) override;
    6666    bool layerTreeStateIsFrozen() const override;
  • trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r270557 r271171  
    174174}
    175175
    176 bool TiledCoreAnimationDrawingArea::forceRepaintAsync(CallbackID callbackID)
    177 {
    178     if (m_layerTreeStateIsFrozen)
    179         return false;
    180 
    181     dispatchAfterEnsuringUpdatedScrollPosition([this, callbackID] {
     176void TiledCoreAnimationDrawingArea::forceRepaintAsync(WebPage& page, CompletionHandler<void()>&& completionHandler)
     177{
     178    if (m_layerTreeStateIsFrozen) {
     179        page.forceRepaintWithoutCallback();
     180        return completionHandler();
     181    }
     182
     183    dispatchAfterEnsuringUpdatedScrollPosition([this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)] () mutable {
     184        if (!weakThis)
     185            return completionHandler();
    182186        m_webPage.drawingArea()->forceRepaint();
    183         m_webPage.send(Messages::WebPageProxy::VoidCallback(callbackID));
     187        completionHandler();
    184188    });
    185     return true;
    186189}
    187190
Note: See TracChangeset for help on using the changeset viewer.