Support setting a background color on page overlays
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Apr 2014 08:10:22 +0000 (08:10 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Apr 2014 08:10:22 +0000 (08:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131600

Reviewed by Darin Adler.

* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::PageOverlay):
(WebKit::PageOverlay::bounds):
(WebKit::PageOverlay::startFadeInAnimation):
(WebKit::PageOverlay::startFadeOutAnimation):
(WebKit::PageOverlay::startFadeAnimation):
(WebKit::PageOverlay::fadeAnimationTimerFired):
Minor style adjustments.
Use more references everywhere.

(WebKit::PageOverlay::setBackgroundColor):
(WebKit::PageOverlay::setNeedsDisplay):
* WebProcess/WebPage/PageOverlay.h:
(WebKit::PageOverlay::backgroundColor):
Keep track of our background color, and push it down to the page overlay controller if we have one.

* WebProcess/WebPage/PageOverlayController.cpp:
(WebKit::updateOverlayGeometry):
(WebKit::PageOverlayController::clearPageOverlay):
Page overlays will always have the right size, and just use drawsContents to determine
whether or not they should tile/have backing store/etc.

(WebKit::PageOverlayController::installPageOverlay):
(WebKit::PageOverlayController::didChangeOverlayBackgroundColor):
Set the background color of the layer.

* WebProcess/WebPage/PageOverlayController.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
References!

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer):
Mark the compositing tree as needing a rebuild when we get a new document-relative
overlay layer; otherwise we were depending on something else coming along and
requiring a rebuild, which didn't always happen.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp
Source/WebKit2/WebProcess/WebPage/PageOverlay.h
Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp
Source/WebKit2/WebProcess/WebPage/PageOverlayController.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 9034f6c470e5ed85493e3deca783a7d3e918457e..b73c04f45bcd467c8708006c0668052f0ce76af3 100644 (file)
@@ -1,3 +1,16 @@
+2014-04-14  Tim Horton  <timothy_horton@apple.com>
+
+        Support setting a background color on page overlays
+        https://bugs.webkit.org/show_bug.cgi?id=131600
+
+        Reviewed by Darin Adler.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer):
+        Mark the compositing tree as needing a rebuild when we get a new document-relative
+        overlay layer; otherwise we were depending on something else coming along and
+        requiring a rebuild, which didn't always happen.
+
 2014-04-14  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSS Regions] Hit testing doesn't work in video
index c846ecb782b3e7a5b3443b6cb5a9310d735f92e6..bba6450f96d45bb783cfe02ed2fbd47ccacbc118 100644 (file)
@@ -3819,6 +3819,7 @@ void RenderLayerCompositor::setDocumentOverlayRootLayer(GraphicsLayer* documentO
     if (m_documentOverlayRootLayer)
         m_documentOverlayRootLayer->removeFromParent();
     m_documentOverlayRootLayer = documentOverlayRootLayer;
+    setCompositingLayersNeedRebuild(true);
     scheduleCompositingLayerUpdate();
 }
 
index b4a70dfec63ec3513fa9762e93c31aef59d02914..e821907a387c9ae93f3b3c17a407dfd63609775a 100644 (file)
@@ -1,3 +1,42 @@
+2014-04-14  Tim Horton  <timothy_horton@apple.com>
+
+        Support setting a background color on page overlays
+        https://bugs.webkit.org/show_bug.cgi?id=131600
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebPage/PageOverlay.cpp:
+        (WebKit::PageOverlay::PageOverlay):
+        (WebKit::PageOverlay::bounds):
+        (WebKit::PageOverlay::startFadeInAnimation):
+        (WebKit::PageOverlay::startFadeOutAnimation):
+        (WebKit::PageOverlay::startFadeAnimation):
+        (WebKit::PageOverlay::fadeAnimationTimerFired):
+        Minor style adjustments.
+        Use more references everywhere.
+
+        (WebKit::PageOverlay::setBackgroundColor):
+        (WebKit::PageOverlay::setNeedsDisplay):
+        * WebProcess/WebPage/PageOverlay.h:
+        (WebKit::PageOverlay::backgroundColor):
+        Keep track of our background color, and push it down to the page overlay controller if we have one.
+
+        * WebProcess/WebPage/PageOverlayController.cpp:
+        (WebKit::updateOverlayGeometry):
+        (WebKit::PageOverlayController::clearPageOverlay):
+        Page overlays will always have the right size, and just use drawsContents to determine
+        whether or not they should tile/have backing store/etc.
+
+        (WebKit::PageOverlayController::installPageOverlay):
+        (WebKit::PageOverlayController::didChangeOverlayBackgroundColor):
+        Set the background color of the layer.
+
+        * WebProcess/WebPage/PageOverlayController.h:
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        References!
+
 2014-04-13  Andy Estes  <aestes@apple.com>
 
         [QuickLook] Move file system-related code into WebKit
