<!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>[149661] 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/149661">149661</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2013-05-06 21:31:35 -0700 (Mon, 06 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use OwnPtr instead of deleteAllValues in KeyframeValueList
https://bugs.webkit.org/show_bug.cgi?id=115652

Reviewed by Simon Fraser.

Source/WebCore:

Also made a few related style fixes in the functions touched.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::KeyframeValueList::insert): Change argument type to PassOwnPtr
and update use of m_values since it has OwnPtr now instead of raw pointer.

* platform/graphics/GraphicsLayer.h: Move conditional includes to a
separate paragraph, removed an unneeded forward class declaration.
(WebCore::AnimationValue::AnimationValue): Marked this constructor explicit
and removed an unneeded if statement.
(WebCore::AnimationValue::clone): Changed to use adoptPtr and PassOwnPtr.
(WebCore::FloatAnimationValue::clone): Changed this to return a PassOwnPtr.
(WebCore::TransformAnimationValue::TransformAnimationValue): Marked explicit.
(WebCore::TransformAnimationValue::clone): Changed to use adoptPtr and PassOwnPtr.
(WebCore::FilterAnimationValue::FilterAnimationValue): Marked explicit.
(WebCore::FilterAnimationValue::clone): Changed to use adoptPtr and PassOwnPtr.
(WebCore::KeyframeValueList::KeyframeValueList): Marked explicit.
(WebCore::KeyframeValueList::~KeyframeValueList): Removed, since the default
destructor works without an explicit deleteAllValues call.
(WebCore::KeyframeValueList::at): Added call to get needed since the vector
contains OwnPtr now.
(WebCore::KeyframeValueList::insert): Changed to take PassOwnPtr and then
removed now-redundant comment saying &quot;takes ownership of the pointer&quot;.
(WebCore::KeyframeValueList::m_values): Changed type to Vector&lt;OwnPtr&gt;.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation): Added adoptPtr next to the
all the places new was done before calling KeyframeValueList::insert. Also
simplified the booleans and #if in this function.
(WebCore::RenderLayerBacking::startTransition): Ditto.

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::ArgumentCoder&lt;GraphicsLayerAnimation&gt;::decode): Added adoptPtr
next to new when calling KeyframeValueList::insert.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayercpp">trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerh">trunk/Source/WebCore/platform/graphics/GraphicsLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp">trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (149660 => 149661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-07 04:15:05 UTC (rev 149660)
+++ trunk/Source/WebCore/ChangeLog        2013-05-07 04:31:35 UTC (rev 149661)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2013-05-06  Darin Adler  &lt;darin@apple.com&gt;
+
+        Use OwnPtr instead of deleteAllValues in KeyframeValueList
+        https://bugs.webkit.org/show_bug.cgi?id=115652
+
+        Reviewed by Simon Fraser.
+
+        Also made a few related style fixes in the functions touched.
+
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::KeyframeValueList::insert): Change argument type to PassOwnPtr
+        and update use of m_values since it has OwnPtr now instead of raw pointer.
+
+        * platform/graphics/GraphicsLayer.h: Move conditional includes to a
+        separate paragraph, removed an unneeded forward class declaration.
+        (WebCore::AnimationValue::AnimationValue): Marked this constructor explicit
+        and removed an unneeded if statement.
+        (WebCore::AnimationValue::clone): Changed to use adoptPtr and PassOwnPtr.
+        (WebCore::FloatAnimationValue::clone): Changed this to return a PassOwnPtr.
+        (WebCore::TransformAnimationValue::TransformAnimationValue): Marked explicit.
+        (WebCore::TransformAnimationValue::clone): Changed to use adoptPtr and PassOwnPtr.
+        (WebCore::FilterAnimationValue::FilterAnimationValue): Marked explicit.
+        (WebCore::FilterAnimationValue::clone): Changed to use adoptPtr and PassOwnPtr.
+        (WebCore::KeyframeValueList::KeyframeValueList): Marked explicit.
+        (WebCore::KeyframeValueList::~KeyframeValueList): Removed, since the default
+        destructor works without an explicit deleteAllValues call.
+        (WebCore::KeyframeValueList::at): Added call to get needed since the vector
+        contains OwnPtr now.
+        (WebCore::KeyframeValueList::insert): Changed to take PassOwnPtr and then
+        removed now-redundant comment saying &quot;takes ownership of the pointer&quot;.
+        (WebCore::KeyframeValueList::m_values): Changed type to Vector&lt;OwnPtr&gt;.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::startAnimation): Added adoptPtr next to the
+        all the places new was done before calling KeyframeValueList::insert. Also
+        simplified the booleans and #if in this function.
+        (WebCore::RenderLayerBacking::startTransition): Ditto.
+
</ins><span class="cx"> 2013-05-06  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Replaceable] attributes must be readonly
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (149660 => 149661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2013-05-07 04:15:05 UTC (rev 149660)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2013-05-07 04:31:35 UTC (rev 149661)
</span><span class="lines">@@ -53,10 +53,10 @@
</span><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void KeyframeValueList::insert(const AnimationValue* value)
</del><ins>+void KeyframeValueList::insert(PassOwnPtr&lt;const AnimationValue&gt; value)
</ins><span class="cx"> {
</span><span class="cx">     for (size_t i = 0; i &lt; m_values.size(); ++i) {
</span><del>-        const AnimationValue* curValue = m_values[i];
</del><ins>+        const AnimationValue* curValue = m_values[i].get();
</ins><span class="cx">         if (curValue-&gt;keyTime() == value-&gt;keyTime()) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             // insert after
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (149660 => 149661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2013-05-07 04:15:05 UTC (rev 149660)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2013-05-07 04:31:35 UTC (rev 149661)
</span><span class="lines">@@ -30,9 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Animation.h&quot;
</span><span class="cx"> #include &quot;Color.h&quot;
</span><del>-#if ENABLE(CSS_FILTERS)
-#include &quot;FilterOperations.h&quot;
-#endif
</del><span class="cx"> #include &quot;FloatPoint.h&quot;
</span><span class="cx"> #include &quot;FloatPoint3D.h&quot;
</span><span class="cx"> #include &quot;FloatSize.h&quot;
</span><span class="lines">@@ -43,6 +40,10 @@
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_FILTERS)
+#include &quot;FilterOperations.h&quot;
+#endif
+
</ins><span class="cx"> enum LayerTreeAsTextBehaviorFlags {
</span><span class="cx">     LayerTreeAsTextBehaviorNormal = 0,
</span><span class="cx">     LayerTreeAsTextDebug = 1 &lt;&lt; 0, // Dump extra debugging info like layer addresses.
</span><span class="lines">@@ -55,7 +56,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class FloatPoint3D;
</del><span class="cx"> class FloatRect;
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class GraphicsLayerFactory;
</span><span class="lines">@@ -68,21 +68,21 @@
</span><span class="cx"> // Base class for animation values (also used for transitions). Here to
</span><span class="cx"> // represent values for properties being animated via the GraphicsLayer,
</span><span class="cx"> // without pulling in style-related data from outside of the platform directory.
</span><ins>+// FIXME: Should be moved to its own header file.
</ins><span class="cx"> class AnimationValue {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    AnimationValue(float keyTime, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</del><ins>+    explicit AnimationValue(float keyTime, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</ins><span class="cx">         : m_keyTime(keyTime)
</span><ins>+        , m_timingFunction(timingFunction)
</ins><span class="cx">     {
</span><del>-        if (timingFunction)
-            m_timingFunction = timingFunction;
</del><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     virtual ~AnimationValue() { }
</span><span class="cx"> 
</span><span class="cx">     float keyTime() const { return m_keyTime; }
</span><span class="cx">     const TimingFunction* timingFunction() const { return m_timingFunction.get(); }
</span><del>-    virtual AnimationValue* clone() const = 0;
</del><ins>+    virtual PassOwnPtr&lt;AnimationValue&gt; clone() const = 0;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     float m_keyTime;
</span><span class="lines">@@ -90,6 +90,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // Used to store one float value of an animation.
</span><ins>+// FIXME: Should be moved to its own header file.
</ins><span class="cx"> class FloatAnimationValue : public AnimationValue {
</span><span class="cx"> public:
</span><span class="cx">     FloatAnimationValue(float keyTime, float value, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</span><span class="lines">@@ -97,7 +98,7 @@
</span><span class="cx">         , m_value(value)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    virtual AnimationValue* clone() const { return new FloatAnimationValue(*this); }
</del><ins>+    virtual PassOwnPtr&lt;AnimationValue&gt; clone() const OVERRIDE { return adoptPtr(new FloatAnimationValue(*this)); }
</ins><span class="cx"> 
</span><span class="cx">     float value() const { return m_value; }
</span><span class="cx"> 
</span><span class="lines">@@ -106,15 +107,16 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // Used to store one transform value in a keyframe list.
</span><ins>+// FIXME: Should be moved to its own header file.
</ins><span class="cx"> class TransformAnimationValue : public AnimationValue {
</span><span class="cx"> public:
</span><del>-    TransformAnimationValue(float keyTime, const TransformOperations* value = 0, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</del><ins>+    explicit TransformAnimationValue(float keyTime, const TransformOperations* value = 0, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</ins><span class="cx">         : AnimationValue(keyTime, timingFunction)
</span><span class="cx">     {
</span><span class="cx">         if (value)
</span><span class="cx">             m_value = *value;
</span><span class="cx">     }
</span><del>-    virtual AnimationValue* clone() const { return new TransformAnimationValue(*this); }
</del><ins>+    virtual PassOwnPtr&lt;AnimationValue&gt; clone() const OVERRIDE { return adoptPtr(new TransformAnimationValue(*this)); }
</ins><span class="cx"> 
</span><span class="cx">     const TransformOperations* value() const { return &amp;m_value; }
</span><span class="cx"> 
</span><span class="lines">@@ -124,15 +126,16 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx"> // Used to store one filter value in a keyframe list.
</span><ins>+// FIXME: Should be moved to its own header file.
</ins><span class="cx"> class FilterAnimationValue : public AnimationValue {
</span><span class="cx"> public:
</span><del>-    FilterAnimationValue(float keyTime, const FilterOperations* value = 0, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</del><ins>+    explicit FilterAnimationValue(float keyTime, const FilterOperations* value = 0, PassRefPtr&lt;TimingFunction&gt; timingFunction = 0)
</ins><span class="cx">         : AnimationValue(keyTime, timingFunction)
</span><span class="cx">     {
</span><span class="cx">         if (value)
</span><span class="cx">             m_value = *value;
</span><span class="cx">     }
</span><del>-    virtual AnimationValue* clone() const { return new FilterAnimationValue(*this); }
</del><ins>+    virtual PassOwnPtr&lt;AnimationValue&gt; clone() const OVERRIDE { return adoptPtr(new FilterAnimationValue(*this)); }
</ins><span class="cx"> 
</span><span class="cx">     const FilterOperations* value() const { return &amp;m_value; }
</span><span class="cx"> 
</span><span class="lines">@@ -141,12 +144,12 @@
</span><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-// Used to store a series of values in a keyframe list. Values will all be of the same type,
-// which can be inferred from the property.
</del><ins>+// Used to store a series of values in a keyframe list.
+// Values will all be of the same type, which can be inferred from the property.
+// FIXME: Should be moved to its own header file.
</ins><span class="cx"> class KeyframeValueList {
</span><span class="cx"> public:
</span><del>-
-    KeyframeValueList(AnimatedPropertyID property)
</del><ins>+    explicit KeyframeValueList(AnimatedPropertyID property)
</ins><span class="cx">         : m_property(property)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -158,11 +161,6 @@
</span><span class="cx">             m_values.append(other.m_values[i]-&gt;clone());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ~KeyframeValueList()
-    {
-        deleteAllValues(m_values);
-    }
-
</del><span class="cx">     KeyframeValueList&amp; operator=(const KeyframeValueList&amp; other)
</span><span class="cx">     {
</span><span class="cx">         KeyframeValueList copy(other);
</span><span class="lines">@@ -179,18 +177,16 @@
</span><span class="cx">     AnimatedPropertyID property() const { return m_property; }
</span><span class="cx"> 
</span><span class="cx">     size_t size() const { return m_values.size(); }
</span><del>-    const AnimationValue* at(size_t i) const { return m_values.at(i); }
</del><ins>+    const AnimationValue* at(size_t i) const { return m_values.at(i).get(); }
</ins><span class="cx">     
</span><del>-    // Insert, sorted by keyTime. Takes ownership of the pointer.
-    void insert(const AnimationValue*);
</del><ins>+    // Insert, sorted by keyTime.
+    void insert(PassOwnPtr&lt;const AnimationValue&gt;);
</ins><span class="cx">     
</span><span class="cx"> protected:
</span><del>-    Vector&lt;const AnimationValue*&gt; m_values;
</del><ins>+    Vector&lt;OwnPtr&lt;const AnimationValue&gt; &gt; m_values;
</ins><span class="cx">     AnimatedPropertyID m_property;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-
-
</del><span class="cx"> // GraphicsLayer is an abstraction for a rendering surface with backing store,
</span><span class="cx"> // which may have associated transformation and animations.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (149660 => 149661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2013-05-07 04:15:05 UTC (rev 149660)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2013-05-07 04:31:35 UTC (rev 149661)
</span><span class="lines">@@ -2107,39 +2107,31 @@
</span><span class="cx">         
</span><span class="cx">         bool isFirstOrLastKeyframe = key == 0 || key == 1;
</span><span class="cx">         if ((hasTransform &amp;&amp; isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
</span><del>-            transformVector.insert(new TransformAnimationValue(key, &amp;(keyframeStyle-&gt;transform()), tf));
</del><ins>+            transformVector.insert(adoptPtr(new TransformAnimationValue(key, &amp;(keyframeStyle-&gt;transform()), tf)));
</ins><span class="cx">         
</span><span class="cx">         if ((hasOpacity &amp;&amp; isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyOpacity))
</span><del>-            opacityVector.insert(new FloatAnimationValue(key, keyframeStyle-&gt;opacity(), tf));
</del><ins>+            opacityVector.insert(adoptPtr(new FloatAnimationValue(key, keyframeStyle-&gt;opacity(), tf)));
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx">         if ((hasFilter &amp;&amp; isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitFilter))
</span><del>-            filterVector.insert(new FilterAnimationValue(key, &amp;(keyframeStyle-&gt;filter()), tf));
</del><ins>+            filterVector.insert(adoptPtr(new FilterAnimationValue(key, &amp;(keyframeStyle-&gt;filter()), tf)));
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool didAnimateTransform = false;
-    bool didAnimateOpacity = false;
-#if ENABLE(CSS_FILTERS)
-    bool didAnimateFilter = false;
-#endif
</del><ins>+    bool didAnimate = false;
</ins><span class="cx">     
</span><span class="cx">     if (hasTransform &amp;&amp; m_graphicsLayer-&gt;addAnimation(transformVector, toRenderBox(renderer())-&gt;pixelSnappedBorderBoxRect().size(), anim, keyframes.animationName(), timeOffset))
</span><del>-        didAnimateTransform = true;
</del><ins>+        didAnimate = true;
</ins><span class="cx"> 
</span><span class="cx">     if (hasOpacity &amp;&amp; m_graphicsLayer-&gt;addAnimation(opacityVector, IntSize(), anim, keyframes.animationName(), timeOffset))
</span><del>-        didAnimateOpacity = true;
</del><ins>+        didAnimate = true;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx">     if (hasFilter &amp;&amp; m_graphicsLayer-&gt;addAnimation(filterVector, IntSize(), anim, keyframes.animationName(), timeOffset))
</span><del>-        didAnimateFilter = true;
</del><ins>+        didAnimate = true;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_FILTERS)
-    return didAnimateTransform || didAnimateOpacity || didAnimateFilter;
-#else
-    return didAnimateTransform || didAnimateOpacity;
-#endif
</del><ins>+    return didAnimate;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderLayerBacking::animationPaused(double timeOffset, const String&amp; animationName)
</span><span class="lines">@@ -2154,11 +2146,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderLayerBacking::startTransition(double timeOffset, CSSPropertyID property, const RenderStyle* fromStyle, const RenderStyle* toStyle)
</span><span class="cx"> {
</span><del>-    bool didAnimateOpacity = false;
-    bool didAnimateTransform = false;
-#if ENABLE(CSS_FILTERS)
-    bool didAnimateFilter = false;
-#endif
</del><ins>+    bool didAnimate = false;
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(property != CSSPropertyInvalid);
</span><span class="cx"> 
</span><span class="lines">@@ -2166,13 +2154,13 @@
</span><span class="cx">         const Animation* opacityAnim = toStyle-&gt;transitionForProperty(CSSPropertyOpacity);
</span><span class="cx">         if (opacityAnim &amp;&amp; !opacityAnim-&gt;isEmptyOrZeroDuration()) {
</span><span class="cx">             KeyframeValueList opacityVector(AnimatedPropertyOpacity);
</span><del>-            opacityVector.insert(new FloatAnimationValue(0, compositingOpacity(fromStyle-&gt;opacity())));
-            opacityVector.insert(new FloatAnimationValue(1, compositingOpacity(toStyle-&gt;opacity())));
</del><ins>+            opacityVector.insert(adoptPtr(new FloatAnimationValue(0, compositingOpacity(fromStyle-&gt;opacity()))));
+            opacityVector.insert(adoptPtr(new FloatAnimationValue(1, compositingOpacity(toStyle-&gt;opacity()))));
</ins><span class="cx">             // The boxSize param is only used for transform animations (which can only run on RenderBoxes), so we pass an empty size here.
</span><span class="cx">             if (m_graphicsLayer-&gt;addAnimation(opacityVector, IntSize(), opacityAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyOpacity), timeOffset)) {
</span><span class="cx">                 // To ensure that the correct opacity is visible when the animation ends, also set the final opacity.
</span><span class="cx">                 updateOpacity(toStyle);
</span><del>-                didAnimateOpacity = true;
</del><ins>+                didAnimate = true;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2181,12 +2169,12 @@
</span><span class="cx">         const Animation* transformAnim = toStyle-&gt;transitionForProperty(CSSPropertyWebkitTransform);
</span><span class="cx">         if (transformAnim &amp;&amp; !transformAnim-&gt;isEmptyOrZeroDuration()) {
</span><span class="cx">             KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
</span><del>-            transformVector.insert(new TransformAnimationValue(0, &amp;fromStyle-&gt;transform()));
-            transformVector.insert(new TransformAnimationValue(1, &amp;toStyle-&gt;transform()));
</del><ins>+            transformVector.insert(adoptPtr(new TransformAnimationValue(0, &amp;fromStyle-&gt;transform())));
+            transformVector.insert(adoptPtr(new TransformAnimationValue(1, &amp;toStyle-&gt;transform())));
</ins><span class="cx">             if (m_graphicsLayer-&gt;addAnimation(transformVector, toRenderBox(renderer())-&gt;pixelSnappedBorderBoxRect().size(), transformAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitTransform), timeOffset)) {
</span><span class="cx">                 // To ensure that the correct transform is visible when the animation ends, also set the final transform.
</span><span class="cx">                 updateTransform(toStyle);
</span><del>-                didAnimateTransform = true;
</del><ins>+                didAnimate = true;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2196,22 +2184,18 @@
</span><span class="cx">         const Animation* filterAnim = toStyle-&gt;transitionForProperty(CSSPropertyWebkitFilter);
</span><span class="cx">         if (filterAnim &amp;&amp; !filterAnim-&gt;isEmptyOrZeroDuration()) {
</span><span class="cx">             KeyframeValueList filterVector(AnimatedPropertyWebkitFilter);
</span><del>-            filterVector.insert(new FilterAnimationValue(0, &amp;fromStyle-&gt;filter()));
-            filterVector.insert(new FilterAnimationValue(1, &amp;toStyle-&gt;filter()));
</del><ins>+            filterVector.insert(adoptPtr(new FilterAnimationValue(0, &amp;fromStyle-&gt;filter())));
+            filterVector.insert(adoptPtr(new FilterAnimationValue(1, &amp;toStyle-&gt;filter())));
</ins><span class="cx">             if (m_graphicsLayer-&gt;addAnimation(filterVector, IntSize(), filterAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitFilter), timeOffset)) {
</span><span class="cx">                 // To ensure that the correct filter is visible when the animation ends, also set the final filter.
</span><span class="cx">                 updateFilters(toStyle);
</span><del>-                didAnimateFilter = true;
</del><ins>+                didAnimate = true;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_FILTERS)
-    return didAnimateOpacity || didAnimateTransform || didAnimateFilter;
-#else
-    return didAnimateOpacity || didAnimateTransform;
-#endif
</del><ins>+    return didAnimate;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderLayerBacking::transitionPaused(double timeOffset, CSSPropertyID property)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (149660 => 149661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-07 04:15:05 UTC (rev 149660)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-07 04:31:35 UTC (rev 149661)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2013-05-06  Darin Adler  &lt;darin@apple.com&gt;
+
+        Use OwnPtr instead of deleteAllValues in KeyframeValueList
+        https://bugs.webkit.org/show_bug.cgi?id=115652
+
+        Reviewed by Simon Fraser.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
+        (CoreIPC::ArgumentCoder&lt;GraphicsLayerAnimation&gt;::decode): Added adoptPtr
+        next to new when calling KeyframeValueList::insert.
+
</ins><span class="cx"> 2013-05-06  Gyuyoung Kim  &lt;gyuyoung.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, build fix on EFL port
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp (149660 => 149661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2013-05-07 04:15:05 UTC (rev 149660)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2013-05-07 04:31:35 UTC (rev 149661)
</span><span class="lines">@@ -733,14 +733,14 @@
</span><span class="cx">             float value;
</span><span class="cx">             if (!decoder.decode(value))
</span><span class="cx">                 return false;
</span><del>-            keyframes.insert(new FloatAnimationValue(keyTime, value, timingFunction));
</del><ins>+            keyframes.insert(adoptPtr(new FloatAnimationValue(keyTime, value, timingFunction)));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case AnimatedPropertyWebkitTransform: {
</span><span class="cx">             TransformOperations transform;
</span><span class="cx">             if (!decoder.decode(transform))
</span><span class="cx">                 return false;
</span><del>-            keyframes.insert(new TransformAnimationValue(keyTime, &amp;transform, timingFunction));
</del><ins>+            keyframes.insert(adoptPtr(new TransformAnimationValue(keyTime, &amp;transform, timingFunction)));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="lines">@@ -748,7 +748,7 @@
</span><span class="cx">             FilterOperations filter;
</span><span class="cx">             if (!decoder.decode(filter))
</span><span class="cx">                 return false;
</span><del>-            keyframes.insert(new FilterAnimationValue(keyTime, &amp;filter, timingFunction));
</del><ins>+            keyframes.insert(adoptPtr(new FilterAnimationValue(keyTime, &amp;filter, timingFunction)));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>