Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: Source/core/platform/graphics/GraphicsLayer.cpp

Issue 23834010: Change WebLayer::addAnimation to transfer ownership of WebAnimation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change GraphicsLayer and LinkHighlight to clarify ownership transfer Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
index 0c4d346a14f02a95b2fd6aae584791b0188114b4..b5a7900e6ce4bff5edbf90fac681bdca2b2458c4 100644
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ b/Source/core/platform/graphics/GraphicsLayer.cpp
@@ -969,14 +969,15 @@ void GraphicsLayer::setContentsToMedia(WebLayer* layer)
setContentsTo(ContentsLayerForVideo, layer);
}
-bool GraphicsLayer::addAnimation(WebAnimation* animation)
+bool GraphicsLayer::addAnimation(PassOwnPtr<WebAnimation> popAnimation)
{
+ OwnPtr<WebAnimation> animation(popAnimation);
ASSERT(animation);
platformLayer()->setAnimationDelegate(this);
// Remove any existing animations with the same animation id and target property.
platformLayer()->removeAnimation(animation->id(), animation->targetProperty());
- return platformLayer()->addAnimation(animation);
+ return platformLayer()->addAnimation(animation.get());
jamesr 2013/09/20 18:52:14 you need to leakPtr() here, right? otherwise ~OwnP
dshwang 2013/09/20 19:03:58 WebLayerImpl does not delete a WebAnimation instan
}
void GraphicsLayer::pauseAnimation(int animationId, double timeOffset)

Powered by Google App Engine
This is Rietveld 408576698