Title: [175700] trunk/Source
Revision
175700
Author
[email protected]
Date
2014-11-06 10:46:51 -0800 (Thu, 06 Nov 2014)

Log Message

Use std::unique_ptr for TileController
https://bugs.webkit.org/show_bug.cgi?id=138429

Reviewed by Anders Carlsson.

Source/WebCore:

* WebCore.exp.in:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::create): Deleted.
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/mac/WebTiledBackingLayer.h:
* platform/graphics/ca/mac/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer createTileController:]):
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::createTileController):
* platform/graphics/ca/win/PlatformCALayerWinInternal.h:

Source/WebKit2:

* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (175699 => 175700)


--- trunk/Source/WebCore/ChangeLog	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/ChangeLog	2014-11-06 18:46:51 UTC (rev 175700)
@@ -1,3 +1,21 @@
+2014-11-05  Sam Weinig  <[email protected]>
+
+        Use std::unique_ptr for TileController
+        https://bugs.webkit.org/show_bug.cgi?id=138429
+
+        Reviewed by Anders Carlsson.
+
+        * WebCore.exp.in:
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::create): Deleted.
+        * platform/graphics/ca/TileController.h:
+        * platform/graphics/ca/mac/WebTiledBackingLayer.h:
+        * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
+        (-[WebTiledBackingLayer createTileController:]):
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
+        (PlatformCALayerWinInternal::createTileController):
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
+
 2014-11-06  Chris Dumez  <[email protected]>
 
         Use lambda functions in DocumentOrderedMap

Modified: trunk/Source/WebCore/WebCore.exp.in (175699 => 175700)


--- trunk/Source/WebCore/WebCore.exp.in	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-11-06 18:46:51 UTC (rev 175700)
@@ -465,7 +465,7 @@
 __ZN7WebCore14TileController23setTileDebugBorderColorENS_5ColorE
 __ZN7WebCore14TileController23setTileDebugBorderWidthEf
 __ZN7WebCore14TileController27tileCacheLayerBoundsChangedEv
-__ZN7WebCore14TileController6createEPNS_15PlatformCALayerE
+__ZN7WebCore14TileControllerC1EPNS_15PlatformCALayerE
 __ZN7WebCore14areRangesEqualEPKNS_5RangeES2_
 __ZN7WebCore14decodeHostNameEP8NSString
 __ZN7WebCore14encodeHostNameEP8NSString

Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (175699 => 175700)


--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2014-11-06 18:46:51 UTC (rev 175700)
@@ -40,11 +40,6 @@
 
 namespace WebCore {
 
-PassOwnPtr<TileController> TileController::create(PlatformCALayer* rootPlatformLayer)
-{
-    return adoptPtr(new TileController(rootPlatformLayer));
-}
-
 TileController::TileController(PlatformCALayer* rootPlatformLayer)
     : m_tileCacheLayer(rootPlatformLayer)
     , m_tileGrid(std::make_unique<TileGrid>(*this))

Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (175699 => 175700)


--- trunk/Source/WebCore/platform/graphics/ca/TileController.h	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h	2014-11-06 18:46:51 UTC (rev 175700)
@@ -53,7 +53,7 @@
     friend class TileCoverageMap;
     friend class TileGrid;
 public:
-    WEBCORE_EXPORT static PassOwnPtr<TileController> create(PlatformCALayer*);
+    explicit TileController(PlatformCALayer*);
     ~TileController();
 
     WEBCORE_EXPORT void tileCacheLayerBoundsChanged();
@@ -124,17 +124,14 @@
 
     WEBCORE_EXPORT Vector<RefPtr<PlatformCALayer>> containerLayers();
 
-protected:
+private:
+    TileGrid& tileGrid() { return *m_tileGrid; }
+
     void scheduleTileRevalidation(double interval);
 
     bool isInWindow() const { return m_isInWindow; }
     float topContentInset() const { return m_topContentInset; }
 
-private:
-    TileController(PlatformCALayer*);
-
-    TileGrid& tileGrid() { return *m_tileGrid; }
-
     // TiledBacking member functions.
     virtual void setVisibleRect(const FloatRect&) override;
     virtual bool tilesWouldChangeForVisibleRect(const FloatRect&) const override;

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h (175699 => 175700)


--- trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h	2014-11-06 18:46:51 UTC (rev 175700)
@@ -37,7 +37,7 @@
 }
 
 @interface WebTiledBackingLayer : CALayer {
-    OwnPtr<WebCore::TileController> _tileController;
+    std::unique_ptr<WebCore::TileController> _tileController;
 }
 
 - (WebCore::TileController*)createTileController:(WebCore::PlatformCALayer*)rootLayer;

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm (175699 => 175700)


--- trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm	2014-11-06 18:46:51 UTC (rev 175700)
@@ -64,7 +64,7 @@
 - (TileController*)createTileController:(PlatformCALayer*)rootLayer
 {
     ASSERT(!_tileController);
-    _tileController = TileController::create(rootLayer);
+    _tileController = std::make_unique<WebCore::TileController>(rootLayer);
     return _tileController.get();
 }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (175699 => 175700)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp	2014-11-06 18:46:51 UTC (rev 175700)
@@ -529,7 +529,7 @@
 TileController* PlatformCALayerWinInternal::createTileController(PlatformCALayer* rootLayer)
 {
     ASSERT(!m_tileController);
-    m_tileController = TileController::create(rootLayer);
+    m_tileController = std::make_unique<TileController>(rootLayer);
     return m_tileController.get();
 }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h (175699 => 175700)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h	2014-11-06 18:46:51 UTC (rev 175700)
@@ -84,7 +84,7 @@
     CGSize m_tileSize;
     CGSize m_constrainedSize;
     RetainPtr<CACFLayerRef> m_tileParent;
-    OwnPtr<TileController> m_tileController;
+    std::unique_ptr<TileController> m_tileController;
 };
 
 }

Modified: trunk/Source/WebKit2/ChangeLog (175699 => 175700)


--- trunk/Source/WebKit2/ChangeLog	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebKit2/ChangeLog	2014-11-06 18:46:51 UTC (rev 175700)
@@ -1,3 +1,14 @@
+2014-11-05  Sam Weinig  <[email protected]>
+
+        Use std::unique_ptr for TileController
+        https://bugs.webkit.org/show_bug.cgi?id=138429
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
+        (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
+
 2014-11-06  Dan Bernstein  <[email protected]>
 
         iOS build fix.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp (175699 => 175700)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp	2014-11-06 18:46:51 UTC (rev 175700)
@@ -38,8 +38,8 @@
 
 PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
     : PlatformCALayerRemote(layerType, owner, context)
+    , m_tileController(std::make_unique<TileController>(this))
 {
-    m_tileController = TileController::create(this);
 }
 
 PlatformCALayerRemoteTiledBacking::~PlatformCALayerRemoteTiledBacking()

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h (175699 => 175700)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h	2014-11-06 18:05:07 UTC (rev 175699)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h	2014-11-06 18:46:51 UTC (rev 175700)
@@ -59,7 +59,7 @@
     virtual void setBorderWidth(float) override;
     virtual void setBorderColor(const WebCore::Color&) override;
 
-    OwnPtr<WebCore::TileController> m_tileController;
+    std::unique_ptr<WebCore::TileController> m_tileController;
     mutable WebCore::PlatformCALayerList m_customSublayers;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to