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

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

Issue 23455058: WIP: WebLayer::addAnimation should transfer the ownership of WebAnimation instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve WebPassOwnPtr so that it is hard to make a mistake. 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 4668d5eb9c5515b171e04915c2b7bdbdb7715966..c0fc459d0c308e8e260a75e79ae393dc7d1babc9 100644
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ b/Source/core/platform/graphics/GraphicsLayer.cpp
@@ -1021,14 +1021,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.release());
}
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