Fixes <http://webkit.org/b/54142> <rdar://problem/
8979365> Crash in
DrawingAreaProxyImpl::paint when WKView paints after being resized while hidden
Reviewed by Darin Adler.
Source/WebKit2:
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::paint): Null-check m_backingStore after waiting for
DidSetSize, as m_backingStore can go away when we receive that message. This is the bug fix.
Also moved the accelerated compositing check inside the block where we wait for DidSetSize.
If we didn't wait for DidSetSize, we already know that we're not in accelerated compositing
mode (and asserted so earlier in this function).
Tools:
Test that having a WKView paint after being resized while hidden doesn't cause a crash
* TestWebKitAPI/Tests/WebKit2/win/ResizeViewWhileHidden.cpp:
(TestWebKitAPI::TEST): Force the WKView to paint after resizing it while hidden.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78199
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-09 Adam Roben <aroben@apple.com>
+
+ Notice when the backing store goes away after DidSetSize
+
+ Fixes <http://webkit.org/b/54142> <rdar://problem/8979365> Crash in
+ DrawingAreaProxyImpl::paint when WKView paints after being resized while hidden
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::paint): Null-check m_backingStore after waiting for
+ DidSetSize, as m_backingStore can go away when we receive that message. This is the bug fix.
+ Also moved the accelerated compositing check inside the block where we wait for DidSetSize.
+ If we didn't wait for DidSetSize, we already know that we're not in accelerated compositing
+ mode (and asserted so earlier in this function).
+
2011-02-09 Adam Roben <aroben@apple.com>
Decode a null SharedMemory::Handle correctly on Windows
// Wait for a DidSetSize message that contains the new bits before we paint
// what's currently in the backing store.
waitForAndDispatchDidSetSize();
- }
- // Dispatching DidSetSize could change the compositing mode, return if that happens.
- if (isInAcceleratedCompositingMode())
- return;
+ // Dispatching DidSetSize could destroy our backing store or change the compositing mode.
+ if (!m_backingStore || isInAcceleratedCompositingMode())
+ return;
+ }
m_backingStore->paint(context, rect);
unpaintedRegion.subtract(IntRect(IntPoint(), m_backingStore->size()));
+2011-02-09 Adam Roben <aroben@apple.com>
+
+ Test that having a WKView paint after being resized while hidden doesn't cause a crash
+
+ Test for <http://webkit.org/b/54142> <rdar://problem/8979365> Crash in
+ DrawingAreaProxyImpl::paint when WKView paints after being resized while hidden
+
+ Reviewed by Darin Adler.
+
+ * TestWebKitAPI/Tests/WebKit2/win/ResizeViewWhileHidden.cpp:
+ (TestWebKitAPI::TEST): Force the WKView to paint after resizing it while hidden.
+
2011-02-09 Adam Roben <aroben@apple.com>
Add a test that resizes a WKView while it's hidden
webView.resizeTo(originalRect.right - originalRect.left, originalRect.bottom - originalRect.top);
::ShowWindow(window, SW_SHOW);
+ // Force the WKView to paint to try to trigger <http://webkit.org/b/54142>.
+ ::SendMessage(window, WM_PAINT, 0, 0);
+
// In Debug builds without the fix for <http://webkit.org/b/54141>, the web process will assert
// at this point.
// FIXME: It would be good to have a way to check that our behavior is correct in Release