Index: third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.h |
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.h b/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.h |
index f4c123e1897a78c2f3d7f2408fc66dcb95a7e80f..32a2a3bbb3765eec3462fd7f36d36c191f404b60 100644 |
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.h |
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.h |
@@ -29,6 +29,8 @@ |
#ifndef SVGImageChromeClient_h |
#define SVGImageChromeClient_h |
+#include "base/gtest_prod_util.h" |
+#include "core/CoreExport.h" |
#include "core/loader/EmptyClients.h" |
#include "platform/Timer.h" |
@@ -36,7 +38,7 @@ namespace blink { |
class SVGImage; |
-class SVGImageChromeClient final : public EmptyChromeClient { |
+class CORE_EXPORT SVGImageChromeClient final : public EmptyChromeClient { |
public: |
static SVGImageChromeClient* create(SVGImage*); |
@@ -44,6 +46,10 @@ public: |
SVGImage* image() const { return m_image; } |
+ void suspendAnimation(); |
+ void resumeAnimation(); |
+ bool isSuspended() const { return m_timelineState >= Suspended; } |
+ |
private: |
explicit SVGImageChromeClient(SVGImage*); |
@@ -51,10 +57,19 @@ private: |
void invalidateRect(const IntRect&) override; |
void scheduleAnimation(Widget*) override; |
+ void setTimer(Timer<SVGImageChromeClient>*); |
void animationTimerFired(Timer<SVGImageChromeClient>*); |
SVGImage* m_image; |
- Timer<SVGImageChromeClient> m_animationTimer; |
+ OwnPtr<Timer<SVGImageChromeClient>> m_animationTimer; |
+ enum { |
+ Running, |
+ Suspended, |
+ SuspendedWithAnimationPending, |
+ } m_timelineState; |
+ |
+ FRIEND_TEST_ALL_PREFIXES(SVGImageTest, TimelineSuspendAndResume); |
+ FRIEND_TEST_ALL_PREFIXES(SVGImageTest, ResetAnimation); |
}; |
DEFINE_TYPE_CASTS(SVGImageChromeClient, ChromeClient, client, client->isSVGImageChromeClient(), client.isSVGImageChromeClient()); |