| Index: third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp
|
| diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp
|
| index 808438d18b3f2b60fae56ea0b2412429c4fdf910..699d0891a16f1380983d9b815f7d6969b6f72907 100644
|
| --- a/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp
|
| +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp
|
| @@ -101,11 +101,17 @@ void SVGImageChromeClient::animationTimerFired(Timer<SVGImageChromeClient>*)
|
| // images can't have any so we assert there's no script.
|
| ScriptForbiddenScope forbidScript;
|
|
|
| - // The calls below may trigger GCs, so set up the required persistent
|
| - // reference on the ImageResource which owns this SVGImage. By transitivity,
|
| - // that will keep this SVGImageChromeClient object alive.
|
| - Persistent<ImageObserver> protect(m_image->getImageObserver());
|
| - m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonicallyIncreasingTime());
|
| + // The call below may trigger GCs, so set up the required reference
|
| + // to the ImageObserver (an ImageResource) which owns this SVGImage.
|
| + // By transitivity, that will keep this SVGImageChromeClient object alive.
|
| + //
|
| + // The update scope will additionally prevent the GCs from indirectly
|
| + // triggering animations reset over m_image should the ImageResource become
|
| + // otherwise unreferenced.
|
| + {
|
| + SVGImage::UpdateAnimationScope scope(m_image);
|
| + m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonicallyIncreasingTime());
|
| + }
|
| m_image->frameView()->updateAllLifecyclePhases();
|
| }
|
|
|
|
|