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:
committed by
Commit Bot
parent
6799d732d5
commit
ea820932d8
@ -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>();
|
||||
|
||||
@ -46,36 +46,6 @@ class Timestamp final : public rtc_units_impl::UnitBase<Timestamp> {
|
||||
|
||||
Timestamp() = delete;
|
||||
|
||||
// TODO(danilchap): Migrate all code to the 3 factories above and delete the
|
||||
// 6 factories below.
|
||||
template <int64_t seconds>
|
||||
static constexpr Timestamp Seconds() {
|
||||
return FromFraction(1'000'000, seconds);
|
||||
}
|
||||
template <int64_t ms>
|
||||
static constexpr Timestamp Millis() {
|
||||
return FromFraction(1000, ms);
|
||||
}
|
||||
template <int64_t us>
|
||||
static constexpr Timestamp Micros() {
|
||||
return FromValue(us);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static constexpr Timestamp seconds(T seconds) {
|
||||
static_assert(std::is_arithmetic<T>::value, "");
|
||||
return FromFraction(1'000'000, seconds);
|
||||
}
|
||||
template <typename T>
|
||||
static constexpr Timestamp ms(T milliseconds) {
|
||||
static_assert(std::is_arithmetic<T>::value, "");
|
||||
return FromFraction(1000, milliseconds);
|
||||
}
|
||||
template <typename T>
|
||||
static constexpr Timestamp 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>();
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user