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

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: Pass ownership of WebAnimation under ANIMATION_OWNERSHIP_NOT_TRANSFER guard. Created 7 years, 2 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
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | Source/core/rendering/CompositedLayerMapping.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
index ef861b82f2e566107b40d6b40b0298c9d336a07a..a854ce0ecad761461063a31b4ec116af488a2d78 100644
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ b/Source/core/platform/graphics/GraphicsLayer.cpp
@@ -1023,14 +1023,19 @@ 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);
+#if defined(ANIMATION_OWNERSHIP_NOT_TRANSFER)
jamesr 2013/10/15 21:14:05 there's no need to test for this macro in the Blin
dshwang 2013/10/16 11:40:05 I don't think so. If I changes it to "animation.le
+ return platformLayer()->addAnimation(animation.get());
+#else
+ return platformLayer()->addAnimation(animation.leakPtr());
+#endif
}
void GraphicsLayer::pauseAnimation(int animationId, double timeOffset)
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | Source/core/rendering/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698