Bug 853398: Disable TimeDuration::operator* (double) using MOZ_DELETE. r=bz

This commit is contained in:
Avi Halachmi 2013-03-22 16:51:08 +01:00
parent fcf8395b70
commit c817d69e80

View File

@ -92,8 +92,15 @@ public:
mValue -= aOther.mValue;
return *this;
}
TimeDuration operator*(const double aMultiplier) const {
return TimeDuration::FromTicks(mValue * int64_t(aMultiplier));
private:
// Block double multiplier (slower, imprecise if long duration) - Bug 853398.
// If required, use MultDouble explicitly and with care.
TimeDuration operator*(const double aMultiplier) const MOZ_DELETE;
public:
TimeDuration MultDouble(double aMultiplier) const {
return TimeDuration::FromTicks(static_cast<int64_t>(mValue * aMultiplier));
}
TimeDuration operator*(const int32_t aMultiplier) const {
return TimeDuration::FromTicks(mValue * int64_t(aMultiplier));