Commit 1bde7545 authored by rjwright@chromium.org's avatar rjwright@chromium.org

Web Animation API: Add use counter for Animation constructors

DEPENDS ON: https://codereview.chromium.org/198693002/

BUG=352493,352490

Review URL: https://codereview.chromium.org/199743003

git-svn-id: svn://svn.chromium.org/blink/trunk@169721 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d0f18205
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "core/animation/Interpolation.h" #include "core/animation/Interpolation.h"
#include "core/animation/KeyframeEffectModel.h" #include "core/animation/KeyframeEffectModel.h"
#include "core/dom/Element.h" #include "core/dom/Element.h"
#include "core/frame/UseCounter.h"
#include "core/rendering/RenderLayer.h" #include "core/rendering/RenderLayer.h"
namespace WebCore { namespace WebCore {
...@@ -68,16 +69,19 @@ PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr ...@@ -68,16 +69,19 @@ PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr
PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionState& exceptionState) PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionState& exceptionState)
{ {
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInputDictionary)); return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInputDictionary));
} }
PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState) PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
{ {
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectDoubleTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration)); return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration));
} }
PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
{ {
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectNoTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), Timing()); return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), Timing());
} }
......
...@@ -314,6 +314,9 @@ public: ...@@ -314,6 +314,9 @@ public:
DocumentXPathEvaluate = 297, DocumentXPathEvaluate = 297,
AttrGetValue = 298, AttrGetValue = 298,
AttrSetValue = 299, AttrSetValue = 299,
AnimationConstructorKeyframeListEffectObjectTiming = 300,
AnimationConstructorKeyframeListEffectDoubleTiming = 301,
AnimationConstructorKeyframeListEffectNoTiming = 302,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
NumberOfFeatures, // This enum value must be last. NumberOfFeatures, // This enum value must be last.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment