<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174657] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174657">174657</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-13 13:59:32 -0700 (Mon, 13 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses
https://bugs.webkit.org/show_bug.cgi?id=137661

Reviewed by Simon Fraser.

Source/WebCore:

Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses and clean up
the surrounding code.

No new tests, no behavior change.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::updateReplicatedLayers):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
(WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::TileCoverageMap):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::ensureTilesForRect):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::clone):
(PlatformCALayerMac::appendSublayer):
(PlatformCALayerMac::insertSublayer):
(PlatformCALayerMac::replaceSublayer):
(PlatformCALayerMac::adoptSublayers):
(PlatformCALayerMac::copyFiltersFrom):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::setRootChildLayer):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::clone):
(PlatformCALayerWin::rootLayer):
(PlatformCALayerWin::appendSublayer):
(PlatformCALayerWin::insertSublayer):
(PlatformCALayerWin::replaceSublayer):
(PlatformCALayerWin::adoptSublayers):
(PlatformCALayerWin::copyFiltersFrom):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::insertSublayer):
* platform/graphics/ca/win/PlatformCALayerWinInternal.h:

Source/WebKit/win:

Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses and clean up
the surrounding code.

* FullscreenVideoController.cpp:
(FullscreenVideoController::enterFullscreen):

Source/WebKit2:

Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses and clean up
the surrounding code.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
(WebKit::PlatformCALayerRemote::setSublayers):
(WebKit::PlatformCALayerRemote::appendSublayer):
(WebKit::PlatformCALayerRemote::insertSublayer):
(WebKit::PlatformCALayerRemote::replaceSublayer):
(WebKit::PlatformCALayerRemote::adoptSublayers):
(WebKit::PlatformCALayerRemote::setMask):
(WebKit::PlatformCALayerRemote::copyFiltersFrom):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::buildTransaction):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileCoverageMapcpp">trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileGridcpp">trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinCACFLayerTreeHostcpp">trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalcpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalh">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinFullscreenVideoControllercpp">trunk/Source/WebKit/win/FullscreenVideoController.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustomh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeContextmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/ChangeLog        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -1,5 +1,51 @@
</span><span class="cx"> 2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137661
+
+        Reviewed by Simon Fraser.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses and clean up
+        the surrounding code.
+
+        No new tests, no behavior change.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+        (WebCore::GraphicsLayerCA::updateContentsRects):
+        (WebCore::GraphicsLayerCA::updateReplicatedLayers):
+        (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+        (WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/TileCoverageMap.cpp:
+        (WebCore::TileCoverageMap::TileCoverageMap):
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::ensureTilesForRect):
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (PlatformCALayerMac::clone):
+        (PlatformCALayerMac::appendSublayer):
+        (PlatformCALayerMac::insertSublayer):
+        (PlatformCALayerMac::replaceSublayer):
+        (PlatformCALayerMac::adoptSublayers):
+        (PlatformCALayerMac::copyFiltersFrom):
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::setRootChildLayer):
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        (PlatformCALayerWin::clone):
+        (PlatformCALayerWin::rootLayer):
+        (PlatformCALayerWin::appendSublayer):
+        (PlatformCALayerWin::insertSublayer):
+        (PlatformCALayerWin::replaceSublayer):
+        (PlatformCALayerWin::adoptSublayers):
+        (PlatformCALayerWin::copyFiltersFrom):
+        * platform/graphics/ca/win/PlatformCALayerWin.h:
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
+        (PlatformCALayerWinInternal::insertSublayer):
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
+
+2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Use is&lt;&gt;() / downcast&lt;&gt;() for Filter / FilterOperation subclasses
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=137644
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -1680,7 +1680,7 @@
</span><span class="cx">             // If m_layer doesn't have a parent, it means it's the root layer and
</span><span class="cx">             // is likely hosted by something that is not expecting to be changed
</span><span class="cx">             ASSERT(m_structuralLayer-&gt;superlayer());
</span><del>-            m_structuralLayer-&gt;superlayer()-&gt;replaceSublayer(m_structuralLayer.get(), m_layer.get());
</del><ins>+            m_structuralLayer-&gt;superlayer()-&gt;replaceSublayer(*m_structuralLayer, *m_layer);
</ins><span class="cx"> 
</span><span class="cx">             moveOrCopyAnimations(Move, m_structuralLayer.get(), m_layer.get());
</span><span class="cx"> 
</span><span class="lines">@@ -1953,7 +1953,7 @@
</span><span class="cx">             m_contentsClippingLayer-&gt;setName(&quot;Contents Clipping&quot;);
</span><span class="cx"> #endif
</span><span class="cx">             m_contentsLayer-&gt;removeFromSuperlayer();
</span><del>-            m_contentsClippingLayer-&gt;appendSublayer(m_contentsLayer.get());
</del><ins>+            m_contentsClippingLayer-&gt;appendSublayer(*m_contentsLayer);
</ins><span class="cx">             gainedOrLostClippingLayer = true;
</span><span class="cx">         }
</span><span class="cx">     
</span><span class="lines">@@ -2030,9 +2030,9 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_structuralLayer)
</span><del>-        m_structuralLayer-&gt;insertSublayer(replicaRoot.get(), 0);
</del><ins>+        m_structuralLayer-&gt;insertSublayer(*replicaRoot, 0);
</ins><span class="cx">     else
</span><del>-        m_layer-&gt;insertSublayer(replicaRoot.get(), 0);
</del><ins>+        m_layer-&gt;insertSublayer(*replicaRoot, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // For now, this assumes that layers only ever have one replica, so replicaIndices contains only 0 and 1.
</span><span class="lines">@@ -2969,11 +2969,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_usingTiledBacking = useTiledLayer;
</span><span class="cx">     
</span><del>-    m_layer-&gt;adoptSublayers(oldLayer.get());
</del><ins>+    m_layer-&gt;adoptSublayers(*oldLayer);
</ins><span class="cx"> 
</span><span class="cx"> #ifdef VISIBLE_TILE_WASH
</span><span class="cx">     if (m_visibleTileWashLayer)
</span><del>-        m_layer-&gt;appendSublayer(m_visibleTileWashLayer.get());
</del><ins>+        m_layer-&gt;appendSublayer(*m_visibleTileWashLayer;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (isMaskLayer()) {
</span><span class="lines">@@ -2985,7 +2985,7 @@
</span><span class="cx">         // Skip this step if we don't have a superlayer. This is probably a benign
</span><span class="cx">         // case that happens while restructuring the layer tree, and also occurs with
</span><span class="cx">         // WebKit2 page overlays, which can become tiled but are out-of-tree.
</span><del>-        oldLayer-&gt;superlayer()-&gt;replaceSublayer(oldLayer.get(), m_layer.get());
</del><ins>+        oldLayer-&gt;superlayer()-&gt;replaceSublayer(*oldLayer, *m_layer);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_uncommittedChanges |= ChildrenChanged
</span><span class="lines">@@ -3149,11 +3149,11 @@
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         if (structuralLayer) {
</span><del>-            structuralLayer-&gt;insertSublayer(replicaRoot.get(), 0);
</del><ins>+            structuralLayer-&gt;insertSublayer(*replicaRoot, 0);
</ins><span class="cx">             return structuralLayer;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        primaryLayer-&gt;insertSublayer(replicaRoot.get(), 0);
</del><ins>+        primaryLayer-&gt;insertSublayer(*replicaRoot, 0);
</ins><span class="cx">         return primaryLayer;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3171,7 +3171,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (contentsClippingLayer) {
</span><span class="cx">         ASSERT(contentsLayer);
</span><del>-        contentsClippingLayer-&gt;appendSublayer(contentsLayer.get());
</del><ins>+        contentsClippingLayer-&gt;appendSublayer(*contentsLayer);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (replicaLayer || structuralLayer || contentsLayer || contentsClippingLayer || childLayers.size() &gt; 0) {
</span><span class="lines">@@ -3216,7 +3216,7 @@
</span><span class="cx">             // If we have a transform layer, then the contents layer is parented in the 
</span><span class="cx">             // primary layer (which is itself a child of the transform layer).
</span><span class="cx">             primaryLayer-&gt;removeAllSublayers();
</span><del>-            primaryLayer-&gt;appendSublayer(contentsClippingLayer ? contentsClippingLayer.get() : contentsLayer.get());
</del><ins>+            primaryLayer-&gt;appendSublayer(contentsClippingLayer ? *contentsClippingLayer : *contentsLayer);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         result = structuralLayer;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><ins>+#include &lt;wtf/TypeCasts.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -115,16 +116,16 @@
</span><span class="cx">     virtual void removeFromSuperlayer() = 0;
</span><span class="cx">     virtual void setSublayers(const PlatformCALayerList&amp;) = 0;
</span><span class="cx">     virtual void removeAllSublayers() = 0;
</span><del>-    virtual void appendSublayer(PlatformCALayer*) = 0;
-    virtual void insertSublayer(PlatformCALayer*, size_t index) = 0;
-    virtual void replaceSublayer(PlatformCALayer* reference, PlatformCALayer*) = 0;
</del><ins>+    virtual void appendSublayer(PlatformCALayer&amp;) = 0;
+    virtual void insertSublayer(PlatformCALayer&amp;, size_t index) = 0;
+    virtual void replaceSublayer(PlatformCALayer&amp; reference, PlatformCALayer&amp;) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // A list of sublayers that GraphicsLayerCA should maintain as the first sublayers.
</span><span class="cx">     virtual const PlatformCALayerList* customSublayers() const = 0;
</span><span class="cx"> 
</span><span class="cx">     // This method removes the sublayers from the source and reparents them to the current layer.
</span><span class="cx">     // Any sublayers previously in the current layer are removed.
</span><del>-    virtual void adoptSublayers(PlatformCALayer* source) = 0;
</del><ins>+    virtual void adoptSublayers(PlatformCALayer&amp; source) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void addAnimationForKey(const String&amp; key, PlatformCAAnimation*) = 0;
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) = 0;
</span><span class="lines">@@ -182,7 +183,7 @@
</span><span class="cx">     virtual float opacity() const = 0;
</span><span class="cx">     virtual void setOpacity(float) = 0;
</span><span class="cx">     virtual void setFilters(const FilterOperations&amp;) = 0;
</span><del>-    virtual void copyFiltersFrom(const PlatformCALayer*) = 0;
</del><ins>+    virtual void copyFiltersFrom(const PlatformCALayer&amp;) = 0;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">     virtual void setBlendMode(BlendMode) = 0;
</span><span class="lines">@@ -259,9 +260,11 @@
</span><span class="cx">     PlatformCALayerClient* m_owner;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#define PLATFORM_CALAYER_TYPE_CASTS(ToValueTypeName, predicate) \
-    TYPE_CASTS_BASE(ToValueTypeName, WebCore::PlatformCALayer, object, object-&gt;predicate, object.predicate)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+#define SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(ToValueTypeName) \
+    static bool isType(const WebCore::PlatformCALayer&amp; layer) { return layer.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // PlatformCALayer_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileCoverageMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     m_visibleRectIndicatorLayer.get().setAnchorPoint(FloatPoint3D());
</span><span class="cx">     m_visibleRectIndicatorLayer.get().setBorderColor(Color(255, 0, 0));
</span><span class="cx"> 
</span><del>-    m_layer.get().appendSublayer(&amp;m_visibleRectIndicatorLayer.get());
</del><ins>+    m_layer.get().appendSublayer(m_visibleRectIndicatorLayer.get());
</ins><span class="cx"> 
</span><span class="cx">     update();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -543,7 +543,7 @@
</span><span class="cx">             bool shouldParentTileLayer = (!m_controller.unparentsOffscreenTiles() || m_controller.isInWindow()) &amp;&amp; !tileInfo.layer-&gt;superlayer();
</span><span class="cx"> 
</span><span class="cx">             if (shouldParentTileLayer)
</span><del>-                m_containerLayer.get().appendSublayer(tileInfo.layer.get());
</del><ins>+                m_containerLayer.get().appendSublayer(*tileInfo.layer);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -55,11 +55,11 @@
</span><span class="cx">     virtual void removeFromSuperlayer() override;
</span><span class="cx">     virtual void setSublayers(const PlatformCALayerList&amp;) override;
</span><span class="cx">     virtual void removeAllSublayers() override;
</span><del>-    virtual void appendSublayer(PlatformCALayer*) override;
-    virtual void insertSublayer(PlatformCALayer*, size_t index) override;
-    virtual void replaceSublayer(PlatformCALayer* reference, PlatformCALayer*) override;
</del><ins>+    virtual void appendSublayer(PlatformCALayer&amp;) override;
+    virtual void insertSublayer(PlatformCALayer&amp;, size_t index) override;
+    virtual void replaceSublayer(PlatformCALayer&amp; reference, PlatformCALayer&amp;) override;
</ins><span class="cx">     virtual const PlatformCALayerList* customSublayers() const override { return m_customSublayers.get(); }
</span><del>-    virtual void adoptSublayers(PlatformCALayer* source) override;
</del><ins>+    virtual void adoptSublayers(PlatformCALayer&amp; source) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void addAnimationForKey(const String&amp; key, PlatformCAAnimation*) override;
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) override;
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">     virtual void setOpacity(float) override;
</span><span class="cx">     virtual void setFilters(const FilterOperations&amp;) override;
</span><span class="cx">     WEBCORE_EXPORT static bool filtersCanBeComposited(const FilterOperations&amp;);
</span><del>-    virtual void copyFiltersFrom(const PlatformCALayer*) override;
</del><ins>+    virtual void copyFiltersFrom(const PlatformCALayer&amp;) override;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">     virtual void setBlendMode(BlendMode) override;
</span><span class="lines">@@ -166,8 +166,8 @@
</span><span class="cx">     GraphicsLayer::CustomBehavior m_customBehavior;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerMac, isPlatformCALayerMac())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebCore::PlatformCALayerMac, isPlatformCALayerMac())
+
</ins><span class="cx"> #endif // PlatformCALayerMac_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx">     newLayer-&gt;setOpaque(isOpaque());
</span><span class="cx">     newLayer-&gt;setBackgroundColor(backgroundColor());
</span><span class="cx">     newLayer-&gt;setContentsScale(contentsScale());
</span><del>-    newLayer-&gt;copyFiltersFrom(this);
</del><ins>+    newLayer-&gt;copyFiltersFrom(*this);
</ins><span class="cx">     newLayer-&gt;updateCustomAppearance(customAppearance());
</span><span class="cx"> 
</span><span class="cx">     if (type == LayerTypeAVPlayerLayer) {
</span><span class="lines">@@ -422,34 +422,34 @@
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::appendSublayer(PlatformCALayer* layer)
</del><ins>+void PlatformCALayerMac::appendSublayer(PlatformCALayer&amp; layer)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    ASSERT(m_layer != layer-&gt;m_layer);
-    [m_layer.get() addSublayer:layer-&gt;m_layer.get()];
</del><ins>+    ASSERT(m_layer != layer.m_layer);
+    [m_layer.get() addSublayer:layer.m_layer.get()];
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::insertSublayer(PlatformCALayer* layer, size_t index)
</del><ins>+void PlatformCALayerMac::insertSublayer(PlatformCALayer&amp; layer, size_t index)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    ASSERT(m_layer != layer-&gt;m_layer);
-    [m_layer.get() insertSublayer:layer-&gt;m_layer.get() atIndex:index];
</del><ins>+    ASSERT(m_layer != layer.m_layer);
+    [m_layer.get() insertSublayer:layer.m_layer.get() atIndex:index];
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::replaceSublayer(PlatformCALayer* reference, PlatformCALayer* layer)
</del><ins>+void PlatformCALayerMac::replaceSublayer(PlatformCALayer&amp; reference, PlatformCALayer&amp; layer)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    ASSERT(m_layer != layer-&gt;m_layer);
-    [m_layer.get() replaceSublayer:reference-&gt;m_layer.get() with:layer-&gt;m_layer.get()];
</del><ins>+    ASSERT(m_layer != layer.m_layer);
+    [m_layer.get() replaceSublayer:reference.m_layer.get() with:layer.m_layer.get()];
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::adoptSublayers(PlatformCALayer* source)
</del><ins>+void PlatformCALayerMac::adoptSublayers(PlatformCALayer&amp; source)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    [m_layer.get() setSublayers:[source-&gt;m_layer.get() sublayers]];
</del><ins>+    [m_layer.get() setSublayers:[source.m_layer.get() sublayers]];
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -713,10 +713,10 @@
</span><span class="cx">     PlatformCAFilters::setFiltersOnLayer(platformLayer(), filters);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::copyFiltersFrom(const PlatformCALayer* sourceLayer)
</del><ins>+void PlatformCALayerMac::copyFiltersFrom(const PlatformCALayer&amp; sourceLayer)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    [m_layer.get() setFilters:[sourceLayer-&gt;platformLayer() filters]];
</del><ins>+    [m_layer.get() setFilters:[sourceLayer.platformLayer() filters]];
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinCACFLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx">     m_rootLayer-&gt;removeAllSublayers();
</span><span class="cx">     m_rootChildLayer = layer;
</span><span class="cx">     if (m_rootChildLayer)
</span><del>-        m_rootLayer-&gt;appendSublayer(m_rootChildLayer.get());
</del><ins>+        m_rootLayer-&gt;appendSublayer(*m_rootChildLayer);
</ins><span class="cx"> }
</span><span class="cx">    
</span><span class="cx"> void CACFLayerTreeHost::layerTreeDidChange()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx">     newLayer-&gt;setOpaque(isOpaque());
</span><span class="cx">     newLayer-&gt;setBackgroundColor(backgroundColor());
</span><span class="cx">     newLayer-&gt;setContentsScale(contentsScale());
</span><del>-    newLayer-&gt;copyFiltersFrom(this);
</del><ins>+    newLayer-&gt;copyFiltersFrom(*this);
</ins><span class="cx"> 
</span><span class="cx">     return newLayer;
</span><span class="cx"> }
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx"> PlatformCALayer* PlatformCALayerWin::rootLayer() const
</span><span class="cx"> {
</span><span class="cx">     AbstractCACFLayerTreeHost* host = layerTreeHostForLayer(this);
</span><del>-    return host ? host-&gt;rootLayer() : 0;
</del><ins>+    return host ? host-&gt;rootLayer() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCALayerWin::animationStarted(const String&amp; animationKey, CFTimeInterval beginTime)
</span><span class="lines">@@ -270,43 +270,40 @@
</span><span class="cx">     intern(this)-&gt;removeAllSublayers();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::appendSublayer(PlatformCALayer* layer)
</del><ins>+void PlatformCALayerWin::appendSublayer(PlatformCALayer&amp; layer)
</ins><span class="cx"> {
</span><span class="cx">     // This must be in terms of insertSublayer instead of a direct call so PlatformCALayerInternal can override.
</span><span class="cx">     insertSublayer(layer, intern(this)-&gt;sublayerCount());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::insertSublayer(PlatformCALayer* layer, size_t index)
</del><ins>+void PlatformCALayerWin::insertSublayer(PlatformCALayer&amp; layer, size_t index)
</ins><span class="cx"> {
</span><span class="cx">     intern(this)-&gt;insertSublayer(layer, index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::replaceSublayer(PlatformCALayer* reference, PlatformCALayer* newLayer)
</del><ins>+void PlatformCALayerWin::replaceSublayer(PlatformCALayer&amp; reference, PlatformCALayer&amp; newLayer)
</ins><span class="cx"> {
</span><span class="cx">     // This must not use direct calls to allow PlatformCALayerInternal to override.
</span><del>-    ASSERT_ARG(reference, reference);
-    ASSERT_ARG(reference, reference-&gt;superlayer() == this);
</del><ins>+    ASSERT_ARG(reference, reference.superlayer() == this);
</ins><span class="cx"> 
</span><del>-    if (reference == newLayer)
</del><ins>+    if (&amp;reference == &amp;newLayer)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    int referenceIndex = intern(this)-&gt;indexOfSublayer(reference);
</del><ins>+    int referenceIndex = intern(this)-&gt;indexOfSublayer(&amp;reference);
</ins><span class="cx">     ASSERT(referenceIndex != -1);
</span><span class="cx">     if (referenceIndex == -1)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    reference-&gt;removeFromSuperlayer();
</del><ins>+    reference.removeFromSuperlayer();
</ins><span class="cx"> 
</span><del>-    if (newLayer) {
-        newLayer-&gt;removeFromSuperlayer();
-        insertSublayer(newLayer, referenceIndex);
-    }
</del><ins>+    newLayer.removeFromSuperlayer();
+    insertSublayer(newLayer, referenceIndex);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::adoptSublayers(PlatformCALayer* source)
</del><ins>+void PlatformCALayerWin::adoptSublayers(PlatformCALayer&amp; source)
</ins><span class="cx"> {
</span><span class="cx">     PlatformCALayerList sublayers;
</span><del>-    intern(source)-&gt;getSublayers(sublayers);
</del><ins>+    intern(&amp;source)-&gt;getSublayers(sublayers);
</ins><span class="cx"> 
</span><span class="cx">     // Use setSublayers() because it properly nulls out the superlayer pointers.
</span><span class="cx">     setSublayers(sublayers);
</span><span class="lines">@@ -547,7 +544,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::copyFiltersFrom(const PlatformCALayer*)
</del><ins>+void PlatformCALayerWin::copyFiltersFrom(const PlatformCALayer&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -46,11 +46,11 @@
</span><span class="cx">     virtual void removeFromSuperlayer() override;
</span><span class="cx">     virtual void setSublayers(const PlatformCALayerList&amp;) override;
</span><span class="cx">     virtual void removeAllSublayers() override;
</span><del>-    virtual void appendSublayer(PlatformCALayer*) override;
-    virtual void insertSublayer(PlatformCALayer*, size_t index) override;
-    virtual void replaceSublayer(PlatformCALayer* reference, PlatformCALayer*) override;
</del><ins>+    virtual void appendSublayer(PlatformCALayer&amp;) override;
+    virtual void insertSublayer(PlatformCALayer&amp;, size_t index) override;
+    virtual void replaceSublayer(PlatformCALayer&amp; reference, PlatformCALayer&amp;) override;
</ins><span class="cx">     virtual const PlatformCALayerList* customSublayers() const override { return m_customSublayers.get(); }
</span><del>-    virtual void adoptSublayers(PlatformCALayer* source) override;
</del><ins>+    virtual void adoptSublayers(PlatformCALayer&amp; source) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void addAnimationForKey(const String&amp; key, PlatformCAAnimation*) override;
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) override;
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setFilters(const FilterOperations&amp;) override;
</span><span class="cx">     static bool filtersCanBeComposited(const FilterOperations&amp;) { return false; }
</span><del>-    virtual void copyFiltersFrom(const PlatformCALayer*) override;
</del><ins>+    virtual void copyFiltersFrom(const PlatformCALayer&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setName(const String&amp;) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -258,16 +258,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWinInternal::insertSublayer(PlatformCALayer* layer, size_t index)
</del><ins>+void PlatformCALayerWinInternal::insertSublayer(PlatformCALayer&amp; layer, size_t index)
</ins><span class="cx"> {
</span><span class="cx">     index = min(index, sublayerCount());
</span><span class="cx">     if (layerTypeIsTiled(m_owner-&gt;layerType())) {
</span><span class="cx">         // Add 1 to account for the tile parent layer
</span><del>-        index++;
</del><ins>+        ++index;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    layer-&gt;removeFromSuperlayer();
-    CACFLayerInsertSublayer(owner()-&gt;platformLayer(), layer-&gt;platformLayer(), index);
</del><ins>+    layer.removeFromSuperlayer();
+    CACFLayerInsertSublayer(owner()-&gt;platformLayer(), layer.platformLayer(), index);
</ins><span class="cx">     owner()-&gt;setNeedsCommit();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     void setSublayers(const PlatformCALayerList&amp;);
</span><span class="cx">     void getSublayers(PlatformCALayerList&amp;) const;
</span><span class="cx">     void removeAllSublayers();
</span><del>-    void insertSublayer(PlatformCALayer*, size_t);
</del><ins>+    void insertSublayer(PlatformCALayer&amp;, size_t);
</ins><span class="cx">     size_t sublayerCount() const;
</span><span class="cx">     int indexOfSublayer(const PlatformCALayer* reference);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137661
+
+        Reviewed by Simon Fraser.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses and clean up 
+        the surrounding code.
+
+        * FullscreenVideoController.cpp:
+        (FullscreenVideoController::enterFullscreen):
+
</ins><span class="cx"> 2014-10-10  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use is&lt;&gt;() / downcast&lt;&gt;() for RenderElement
</span></span></pre></div>
<a id="trunkSourceWebKitwinFullscreenVideoControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/FullscreenVideoController.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/FullscreenVideoController.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit/win/FullscreenVideoController.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -282,7 +282,8 @@
</span><span class="cx">     m_fullscreenWindow-&gt;setRootChildLayer(m_rootChild);
</span><span class="cx"> 
</span><span class="cx">     PlatformCALayer* videoLayer = PlatformCALayer::platformCALayer(m_videoElement-&gt;platformLayer());
</span><del>-    m_rootChild-&gt;appendSublayer(videoLayer);
</del><ins>+    ASSERT(videoLayer);
+    m_rootChild-&gt;appendSublayer(*videoLayer);
</ins><span class="cx">     m_rootChild-&gt;setNeedsLayout();
</span><span class="cx">     m_rootChild-&gt;setGeometryFlipped(1);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137661
+
+        Reviewed by Simon Fraser.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for PlatformCALayer subclasses and clean up 
+        the surrounding code.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
+        (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
+        (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
+        (WebKit::PlatformCALayerRemote::setSublayers):
+        (WebKit::PlatformCALayerRemote::appendSublayer):
+        (WebKit::PlatformCALayerRemote::insertSublayer):
+        (WebKit::PlatformCALayerRemote::replaceSublayer):
+        (WebKit::PlatformCALayerRemote::adoptSublayers):
+        (WebKit::PlatformCALayerRemote::setMask):
+        (WebKit::PlatformCALayerRemote::copyFiltersFrom):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::buildTransaction):
+
+2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Use is&lt;&gt;() / downcast&lt;&gt;() for Filter / FilterOperation subclasses
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=137644
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx"> PlatformCALayerRemote::~PlatformCALayerRemote()
</span><span class="cx"> {
</span><span class="cx">     for (const auto&amp; layer : m_children)
</span><del>-        toPlatformCALayerRemote(layer.get())-&gt;m_superlayer = nullptr;
</del><ins>+        downcast&lt;PlatformCALayerRemote&gt;(*layer).m_superlayer = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     if (m_context)
</span><span class="cx">         m_context-&gt;layerWillBeDestroyed(*this);
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">     clone.setBackgroundColor(backgroundColor());
</span><span class="cx">     clone.setContentsScale(contentsScale());
</span><span class="cx">     if (m_properties.filters)
</span><del>-        clone.copyFiltersFrom(this);
</del><ins>+        clone.copyFiltersFrom(*this);
</ins><span class="cx">     clone.updateCustomAppearance(customAppearance());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -167,9 +167,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; m_children.size(); ++i) {
</span><del>-        PlatformCALayerRemote* child = toPlatformCALayerRemote(m_children[i].get());
-        ASSERT(child-&gt;superlayer() == this);
-        child-&gt;recursiveBuildTransaction(context, transaction);
</del><ins>+        PlatformCALayerRemote&amp; child = downcast&lt;PlatformCALayerRemote&gt;(*m_children[i]);
+        ASSERT(child.superlayer() == this);
+        child.recursiveBuildTransaction(context, transaction);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_maskLayer)
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (const auto&amp; layer : list) {
</span><span class="cx">         layer-&gt;removeFromSuperlayer();
</span><del>-        toPlatformCALayerRemote(layer.get())-&gt;m_superlayer = this;
</del><ins>+        downcast&lt;PlatformCALayerRemote&gt;(*layer).m_superlayer = this;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
</span><span class="lines">@@ -270,47 +270,47 @@
</span><span class="cx">     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemote::appendSublayer(PlatformCALayer* layer)
</del><ins>+void PlatformCALayerRemote::appendSublayer(PlatformCALayer&amp; layer)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;PlatformCALayer&gt; layerProtector(layer);
</del><ins>+    Ref&lt;PlatformCALayer&gt; layerProtector(layer);
</ins><span class="cx"> 
</span><del>-    layer-&gt;removeFromSuperlayer();
-    m_children.append(layer);
-    toPlatformCALayerRemote(layer)-&gt;m_superlayer = this;
</del><ins>+    layer.removeFromSuperlayer();
+    m_children.append(&amp;layer);
+    downcast&lt;PlatformCALayerRemote&gt;(layer).m_superlayer = this;
</ins><span class="cx">     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemote::insertSublayer(PlatformCALayer* layer, size_t index)
</del><ins>+void PlatformCALayerRemote::insertSublayer(PlatformCALayer&amp; layer, size_t index)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;PlatformCALayer&gt; layerProtector(layer);
</del><ins>+    Ref&lt;PlatformCALayer&gt; layerProtector(layer);
</ins><span class="cx"> 
</span><del>-    layer-&gt;removeFromSuperlayer();
-    m_children.insert(index, layer);
-    toPlatformCALayerRemote(layer)-&gt;m_superlayer = this;
</del><ins>+    layer.removeFromSuperlayer();
+    m_children.insert(index, &amp;layer);
+    downcast&lt;PlatformCALayerRemote&gt;(layer).m_superlayer = this;
</ins><span class="cx">     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemote::replaceSublayer(PlatformCALayer* reference, PlatformCALayer* layer)
</del><ins>+void PlatformCALayerRemote::replaceSublayer(PlatformCALayer&amp; reference, PlatformCALayer&amp; layer)
</ins><span class="cx"> {
</span><del>-    ASSERT(reference-&gt;superlayer() == this);
-    RefPtr&lt;PlatformCALayer&gt; layerProtector(layer);
</del><ins>+    ASSERT(reference.superlayer() == this);
+    Ref&lt;PlatformCALayer&gt; layerProtector(layer);
</ins><span class="cx"> 
</span><del>-    layer-&gt;removeFromSuperlayer();
-    size_t referenceIndex = m_children.find(reference);
</del><ins>+    layer.removeFromSuperlayer();
+    size_t referenceIndex = m_children.find(&amp;reference);
</ins><span class="cx">     if (referenceIndex != notFound) {
</span><span class="cx">         m_children[referenceIndex]-&gt;removeFromSuperlayer();
</span><del>-        m_children.insert(referenceIndex, layer);
-        toPlatformCALayerRemote(layer)-&gt;m_superlayer = this;
</del><ins>+        m_children.insert(referenceIndex, &amp;layer);
+        downcast&lt;PlatformCALayerRemote&gt;(layer).m_superlayer = this;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemote::adoptSublayers(PlatformCALayer* source)
</del><ins>+void PlatformCALayerRemote::adoptSublayers(PlatformCALayer&amp; source)
</ins><span class="cx"> {
</span><del>-    PlatformCALayerList layersToMove = toPlatformCALayerRemote(source)-&gt;m_children;
</del><ins>+    PlatformCALayerList layersToMove = downcast&lt;PlatformCALayerRemote&gt;(source).m_children;
</ins><span class="cx"> 
</span><del>-    if (const PlatformCALayerList* customLayers = source-&gt;customSublayers()) {
</del><ins>+    if (const PlatformCALayerList* customLayers = source.customSublayers()) {
</ins><span class="cx">         for (const auto&amp; layer : *customLayers) {
</span><span class="cx">             size_t layerIndex = layersToMove.find(layer);
</span><span class="cx">             if (layerIndex != notFound)
</span><span class="lines">@@ -379,7 +379,7 @@
</span><span class="cx"> void PlatformCALayerRemote::setMask(PlatformCALayer* layer)
</span><span class="cx"> {
</span><span class="cx">     if (layer) {
</span><del>-        m_maskLayer = toPlatformCALayerRemote(layer);
</del><ins>+        m_maskLayer = downcast&lt;PlatformCALayerRemote&gt;(layer);
</ins><span class="cx">         m_properties.maskLayerID = m_maskLayer-&gt;layerID();
</span><span class="cx">     } else {
</span><span class="cx">         m_maskLayer = nullptr;
</span><span class="lines">@@ -602,9 +602,9 @@
</span><span class="cx">     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::FiltersChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemote::copyFiltersFrom(const PlatformCALayer* sourceLayer)
</del><ins>+void PlatformCALayerRemote::copyFiltersFrom(const PlatformCALayer&amp; sourceLayer)
</ins><span class="cx"> {
</span><del>-    if (const FilterOperations* filters = toPlatformCALayerRemote(sourceLayer)-&gt;m_properties.filters.get())
</del><ins>+    if (const FilterOperations* filters = downcast&lt;PlatformCALayerRemote&gt;(sourceLayer).m_properties.filters.get())
</ins><span class="cx">         setFilters(*filters);
</span><span class="cx">     else if (m_properties.filters)
</span><span class="cx">         m_properties.filters = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -60,11 +60,11 @@
</span><span class="cx">     virtual void removeFromSuperlayer() override;
</span><span class="cx">     virtual void setSublayers(const WebCore::PlatformCALayerList&amp;) override;
</span><span class="cx">     virtual void removeAllSublayers() override;
</span><del>-    virtual void appendSublayer(WebCore::PlatformCALayer*) override;
-    virtual void insertSublayer(WebCore::PlatformCALayer*, size_t index) override;
-    virtual void replaceSublayer(WebCore::PlatformCALayer* reference, WebCore::PlatformCALayer*) override;
</del><ins>+    virtual void appendSublayer(WebCore::PlatformCALayer&amp;) override;
+    virtual void insertSublayer(WebCore::PlatformCALayer&amp;, size_t index) override;
+    virtual void replaceSublayer(WebCore::PlatformCALayer&amp; reference, WebCore::PlatformCALayer&amp;) override;
</ins><span class="cx">     virtual const WebCore::PlatformCALayerList* customSublayers() const override { return nullptr; }
</span><del>-    virtual void adoptSublayers(WebCore::PlatformCALayer* source) override;
</del><ins>+    virtual void adoptSublayers(WebCore::PlatformCALayer&amp; source) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void addAnimationForKey(const String&amp; key, WebCore::PlatformCAAnimation*) override;
</span><span class="cx">     virtual void removeAnimationForKey(const String&amp; key) override;
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setFilters(const WebCore::FilterOperations&amp;) override;
</span><span class="cx">     static bool filtersCanBeComposited(const WebCore::FilterOperations&amp;);
</span><del>-    virtual void copyFiltersFrom(const WebCore::PlatformCALayer*) override;
</del><ins>+    virtual void copyFiltersFrom(const WebCore::PlatformCALayer&amp;) override;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">     virtual void setBlendMode(WebCore::BlendMode) override;
</span><span class="lines">@@ -193,8 +193,8 @@
</span><span class="cx">     RemoteLayerTreeContext* m_context;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerRemote, isPlatformCALayerRemote())
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebKit::PlatformCALayerRemote, isPlatformCALayerRemote())
+
</ins><span class="cx"> #endif // PlatformCALayerRemote_h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -62,8 +62,8 @@
</span><span class="cx">     bool m_providesContents;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerRemoteCustom, isPlatformCALayerRemote())
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebKit::PlatformCALayerRemoteCustom, isPlatformCALayerRemote())
+
</ins><span class="cx"> #endif // PlatformCALayerRemoteCustom_h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm (174656 => 174657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm        2014-10-13 18:50:16 UTC (rev 174656)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm        2014-10-13 20:59:32 UTC (rev 174657)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> 
</span><span class="cx"> void RemoteLayerTreeContext::buildTransaction(RemoteLayerTreeTransaction&amp; transaction, PlatformCALayer&amp; rootLayer)
</span><span class="cx"> {
</span><del>-    PlatformCALayerRemote&amp; rootLayerRemote = toPlatformCALayerRemote(rootLayer);
</del><ins>+    PlatformCALayerRemote&amp; rootLayerRemote = downcast&lt;PlatformCALayerRemote&gt;(rootLayer);
</ins><span class="cx">     transaction.setRootLayerID(rootLayerRemote.layerID());
</span><span class="cx"> 
</span><span class="cx">     m_currentTransaction = &amp;transaction;
</span></span></pre>
</div>
</div>

</body>
</html>