- Revision
- 98113
- Author
- [email protected]
- Date
- 2011-10-21 10:46:34 -0700 (Fri, 21 Oct 2011)
Log Message
Flash of white when loading a page after a web process crash
https://bugs.webkit.org/show_bug.cgi?id=70615
<rdar://problem/10306906>
Reviewed by Darin Adler.
* UIProcess/API/mac/WKView.mm:
(-[WKView _processDidCrash]):
(-[WKView _didRelaunchProcess]):
Remove calls to setNeedsDisplay here.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
Call setNeedsDisplay, but only if calling out to the loader client didn't relaunch the web process.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::setPaintingEnabled):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::scroll):
(WebKit::DrawingAreaImpl::setPaintingEnabled):
* WebProcess/WebPage/DrawingAreaImpl.h:
Add a way to disable painting completely for a drawing area.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Disable painting while setting up the web page, otherwise we'll get paint requests when we set the
active state of the web page.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (98112 => 98113)
--- trunk/Source/WebKit2/ChangeLog 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-21 17:46:34 UTC (rev 98113)
@@ -1,3 +1,35 @@
+2011-10-21 Anders Carlsson <[email protected]>
+
+ Flash of white when loading a page after a web process crash
+ https://bugs.webkit.org/show_bug.cgi?id=70615
+ <rdar://problem/10306906>
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _processDidCrash]):
+ (-[WKView _didRelaunchProcess]):
+ Remove calls to setNeedsDisplay here.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::processDidCrash):
+ Call setNeedsDisplay, but only if calling out to the loader client didn't relaunch the web process.
+
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::setPaintingEnabled):
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+ (WebKit::DrawingAreaImpl::setNeedsDisplay):
+ (WebKit::DrawingAreaImpl::scroll):
+ (WebKit::DrawingAreaImpl::setPaintingEnabled):
+ * WebProcess/WebPage/DrawingAreaImpl.h:
+ Add a way to disable painting completely for a drawing area.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ Disable painting while setting up the web page, otherwise we'll get paint requests when we set the
+ active state of the web page.
+
2011-10-21 Csaba Osztrogonác <[email protected]>
[Qt][WK2] Buildfix for newer Qt5. Remove duplicated defines.
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (98112 => 98113)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2011-10-21 17:46:34 UTC (rev 98113)
@@ -2062,7 +2062,6 @@
- (void)_processDidCrash
{
- [self setNeedsDisplay:YES];
[self _updateRemoteAccessibilityRegistration:NO];
}
@@ -2073,7 +2072,6 @@
- (void)_didRelaunchProcess
{
- [self setNeedsDisplay:YES];
}
- (void)_setCursor:(NSCursor *)cursor
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (98112 => 98113)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-10-21 17:46:34 UTC (rev 98113)
@@ -3027,6 +3027,14 @@
m_pageClient->processDidCrash();
m_loaderClient.processDidCrash(this);
+ if (!m_isValid) {
+ // If the call out to the loader client didn't cause the web process to be relaunched,
+ // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
+ // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
+ // until the new web process has painted its contents.
+ setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
+ }
+
// Can't expect DidReceiveEvent notifications from a crashed web process.
m_keyEventQueue.clear();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (98112 => 98113)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2011-10-21 17:46:34 UTC (rev 98113)
@@ -74,6 +74,8 @@
virtual void didUninstallPageOverlay() { }
virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&) { }
+ virtual void setPaintingEnabled(bool) { }
+
#if USE(ACCELERATED_COMPOSITING)
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
virtual void scheduleCompositingLayerSync() = 0;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (98112 => 98113)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2011-10-21 17:46:34 UTC (rev 98113)
@@ -56,6 +56,7 @@
DrawingAreaImpl::DrawingAreaImpl(WebPage* webPage, const WebPageCreationParameters& parameters)
: DrawingArea(DrawingAreaTypeImpl, webPage)
, m_backingStoreStateID(0)
+ , m_isPaintingEnabled(true)
, m_inUpdateBackingStoreState(false)
, m_shouldSendDidUpdateBackingStoreState(false)
, m_isWaitingForDidUpdate(false)
@@ -78,6 +79,9 @@
void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
{
+ if (!m_isPaintingEnabled)
+ return;
+
IntRect dirtyRect = rect;
dirtyRect.intersect(m_webPage->bounds());
@@ -100,6 +104,9 @@
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
{
+ if (!m_isPaintingEnabled)
+ return;
+
if (m_layerTreeHost) {
ASSERT(m_scrollRect.isEmpty());
ASSERT(m_scrollOffset.isEmpty());
@@ -228,6 +235,11 @@
setNeedsDisplay(rect);
}
+void DrawingAreaImpl::setPaintingEnabled(bool paintingEnabled)
+{
+ m_isPaintingEnabled = paintingEnabled;
+}
+
void DrawingAreaImpl::layerHostDidFlushLayers()
{
ASSERT(m_layerTreeHost);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h (98112 => 98113)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h 2011-10-21 17:46:34 UTC (rev 98113)
@@ -62,7 +62,9 @@
virtual void didInstallPageOverlay();
virtual void didUninstallPageOverlay();
virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&);
-
+
+ virtual void setPaintingEnabled(bool);
+
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
virtual void scheduleCompositingLayerSync();
virtual void syncCompositingLayers();
@@ -100,6 +102,9 @@
WebCore::IntRect m_scrollRect;
WebCore::IntSize m_scrollOffset;
+ // Whether painting is enabled. If painting is disabled, any calls to setNeedsDisplay and scroll are ignored.
+ bool m_isPaintingEnabled;
+
// Whether we're currently processing an UpdateBackingStoreState message.
bool m_inUpdateBackingStoreState;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (98112 => 98113)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-10-21 17:41:38 UTC (rev 98112)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-10-21 17:46:34 UTC (rev 98113)
@@ -228,6 +228,8 @@
platformInitialize();
m_drawingArea = DrawingArea::create(this, parameters);
+ m_drawingArea->setPaintingEnabled(false);
+
m_mainFrame = WebFrame::createMainFrame(this);
setDrawsBackground(parameters.drawsBackground);
@@ -246,6 +248,8 @@
if (!parameters.sessionState.isEmpty())
restoreSession(parameters.sessionState);
+ m_drawingArea->setPaintingEnabled(true);
+
#ifndef NDEBUG
webPageCounter.increment();
#endif