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

Unified Diff: third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp

Issue 2814523002: Web Animations: Coalesce constructors where possible. (Closed)
Patch Set: Rebase Created 3 years, 8 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
Index: third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
index d80a7e4bc70e1e168acb3d2b62946e51100ffd94..48cb0bae924187b09de9fed4b76bac518cd9a4a4 100644
--- a/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
+++ b/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
@@ -6,6 +6,7 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/UnrestrictedDoubleOrKeyframeEffectOptions.h"
#include "core/animation/Animation.h"
#include "core/animation/CompositorAnimations.h"
#include "core/animation/EffectInput.h"
@@ -38,28 +39,7 @@ KeyframeEffectReadOnly* KeyframeEffectReadOnly::Create(
ExecutionContext* execution_context,
Element* element,
const DictionarySequenceOrDictionary& effect_input,
- double duration,
- ExceptionState& exception_state) {
- DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
- if (element) {
- UseCounter::Count(
- element->GetDocument(),
- UseCounter::kAnimationConstructorKeyframeListEffectObjectTiming);
- }
- Timing timing;
- if (!TimingInput::Convert(duration, timing, exception_state))
- return nullptr;
- return Create(element,
- EffectInput::Convert(element, effect_input, execution_context,
- exception_state),
- timing);
-}
-
-KeyframeEffectReadOnly* KeyframeEffectReadOnly::Create(
- ExecutionContext* execution_context,
- Element* element,
- const DictionarySequenceOrDictionary& effect_input,
- const KeyframeEffectOptions& timing_input,
+ const UnrestrictedDoubleOrKeyframeEffectOptions& options,
ExceptionState& exception_state) {
DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element) {
@@ -69,7 +49,7 @@ KeyframeEffectReadOnly* KeyframeEffectReadOnly::Create(
}
Timing timing;
Document* document = element ? &element->GetDocument() : nullptr;
- if (!TimingInput::Convert(timing_input, timing, document, exception_state))
+ if (!TimingInput::Convert(options, timing, document, exception_state))
return nullptr;
return Create(element,
EffectInput::Convert(element, effect_input, execution_context,

Powered by Google App Engine
This is Rietveld 408576698