Pass the argument of DrawingArea::shouldUseTiledBackingForFrameView by reference
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 06:24:50 +0000 (06:24 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 06:24:50 +0000 (06:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173605

DrawingArea::shouldUseTiledBackingForFrameView is only called from
WebChromeClient::shouldUseTiledBackingForFrameView where the frame view is already available
as a reference. This patch makes the argument of
DrawingArea::shouldUseTiledBackingForFrameView a reference, so it does not need to be
converted to a pointer or to perform nullchecks.

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-20
Reviewed by Simon Fraser.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Just pass the reference.
* WebProcess/WebPage/DrawingArea.h: Make the parameter a reference.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Ditto.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Use the reference
to frame view and remove the nullcheck.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index e8115b8..374ec82 100644 (file)
@@ -1,3 +1,27 @@
+2017-06-20  Frederic Wang  <fwang@igalia.com>
+
+        Pass the argument of DrawingArea::shouldUseTiledBackingForFrameView by reference
+        https://bugs.webkit.org/show_bug.cgi?id=173605
+
+        DrawingArea::shouldUseTiledBackingForFrameView is only called from
+        WebChromeClient::shouldUseTiledBackingForFrameView where the frame view is already available
+        as a reference. This patch makes the argument of
+        DrawingArea::shouldUseTiledBackingForFrameView a reference, so it does not need to be
+        converted to a pointer or to perform nullchecks.
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Just pass the reference.
+        * WebProcess/WebPage/DrawingArea.h: Make the parameter a reference.
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Ditto.
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Use the reference
+        to frame view and remove the nullcheck.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto.
+
 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Disable font variations on macOS Sierra and iOS 10
index 6edcb5a..88455d9 100644 (file)
@@ -1071,7 +1071,7 @@ void WebChromeClient::didAddFooterLayer(GraphicsLayer& footerParent)
 
 bool WebChromeClient::shouldUseTiledBackingForFrameView(const FrameView& frameView) const
 {
-    return m_page.drawingArea()->shouldUseTiledBackingForFrameView(&frameView);
+    return m_page.drawingArea()->shouldUseTiledBackingForFrameView(frameView);
 }
 
 void WebChromeClient::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state, uint64_t sourceElementID)
index d84639f..9085756 100644 (file)
@@ -103,7 +103,7 @@ public:
 
     virtual bool supportsAsyncScrolling() { return false; }
 
-    virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) { return false; }
+    virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) { return false; }
 
     virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return nullptr; }
     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
index 41d3f37..020eec2 100644 (file)
@@ -73,7 +73,7 @@ private:
     RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
     void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*);
 
-    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) override;
+    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) override;
 
     void updatePreferences(const WebPreferencesStore&) override;
 
index 0268893..2d9c9a7 100644 (file)
@@ -154,9 +154,9 @@ void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize& viewSize, const I
     m_webPage.send(Messages::DrawingAreaProxy::DidUpdateGeometry());
 }
 
-bool RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView(const FrameView* frameView)
+bool RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView(const FrameView& frameView)
 {
-    return frameView && frameView->frame().isMainFrame();
+    return frameView.frame().isMainFrame();
 }
 
 void RemoteLayerTreeDrawingArea::updatePreferences(const WebPreferencesStore&)
index 6b291d4..cf89578 100644 (file)
@@ -79,7 +79,7 @@ private:
 
     void dispatchAfterEnsuringUpdatedScrollPosition(WTF::Function<void ()>&&) override;
 
-    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) override;
+    bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) override;
 
     void activityStateDidChange(WebCore::ActivityState::Flags changed, bool wantsDidUpdateActivityState, const Vector<uint64_t>&) override;
     void didUpdateActivityStateTimerFired();
index db149e7..480d681 100644 (file)
@@ -681,9 +681,9 @@ void TiledCoreAnimationDrawingArea::updateDebugInfoLayer(bool showLayer)
     }
 }
 
-bool TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView(const FrameView* frameView)
+bool TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView(const FrameView& frameView)
 {
-    return frameView && frameView->frame().isMainFrame();
+    return frameView.frame().isMainFrame();
 }
 
 PlatformCALayer* TiledCoreAnimationDrawingArea::layerForTransientZoom() const