index ba8ac593c1b33123ce499b274482ba071c4b81ef..9f96003e840eb14944c7d91caf5f88fe6dd35e47 100644 (file)
@@ -49,13 +49,14 @@ PassRefPtr<PageOverlay> PageOverlay::create(Client* client, OverlayType overlayT
 
 PageOverlay::PageOverlay(Client* client, OverlayType overlayType)
     : m_client(client)
-    , m_webPage(0)
+    , m_webPage(nullptr)
     , m_fadeAnimationTimer(RunLoop::main(), this, &PageOverlay::fadeAnimationTimerFired)
-    , m_fadeAnimationStartTime(0.0)
+    , m_fadeAnimationStartTime(0)
     , m_fadeAnimationDuration(fadeAnimationDuration)
     , m_fadeAnimationType(NoAnimation)
-    , m_fractionFadedIn(1.0)
+    , m_fractionFadedIn(1)
     , m_overlayType(overlayType)
+    , m_backgroundColor(Color::transparent)
 {
 }
 
@@ -101,10 +102,24 @@ IntRect PageOverlay::frame() const
 
 void PageOverlay::setFrame(IntRect frame)
 {
+    if (m_overrideFrame == frame)
+        return;
+
     m_overrideFrame = frame;
 
     if (m_webPage)
-        m_webPage->pageOverlayController().didChangeOverlayFrame(this);
+        m_webPage->pageOverlayController().didChangeOverlayFrame(*this);
+}
+
+void PageOverlay::setBackgroundColor(RGBA32 backgroundColor)
+{
+    if (m_backgroundColor == backgroundColor)
+        return;
+
+    m_backgroundColor = backgroundColor;
+
+    if (m_webPage)
+        m_webPage->pageOverlayController().didChangeOverlayBackgroundColor(*this);
 }
 
 void PageOverlay::setPage(WebPage* webPage)
@@ -118,10 +133,11 @@ void PageOverlay::setPage(WebPage* webPage)
 
 void PageOverlay::setNeedsDisplay(const IntRect& dirtyRect)
 {
-    if (m_webPage) {
-        m_webPage->pageOverlayController().setPageOverlayOpacity(this, m_fractionFadedIn);
-        m_webPage->pageOverlayController().setPageOverlayNeedsDisplay(this, dirtyRect);
-    }
+    if (!m_webPage)
+        return;
+
+    m_webPage->pageOverlayController().setPageOverlayOpacity(*this, m_fractionFadedIn);
+    m_webPage->pageOverlayController().setPageOverlayNeedsDisplay(*this, dirtyRect);
 }
 
 void PageOverlay::setNeedsDisplay()
@@ -161,7 +177,7 @@ WKArrayRef PageOverlay::copyAccessibilityAttributeNames(bool parameterizedNames)
 
 void PageOverlay::startFadeInAnimation()
 {
-    m_fractionFadedIn = 0.0;
+    m_fractionFadedIn = 0;
     m_fadeAnimationType = FadeInAnimation;
 
     startFadeAnimation();
@@ -169,7 +185,7 @@ void PageOverlay::startFadeInAnimation()
 
 void PageOverlay::startFadeOutAnimation()
 {
-    m_fractionFadedIn = 1.0;
+    m_fractionFadedIn = 1;
     m_fadeAnimationType = FadeOutAnimation;
 
     startFadeAnimation();
@@ -184,8 +200,6 @@ void PageOverlay::stopFadeOutAnimation()
 void PageOverlay::startFadeAnimation()
 {
     m_fadeAnimationStartTime = currentTime();
-    
-    // Start the timer
     m_fadeAnimationTimer.startRepeating(1 / fadeAnimationFrameRate);
 }
 
@@ -200,7 +214,7 @@ void PageOverlay::fadeAnimationTimerFired()
     float fadeAnimationValue = sine * sine;
 
     m_fractionFadedIn = (m_fadeAnimationType == FadeInAnimation) ? fadeAnimationValue : 1 - fadeAnimationValue;
-    m_webPage->pageOverlayController().setPageOverlayOpacity(this, m_fractionFadedIn);
+    m_webPage->pageOverlayController().setPageOverlayOpacity(*this, m_fractionFadedIn);
 
     if (animationProgress == 1.0) {
         m_fadeAnimationTimer.stop();
@@ -208,16 +222,15 @@ void PageOverlay::fadeAnimationTimerFired()
         bool wasFadingOut = m_fadeAnimationType == FadeOutAnimation;
         m_fadeAnimationType = NoAnimation;
 
-        if (wasFadingOut) {
-            // If this was a fade out, go ahead and uninstall the page overlay.
+        // If this was a fade out, go ahead and uninstall the page overlay.
+        if (wasFadingOut)
             m_webPage->uninstallPageOverlay(this, PageOverlay::FadeMode::DoNotFade);
-        }
     }
 }
 
 void PageOverlay::clear()
 {
-    m_webPage->pageOverlayController().clearPageOverlay(this);
+    m_webPage->pageOverlayController().clearPageOverlay(*this);
 }
 
 } // namespace WebKit
index 0a645afc883ae517b8b9f51c9a44c856c741e56e..e5082ad4d8692a4bc3a330d0b15e3be3aa8d79b4 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "APIObject.h"
 #include "WKBase.h"
+#include <WebCore/Color.h>
 #include <WebCore/IntRect.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RunLoop.h>
@@ -91,6 +92,9 @@ public:
     WebCore::IntRect bounds() const;
     WebCore::IntRect frame() const;
     void setFrame(WebCore::IntRect);
+
+    WebCore::RGBA32 backgroundColor() const { return m_backgroundColor; }
+    void setBackgroundColor(WebCore::RGBA32);
     
 protected:
     explicit PageOverlay(Client*, OverlayType);
@@ -117,6 +121,8 @@ private:
 
     OverlayType m_overlayType;
     WebCore::IntRect m_overrideFrame;
+
+    WebCore::RGBA32 m_backgroundColor;
 };
 
 } // namespace WebKit
