| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 static const double animationFrameDelay = 0.025; | 39 static const double animationFrameDelay = 0.025; |
| 40 | 40 |
| 41 SVGImageChromeClient::SVGImageChromeClient(SVGImage* image) | 41 SVGImageChromeClient::SVGImageChromeClient(SVGImage* image) |
| 42 : m_image(image) | 42 : m_image(image) |
| 43 , m_animationTimer(this, &SVGImageChromeClient::animationTimerFired) | 43 , m_animationTimer(this, &SVGImageChromeClient::animationTimerFired) |
| 44 { | 44 { |
| 45 } | 45 } |
| 46 | 46 |
| 47 PassOwnPtrWillBeRawPtr<SVGImageChromeClient> SVGImageChromeClient::create(SVGIma
ge* image) | 47 RawPtr<SVGImageChromeClient> SVGImageChromeClient::create(SVGImage* image) |
| 48 { | 48 { |
| 49 return adoptPtrWillBeNoop(new SVGImageChromeClient(image)); | 49 return new SVGImageChromeClient(image); |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool SVGImageChromeClient::isSVGImageChromeClient() const | 52 bool SVGImageChromeClient::isSVGImageChromeClient() const |
| 53 { | 53 { |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SVGImageChromeClient::chromeDestroyed() | 57 void SVGImageChromeClient::chromeDestroyed() |
| 58 { | 58 { |
| 59 m_image = nullptr; | 59 m_image = nullptr; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 return; | 99 return; |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG | 102 // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG |
| 103 // images can't have any so we assert there's no script. | 103 // images can't have any so we assert there's no script. |
| 104 ScriptForbiddenScope forbidScript; | 104 ScriptForbiddenScope forbidScript; |
| 105 | 105 |
| 106 // The calls below may trigger GCs, so set up the required persistent | 106 // The calls below may trigger GCs, so set up the required persistent |
| 107 // reference on the ImageResource which owns this SVGImage. By transitivity, | 107 // reference on the ImageResource which owns this SVGImage. By transitivity, |
| 108 // that will keep this SVGImageChromeClient object alive. | 108 // that will keep this SVGImageChromeClient object alive. |
| 109 RawPtrWillBePersistent<ImageObserver> protect(m_image->getImageObserver()); | 109 Persistent<ImageObserver> protect(m_image->getImageObserver()); |
| 110 m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonic
allyIncreasingTime()); | 110 m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonic
allyIncreasingTime()); |
| 111 m_image->frameView()->updateAllLifecyclePhases(); | 111 m_image->frameView()->updateAllLifecyclePhases(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| OLD | NEW |