Skip to content
Permalink
Browse files
Fix TestWebKitAPI crash introduced in r202532.
WebPageProxy::forceRepaint() could trigger a call to the didForceRepaintCallback()
after the WebPageProxy had been invalidated, causing a null de-ref of m_drawingArea.
Fix by checking for error and isValid().

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::forceRepaint):

Canonical link: https://commits.webkit.org/177291@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Jun 28, 2016
1 parent 34af592 commit 32787db9e2636b6019b78ecd7041b93353fd5199
Showing with 21 additions and 0 deletions.
  1. +11 −0 Source/WebKit2/ChangeLog
  2. +10 −0 Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1,3 +1,14 @@
2016-06-27 Simon Fraser <simon.fraser@apple.com>

Fix TestWebKitAPI crash introduced in r202532.

WebPageProxy::forceRepaint() could trigger a call to the didForceRepaintCallback()
after the WebPageProxy had been invalidated, causing a null de-ref of m_drawingArea.
Fix by checking for error and isValid().

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::forceRepaint):

2016-06-27 Simon Fraser <simon.fraser@apple.com>

[iOS] Make DumpRenderTree and WebKitTestRunner in the simulator use render server snapshotting
@@ -2889,6 +2889,16 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
}

std::function<void (CallbackBase::Error)> didForceRepaintCallback = [this, callback](CallbackBase::Error error) {
if (error != CallbackBase::Error::None) {
callback->invalidate(error);
return;
}

if (!isValid()) {
callback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
return;
}

callAfterNextPresentationUpdate([callback](CallbackBase::Error error) {
if (error != CallbackBase::Error::None) {
callback->invalidate(error);

0 comments on commit 32787db

Please sign in to comment.