index 5949dfed5844a1d6e7db090b540af2f7db829d1e..e00d0c88cce010e7f8550e8b57914fd778fcae63 100644 (file)
@@ -42,7 +42,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PageOverlayController::PageOverlayController(WebPage* webPage)
+PageOverlayController::PageOverlayController(WebPage& webPage)
     : m_webPage(webPage)
 {
 }
@@ -52,14 +52,25 @@ void PageOverlayController::initialize()
     ASSERT(!m_documentOverlayRootLayer);
     ASSERT(!m_viewOverlayRootLayer);
 
-    m_documentOverlayRootLayer = GraphicsLayer::create(m_webPage->drawingArea()->graphicsLayerFactory(), this);
-    m_viewOverlayRootLayer = GraphicsLayer::create(m_webPage->drawingArea()->graphicsLayerFactory(), this);
+    m_documentOverlayRootLayer = GraphicsLayer::create(m_webPage.drawingArea()->graphicsLayerFactory(), this);
+    m_viewOverlayRootLayer = GraphicsLayer::create(m_webPage.drawingArea()->graphicsLayerFactory(), this);
 #ifndef NDEBUG
     m_documentOverlayRootLayer->setName("Page Overlay container (document-relative)");
     m_viewOverlayRootLayer->setName("Page Overlay container (view-relative)");
 #endif
 }
 
