Delete legacy TimeDelta and Timestamp factories

Bug: webrtc:9709
Change-Id: Ic294a6dc324fde06d868a3d00941b0f2fc970935
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168490
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30510}
This commit is contained in:
Danil Chapovalov
2020-02-12 10:27:44 +01:00
committed by Commit Bot
parent 6799d732d5
commit ea820932d8
3 changed files with 5 additions and 64 deletions

View File

@ -50,35 +50,6 @@ class TimeDelta final : public rtc_units_impl::RelativeUnit<TimeDelta> {
TimeDelta() = delete;
// TODO(danilchap): Migrate all code to the 3 factories above and delete the
// 6 factories below.
template <int64_t seconds>
static constexpr TimeDelta Seconds() {
return FromFraction(1'000'000, seconds);
}
template <int64_t ms>
static constexpr TimeDelta Millis() {
return FromFraction(1000, ms);
}
template <int64_t us>
static constexpr TimeDelta Micros() {
return FromValue(us);
}
template <typename T>
static constexpr TimeDelta seconds(T seconds) {
static_assert(std::is_arithmetic<T>::value, "");
return FromFraction(1'000'000, seconds);
}
template <typename T>
static constexpr TimeDelta ms(T milliseconds) {
static_assert(std::is_arithmetic<T>::value, "");
return FromFraction(1000, milliseconds);
}
template <typename T>
static constexpr TimeDelta us(T microseconds) {
static_assert(std::is_arithmetic<T>::value, "");
return FromValue(microseconds);
}
template <typename T = int64_t>
constexpr T seconds() const {
return ToFraction<1000000, T>();