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

Unified Diff: public/platform/WebFrameTime.h

Issue 369793003: Make the web-animations engine use the passed in blink::WebFrameTime values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing the tests under the release build. Created 6 years, 5 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: public/platform/WebFrameTime.h
diff --git a/public/platform/WebFrameTime.h b/public/platform/WebFrameTime.h
index 1050291c23f3db6177e84cc5bb3a7aa9feec7b15..b344149d1441de86b2188f31d73f1d9d03c949a0 100644
--- a/public/platform/WebFrameTime.h
+++ b/public/platform/WebFrameTime.h
@@ -36,6 +36,22 @@
namespace blink {
struct WebFrameTime {
+ // Before C++0x we can't define a static const member with floating point
+ // value so are forced to use a function here. When we can use C++0x
+ // replace this with (for better performance);
+ // static constexpr double Undefined() { return -1.0 };
+ inline static const double Undefined()
+ {
+ return -1;
+ }
+
+ WebFrameTime()
+ : lastFrameTime(Undefined())
+ , renderDeadline(Undefined())
+ , displayFrameTime(Undefined())
+ , predictedNextDisplayFrameTime(Undefined())
+ { }
+
WebFrameTime(double lastFrameTime, double renderDeadline, double displayFrameTime, double predictedNextDisplayFrameTime)
: lastFrameTime(lastFrameTime)
, renderDeadline(renderDeadline)
@@ -43,6 +59,15 @@ struct WebFrameTime {
, predictedNextDisplayFrameTime(predictedNextDisplayFrameTime)
{ }
+ bool isNull() const
+ {
+ return (
+ lastFrameTime == Undefined()
+ && renderDeadline == Undefined()
+ && displayFrameTime == Undefined()
+ && predictedNextDisplayFrameTime == Undefined());
+ }
+
// FIXME(mithro): Upgrade the time in CLOCK_MONOTONIC values to use a
// TimeTick like class rather than a bare double.
« Source/core/dom/ScriptedAnimationController.cpp ('K') | « Source/web/PageWidgetDelegate.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698