+static void updateOverlayGeometry(PageOverlay& overlay, GraphicsLayer& graphicsLayer)
+{
+    IntRect overlayFrame = overlay.frame();
+
+    if (overlayFrame.location() == graphicsLayer.position() && overlayFrame.size() == graphicsLayer.size())
+        return;
+
+    graphicsLayer.setPosition(overlayFrame.location());
+    graphicsLayer.setSize(overlayFrame.size());
+}
+
 void PageOverlayController::installPageOverlay(PassRefPtr<PageOverlay> pageOverlay, PageOverlay::FadeMode fadeMode)
 {
     ASSERT(m_documentOverlayRootLayer);
@@ -71,19 +82,20 @@ void PageOverlayController::installPageOverlay(PassRefPtr<PageOverlay> pageOverl
         return;
 
     m_pageOverlays.append(overlay);
-    overlay->setPage(m_webPage);
+    overlay->setPage(&m_webPage);
 
     if (fadeMode == PageOverlay::FadeMode::Fade)
         overlay->startFadeInAnimation();
 
-    std::unique_ptr<GraphicsLayer> layer = GraphicsLayer::create(m_webPage->drawingArea()->graphicsLayerFactory(), this);
+    std::unique_ptr<GraphicsLayer> layer = GraphicsLayer::create(m_webPage.drawingArea()->graphicsLayerFactory(), this);
     layer->setAnchorPoint(FloatPoint3D());
-    layer->setPosition(overlay->frame().location());
+    layer->setBackgroundColor(overlay->backgroundColor());
+    updateOverlayGeometry(*overlay, *layer);
 #ifndef NDEBUG
     layer->setName("Page Overlay content");
 #endif
 
-    updateSettingsForLayer(layer.get());
+    updateSettingsForLayer(*layer);
 
     switch (overlay->overlayType()) {
     case PageOverlay::OverlayType::View:
@@ -127,61 +139,43 @@ void PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates()
             forceSynchronousScrollLayerPositionUpdates = true;
     }
 
-    if (Page* page = m_webPage->corePage()) {
+    if (Page* page = m_webPage.corePage()) {
         if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
             scrollingCoordinator->setForceSynchronousScrollLayerPositionUpdates(forceSynchronousScrollLayerPositionUpdates);
     }
 #endif
 }
 
-static void updateOverlayGeometry(PageOverlay* overlay, GraphicsLayer* graphicsLayer)
+void PageOverlayController::setPageOverlayNeedsDisplay(PageOverlay& overlay, const WebCore::IntRect& dirtyRect)
 {
-    if (!graphicsLayer->drawsContent())
-        return;
-
-    graphicsLayer->setPosition(overlay->frame().location());
-    graphicsLayer->setSize(overlay->frame().size());
-    graphicsLayer->setNeedsDisplay();
-}
+    ASSERT(m_pageOverlays.contains(&overlay));
+    GraphicsLayer& graphicsLayer = *m_overlayGraphicsLayers.get(&overlay);
 
-void PageOverlayController::setPageOverlayNeedsDisplay(PageOverlay* overlay, const WebCore::IntRect& dirtyRect)
-{
-    GraphicsLayer* graphicsLayer = m_overlayGraphicsLayers.get(overlay);
-    if (!graphicsLayer)
-        return;
-
-    if (!graphicsLayer->drawsContent()) {
-        graphicsLayer->setDrawsContent(true);
+    if (!graphicsLayer.drawsContent()) {
+        graphicsLayer.setDrawsContent(true);
         updateOverlayGeometry(overlay, graphicsLayer);
     }
 
-    graphicsLayer->setNeedsDisplayInRect(dirtyRect);
+    graphicsLayer.setNeedsDisplayInRect(dirtyRect);
 }
 
-void PageOverlayController::setPageOverlayOpacity(PageOverlay* overlay, float opacity)
+void PageOverlayController::setPageOverlayOpacity(PageOverlay& overlay, float opacity)
 {
-    GraphicsLayer* graphicsLayer = m_overlayGraphicsLayers.get(overlay);
-    if (!graphicsLayer)
-        return;
-
-    graphicsLayer->setOpacity(opacity);
+    ASSERT(m_pageOverlays.contains(&overlay));
+    m_overlayGraphicsLayers.get(&overlay)->setOpacity(opacity);
 }
 
-void PageOverlayController::clearPageOverlay(PageOverlay* overlay)
+void PageOverlayController::clearPageOverlay(PageOverlay& overlay)
 {
-    GraphicsLayer* graphicsLayer = m_overlayGraphicsLayers.get(overlay);
-    if (!graphicsLayer)
-        return;
-
-    graphicsLayer->setDrawsContent(false);
-    graphicsLayer->setSize(IntSize());
+    ASSERT(m_pageOverlays.contains(&overlay));
+    m_overlayGraphicsLayers.get(&overlay)->setDrawsContent(false);
 }
 
 void PageOverlayController::didChangeViewSize()
 {
     for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
         if (overlayAndLayer.key->overlayType() == PageOverlay::OverlayType::View)
-            updateOverlayGeometry(overlayAndLayer.key, overlayAndLayer.value.get());
+            updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
     }
 }
 
@@ -189,14 +183,14 @@ void PageOverlayController::didChangeDocumentSize()
 {
     for (auto& overlayAndLayer : m_overlayGraphicsLayers) {
         if (overlayAndLayer.key->overlayType() == PageOverlay::OverlayType::Document)
-            updateOverlayGeometry(overlayAndLayer.key, overlayAndLayer.value.get());
+            updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
     }
 }
 
 void PageOverlayController::didChangePreferences()
 {
     for (auto& graphicsLayer : m_overlayGraphicsLayers.values())
-        updateSettingsForLayer(graphicsLayer.get());
+        updateSettingsForLayer(*graphicsLayer);
 }
 
 void PageOverlayController::didChangeDeviceScaleFactor()
@@ -210,7 +204,7 @@ void PageOverlayController::didChangeDeviceScaleFactor()
 
 void PageOverlayController::didChangeExposedRect()
 {
-    m_webPage->drawingArea()->scheduleCompositingLayerFlush();
+    m_webPage.drawingArea()->scheduleCompositingLayerFlush();
 }
 
 void PageOverlayController::didScrollFrame(Frame* frame)
@@ -226,12 +220,12 @@ void PageOverlayController::flushPageOverlayLayers(FloatRect visibleRect)
     m_viewOverlayRootLayer->flushCompositingState(visibleRect);
 }
 
-void PageOverlayController::updateSettingsForLayer(GraphicsLayer* layer)
+void PageOverlayController::updateSettingsForLayer(GraphicsLayer& layer)
 {
-    Settings& settings = m_webPage->corePage()->settings();
-    layer->setAcceleratesDrawing(settings.acceleratedDrawingEnabled());
-    layer->setShowDebugBorder(settings.showDebugBorders());
-    layer->setShowRepaintCounter(settings.showRepaintCounter());
+    Settings& settings = m_webPage.corePage()->settings();
+    layer.setAcceleratesDrawing(settings.acceleratedDrawingEnabled());
+    layer.setShowDebugBorder(settings.showDebugBorders());
+    layer.setShowRepaintCounter(settings.showRepaintCounter());
 }
 
 bool PageOverlayController::handleMouseEvent(const WebMouseEvent& mouseEvent)
@@ -289,25 +283,25 @@ void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphics
 
 float PageOverlayController::deviceScaleFactor() const
 {
-    return m_webPage->corePage()->deviceScaleFactor();
+    return m_webPage.corePage()->deviceScaleFactor();
 }
 
 void PageOverlayController::notifyFlushRequired(const WebCore::GraphicsLayer*)
 {
-    if (m_webPage->drawingArea())
-        m_webPage->drawingArea()->scheduleCompositingLayerFlush();
+    if (m_webPage.drawingArea())
+        m_webPage.drawingArea()->scheduleCompositingLayerFlush();
 }
 
-void PageOverlayController::didChangeOverlayFrame(PageOverlay* overlay)
+void PageOverlayController::didChangeOverlayFrame(PageOverlay& overlay)
 {
-    ASSERT(m_pageOverlays.contains(overlay));
-
-    GraphicsLayer* graphicsLayer = m_overlayGraphicsLayers.get(overlay);
-
-    if (!graphicsLayer->drawsContent())
-        return;
+    ASSERT(m_pageOverlays.contains(&overlay));
+    updateOverlayGeometry(overlay, *m_overlayGraphicsLayers.get(&overlay));
+}
 
-    updateOverlayGeometry(overlay, graphicsLayer);
+void PageOverlayController::didChangeOverlayBackgroundColor(PageOverlay& overlay)
+{
+    ASSERT(m_pageOverlays.contains(&overlay));
+    m_overlayGraphicsLayers.get(&overlay)->setBackgroundColor(overlay.backgroundColor());
 }
 
 } // namespace WebKit
