diff --git a/api/units/time_delta.h b/api/units/time_delta.h index 0d88f0ea72..173affcc56 100644 --- a/api/units/time_delta.h +++ b/api/units/time_delta.h @@ -50,35 +50,6 @@ class TimeDelta final : public rtc_units_impl::RelativeUnit { TimeDelta() = delete; - // TODO(danilchap): Migrate all code to the 3 factories above and delete the - // 6 factories below. - template - static constexpr TimeDelta Seconds() { - return FromFraction(1'000'000, seconds); - } - template - static constexpr TimeDelta Millis() { - return FromFraction(1000, ms); - } - template - static constexpr TimeDelta Micros() { - return FromValue(us); - } - template - static constexpr TimeDelta seconds(T seconds) { - static_assert(std::is_arithmetic::value, ""); - return FromFraction(1'000'000, seconds); - } - template - static constexpr TimeDelta ms(T milliseconds) { - static_assert(std::is_arithmetic::value, ""); - return FromFraction(1000, milliseconds); - } - template - static constexpr TimeDelta us(T microseconds) { - static_assert(std::is_arithmetic::value, ""); - return FromValue(microseconds); - } template constexpr T seconds() const { return ToFraction<1000000, T>(); diff --git a/api/units/timestamp.h b/api/units/timestamp.h index 75a6ff88ef..f83477e808 100644 --- a/api/units/timestamp.h +++ b/api/units/timestamp.h @@ -46,36 +46,6 @@ class Timestamp final : public rtc_units_impl::UnitBase { Timestamp() = delete; - // TODO(danilchap): Migrate all code to the 3 factories above and delete the - // 6 factories below. - template - static constexpr Timestamp Seconds() { - return FromFraction(1'000'000, seconds); - } - template - static constexpr Timestamp Millis() { - return FromFraction(1000, ms); - } - template - static constexpr Timestamp Micros() { - return FromValue(us); - } - - template - static constexpr Timestamp seconds(T seconds) { - static_assert(std::is_arithmetic::value, ""); - return FromFraction(1'000'000, seconds); - } - template - static constexpr Timestamp ms(T milliseconds) { - static_assert(std::is_arithmetic::value, ""); - return FromFraction(1000, milliseconds); - } - template - static constexpr Timestamp us(T microseconds) { - static_assert(std::is_arithmetic::value, ""); - return FromValue(microseconds); - } template constexpr T seconds() const { return ToFraction<1000000, T>(); diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc index 2a35de7426..77305de6dd 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc @@ -299,10 +299,10 @@ TEST_F(GoogCcNetworkControllerTest, auto send_net = s.CreateMutableSimulationNode([=](NetworkSimulationConfig* c) { c->bandwidth = DataRate::kbps(1000); - c->delay = TimeDelta::ms(100); + c->delay = TimeDelta::Millis(100); }); auto ret_net = s.CreateSimulationNode( - [](NetworkSimulationConfig* c) { c->delay = TimeDelta::ms(100); }); + [](NetworkSimulationConfig* c) { c->delay = TimeDelta::Millis(100); }); CallClientConfig config; config.transport.cc_factory = &factory; // Start high so bandwidth drop has max effect. @@ -313,9 +313,9 @@ TEST_F(GoogCcNetworkControllerTest, auto* client = CreateVideoSendingClient(&s, std::move(config), {send_net->node()}, {ret_net}); - s.RunFor(TimeDelta::seconds(10)); - send_net->PauseTransmissionUntil(s.Now() + TimeDelta::seconds(10)); - s.RunFor(TimeDelta::seconds(3)); + s.RunFor(TimeDelta::Seconds(10)); + send_net->PauseTransmissionUntil(s.Now() + TimeDelta::Seconds(10)); + s.RunFor(TimeDelta::Seconds(3)); // As the dropframe is set, after 3 seconds without feedback from any sent // packets, we expect that the target rate is not reduced by congestion