[WTF] Annotate Seconds' member functions and operators with constexpr
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Apr 2017 02:41:04 +0000 (02:41 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Apr 2017 02:41:04 +0000 (02:41 +0000)
commit46594a283ee7883b0cc7eda0ac68bdf27777638c
treeb47e71e69fae1a0a76bcd8f0428600c95ad44735
parente9efb728a377264acbebaf5829af4294d027d247
[WTF] Annotate Seconds' member functions and operators with constexpr
https://bugs.webkit.org/show_bug.cgi?id=170662

Reviewed by Daniel Bates.

Source/WebCore:

* page/Frame.cpp:

Source/WTF:

Annotate Seconds' member functions and operators with constexpr.
It allows us to use Seconds calculation in compile time and use these
calculation for static const global variables.

operator% is an exception: it uses fmod and it is not offered as constexpr.

* wtf/MathExtras.h:
(defaultMinimumForClamp):
(defaultMaximumForClamp):
(clampToAccepting64):
Super unfortunate ugly code. This is because GCC 4.9 does not support C++14 relaxed constexpr.

* wtf/Seconds.h:
(WTF::Seconds::Seconds):
(WTF::Seconds::value):
(WTF::Seconds::minutes):
(WTF::Seconds::seconds):
(WTF::Seconds::milliseconds):
(WTF::Seconds::microseconds):
(WTF::Seconds::nanoseconds):
(WTF::Seconds::operator bool):
(WTF::Seconds::operator+):
(WTF::Seconds::operator-):
(WTF::Seconds::operator*):
(WTF::Seconds::operator/):
(WTF::Seconds::operator==):
(WTF::Seconds::operator!=):
(WTF::Seconds::operator<):
(WTF::Seconds::operator>):
(WTF::Seconds::operator<=):
(WTF::Seconds::operator>=):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/MathExtras.h
Source/WTF/wtf/Seconds.h
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.cpp