index f04b7245247ea63616069d68ee04ea8dbdfc05c6..4f1689b85873bcdcd8f3cb2e1ecb7ebed88289a3 100644 (file)
@@ -44,7 +44,7 @@ class WebPage;
 
 class PageOverlayController : public WebCore::GraphicsLayerClient {
 public:
-    PageOverlayController(WebPage*);
+    PageOverlayController(WebPage&);
 
     void initialize();
 
@@ -54,9 +54,9 @@ public:
     void installPageOverlay(PassRefPtr<PageOverlay>, PageOverlay::FadeMode);
     void uninstallPageOverlay(PageOverlay*, PageOverlay::FadeMode);
 
-    void setPageOverlayNeedsDisplay(PageOverlay*, const WebCore::IntRect&);
-    void setPageOverlayOpacity(PageOverlay*, float);
-    void clearPageOverlay(PageOverlay*);
+    void setPageOverlayNeedsDisplay(PageOverlay&, const WebCore::IntRect&);
+    void setPageOverlayOpacity(PageOverlay&, float);
+    void clearPageOverlay(PageOverlay&);
 
     void didChangeViewSize();
     void didChangeDocumentSize();
@@ -64,7 +64,9 @@ public:
     void didChangeDeviceScaleFactor();
     void didChangeExposedRect();
     void didScrollFrame(WebCore::Frame*);
-    void didChangeOverlayFrame(PageOverlay*);
+
+    void didChangeOverlayFrame(PageOverlay&);
+    void didChangeOverlayBackgroundColor(PageOverlay&);
 
     void flushPageOverlayLayers(WebCore::FloatRect);
 
@@ -75,7 +77,7 @@ public:
     WKArrayRef copyAccessibilityAttributesNames(bool parameterizedNames);
 
 private:
-    void updateSettingsForLayer(WebCore::GraphicsLayer*);
+    void updateSettingsForLayer(WebCore::GraphicsLayer&);
     void updateForceSynchronousScrollLayerPositionUpdates();
 
     // WebCore::GraphicsLayerClient
@@ -90,7 +92,7 @@ private:
     std::unique_ptr<WebCore::GraphicsLayer> m_viewOverlayRootLayer;
     HashMap<PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> m_overlayGraphicsLayers;
     Vector<RefPtr<PageOverlay>> m_pageOverlays;
-    WebPage* m_webPage;
+    WebPage& m_webPage;
 };
 
 } // namespace WebKit
index 5e87d670b445bce1711d58dd0cda3c5d127db683..e79296e20f2070d669cf21f6da6029f931939725 100644 (file)
@@ -305,7 +305,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 #if ENABLE(WEBGL)
     , m_systemWebGLPolicy(WebGLAllowCreation)
 #endif
-    , m_pageOverlayController(this)
+    , m_pageOverlayController(*this)
 {
     ASSERT(m_pageID);
     // FIXME: This is a non-ideal location for this Setting and