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

Unified Diff: third_party/WebKit/Source/core/animation/TimingInput.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
« no previous file with comments | « third_party/WebKit/Source/core/animation/TimingInput.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/TimingInput.cpp
diff --git a/third_party/WebKit/Source/core/animation/TimingInput.cpp b/third_party/WebKit/Source/core/animation/TimingInput.cpp
index b15aa440ea86fb2397569360b32b12d47c2a1333..51b438a7b726a89c674038dfc5a9ed75e8e2aba1 100644
--- a/third_party/WebKit/Source/core/animation/TimingInput.cpp
+++ b/third_party/WebKit/Source/core/animation/TimingInput.cpp
@@ -5,6 +5,7 @@
#include "core/animation/TimingInput.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/UnrestrictedDoubleOrKeyframeEffectOptions.h"
#include "core/animation/AnimationInputHelpers.h"
#include "core/animation/KeyframeEffectOptions.h"
@@ -119,6 +120,24 @@ bool TimingInput::SetTimingFunction(Timing& timing,
return false;
}
+bool TimingInput::Convert(
+ const UnrestrictedDoubleOrKeyframeEffectOptions& options,
+ Timing& timing_output,
+ Document* document,
+ ExceptionState& exception_state) {
+ if (options.isKeyframeEffectOptions()) {
+ return Convert(options.getAsKeyframeEffectOptions(), timing_output,
+ document, exception_state);
+ } else if (options.isUnrestrictedDouble()) {
+ return Convert(options.getAsUnrestrictedDouble(), timing_output,
+ exception_state);
+ } else if (options.isNull()) {
+ return true;
+ }
+ NOTREACHED();
+ return false;
+}
+
bool TimingInput::Convert(const KeyframeEffectOptions& timing_input,
Timing& timing_output,
Document* document,
« no previous file with comments | « third_party/WebKit/Source/core/animation/TimingInput.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698