| 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.
|
|
|
|
|