Title: [202540] trunk/Source/WebKit2
Revision
202540
Author
[email protected]
Date
2016-06-27 22:56:04 -0700 (Mon, 27 Jun 2016)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (202539 => 202540)


--- trunk/Source/WebKit2/ChangeLog	2016-06-28 05:10:30 UTC (rev 202539)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-28 05:56:04 UTC (rev 202540)
@@ -1,5 +1,16 @@
 2016-06-27  Simon Fraser  <[email protected]>
 
+        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  <[email protected]>
+
         [iOS] Make DumpRenderTree and WebKitTestRunner in the simulator use render server snapshotting
         https://bugs.webkit.org/show_bug.cgi?id=159077
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (202539 => 202540)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-06-28 05:10:30 UTC (rev 202539)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-06-28 05:56:04 UTC (rev 202540)
@@ -2889,6 +2889,16 @@
     }
 
     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);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to