REGRESSION(r197409): [GTK] Web process always crashes on WebPage construction after...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2016 17:59:34 +0000 (17:59 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2016 17:59:34 +0000 (17:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154918

Reviewed by Žan Doberšek.

We have an incorrect check in DrawingAreaImpl constructor that has
never actually worked because it uses the page settings before
they were initialized. But that has been fixed in r197409 and now
we are always forcing accelerated compositing mode incorrectly,
because m_alwaysUseCompositing is set in the constructor and never
changed again.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl): Remove code to set
settings and m_alwaysUseCompositing, since that should be done in
updatePreferences().
(WebKit::DrawingAreaImpl::updatePreferences): Update the settings
accordingly and always update m_alwaysUseCompositing when AC is
enabled and forced in the settings.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): WebPage::updatePreferences() calls
DrawingArea::updatePreferences(), but since r197409 it happens
before the drawing area has been created. So, call
DrawingArea::updatePreferences() in the constructor right after
the main frame has been created, since
DrawingArea::updatePreferences() uses the main frame.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197452 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index e94e925..d503ccb 100644 (file)
@@ -1,3 +1,32 @@
+2016-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        REGRESSION(r197409): [GTK] Web process always crashes on WebPage construction after r197409
+        https://bugs.webkit.org/show_bug.cgi?id=154918
+
+        Reviewed by Žan Doberšek.
+
+        We have an incorrect check in DrawingAreaImpl constructor that has
+        never actually worked because it uses the page settings before
+        they were initialized. But that has been fixed in r197409 and now
+        we are always forcing accelerated compositing mode incorrectly,
+        because m_alwaysUseCompositing is set in the constructor and never
+        changed again.
+
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::DrawingAreaImpl): Remove code to set
+        settings and m_alwaysUseCompositing, since that should be done in
+        updatePreferences().
+        (WebKit::DrawingAreaImpl::updatePreferences): Update the settings
+        accordingly and always update m_alwaysUseCompositing when AC is
+        enabled and forced in the settings.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage): WebPage::updatePreferences() calls
+        DrawingArea::updatePreferences(), but since r197409 it happens
+        before the drawing area has been created. So, call
+        DrawingArea::updatePreferences() in the constructor right after
+        the main frame has been created, since
+        DrawingArea::updatePreferences() uses the main frame.
+
 2016-02-29  Ada Chan  <adachan@apple.com>
 
         Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
index 5e5857b..cb4352e 100644 (file)
@@ -68,16 +68,6 @@ DrawingAreaImpl::DrawingAreaImpl(WebPage& webPage, const WebPageCreationParamete
     , m_displayTimer(RunLoop::main(), this, &DrawingAreaImpl::displayTimerFired)
     , m_exitCompositingTimer(RunLoop::main(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode)
 {
-
-#if USE(COORDINATED_GRAPHICS_THREADED)
-    webPage.corePage()->settings().setForceCompositingMode(true);
-#endif
-
-    if (webPage.corePage()->settings().acceleratedDrawingEnabled() || webPage.corePage()->settings().forceCompositingMode())
-        m_alwaysUseCompositing = true;
-
-    if (m_alwaysUseCompositing)
-        enterAcceleratedCompositingMode(0);
 }
 
 void DrawingAreaImpl::setNeedsDisplay()
@@ -257,6 +247,10 @@ void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store)
     settings.setAcceleratedCompositingForFixedPositionEnabled(true);
     settings.setFixedPositionCreatesStackingContext(true);
 #endif
+
+    m_alwaysUseCompositing = settings.acceleratedDrawingEnabled() && settings.forceCompositingMode();
+    if (m_alwaysUseCompositing && !m_layerTreeHost)
+        enterAcceleratedCompositingMode(nullptr);
 }
 
 void DrawingAreaImpl::layerHostDidFlushLayers()
index 5a9ad84..cb44e79 100644 (file)
@@ -418,6 +418,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 #endif
 
     m_mainFrame = WebFrame::createWithCoreMainFrame(this, &m_page->mainFrame());
+    m_drawingArea->updatePreferences(parameters.store);
 
 #if ENABLE(BATTERY_STATUS)
     WebCore::provideBatteryTo(m_page.get(), new WebBatteryClient(this));