diff options
author | Sebastian Jansson <srte@webrtc.org> | 2018-05-08 14:52:22 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-05-08 13:22:53 +0000 |
commit | 5f83cf0c6d842352d8e017321f0223aefebb1bef (patch) | |
tree | 3a82358adf0e282e0c0de4c58ab85c22a0d1409e /pc | |
parent | 5b2b692079e65be33998e6b8e7e7b7efce3cf9bf (diff) | |
download | webrtc-5f83cf0c6d842352d8e017321f0223aefebb1bef.tar.gz |
Replacing rtc::TimeDelta with webrtc::TimeDelta.
This removes the redundant type and replaces all usages. A slight change
in behavior is that we no longer get nanosecond resolution. This should
not matter since no current code requires nanosecond resolution.
Bug: webrtc:9155
Change-Id: I04334e08c686d95731621a6c8a7e40400d0ae3b2
Reviewed-on: https://webrtc-review.googlesource.com/71163
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23174}
Diffstat (limited to 'pc')
-rw-r--r-- | pc/BUILD.gn | 1 | ||||
-rw-r--r-- | pc/peerconnection_integrationtest.cc | 4 | ||||
-rw-r--r-- | pc/rtcstatscollector_unittest.cc | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 3f00dfaed4..7eee652411 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -485,6 +485,7 @@ if (rtc_include_tests) { ":rtc_pc_base", "../api:libjingle_peerconnection_api", "../api:mock_rtp", + "../api/units:time_delta", "../rtc_base:checks", "../rtc_base:stringutils", "../test:fileutils", diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc index c3a41e4d11..6616243ac1 100644 --- a/pc/peerconnection_integrationtest.cc +++ b/pc/peerconnection_integrationtest.cc @@ -2910,7 +2910,7 @@ TEST_P(PeerConnectionIntegrationTest, // Some things use a time of "0" as a special value, so we need to start out // the fake clock at a nonzero time. // TODO(deadbeef): Fix this. - fake_clock.AdvanceTime(rtc::TimeDelta::FromSeconds(1)); + fake_clock.AdvanceTime(webrtc::TimeDelta::seconds(1)); virtual_socket_server()->set_delay_mean(5); // 5 ms per hop. virtual_socket_server()->UpdateDelayDistribution(); @@ -3786,7 +3786,7 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndConnectionTimeWithTurnTurnPair) { // Some things use a time of "0" as a special value, so we need to start out // the fake clock at a nonzero time. // TODO(deadbeef): Fix this. - fake_clock.AdvanceTime(rtc::TimeDelta::FromSeconds(1)); + fake_clock.AdvanceTime(webrtc::TimeDelta::seconds(1)); static constexpr int media_hop_delay_ms = 50; static constexpr int signaling_trip_delay_ms = 500; diff --git a/pc/rtcstatscollector_unittest.cc b/pc/rtcstatscollector_unittest.cc index f27e953b56..08fa41537a 100644 --- a/pc/rtcstatscollector_unittest.cc +++ b/pc/rtcstatscollector_unittest.cc @@ -18,6 +18,7 @@ #include "api/rtpparameters.h" #include "api/stats/rtcstats_objects.h" #include "api/stats/rtcstatsreport.h" +#include "api/units/time_delta.h" #include "p2p/base/p2pconstants.h" #include "p2p/base/port.h" #include "pc/mediastream.h" @@ -35,7 +36,6 @@ #include "rtc_base/logging.h" #include "rtc_base/ptr_util.h" #include "rtc_base/stringutils.h" -#include "rtc_base/timedelta.h" #include "rtc_base/timeutils.h" using testing::AtLeast; @@ -670,7 +670,7 @@ TEST_F(RTCStatsCollectorTest, CachedStatsReports) { rtc::scoped_refptr<const RTCStatsReport> c = stats_->GetStatsReport(); EXPECT_NE(b.get(), c.get()); // Invalidate cache by advancing time. - fake_clock_.AdvanceTime(rtc::TimeDelta::FromMilliseconds(51)); + fake_clock_.AdvanceTime(TimeDelta::ms(51)); rtc::scoped_refptr<const RTCStatsReport> d = stats_->GetStatsReport(); EXPECT_TRUE(d); EXPECT_NE(c.get(), d.get()); @@ -681,7 +681,7 @@ TEST_F(RTCStatsCollectorTest, MultipleCallbacksWithInvalidatedCacheInBetween) { stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&a)); stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&b)); // Cache is invalidated after 50 ms. - fake_clock_.AdvanceTime(rtc::TimeDelta::FromMilliseconds(51)); + fake_clock_.AdvanceTime(TimeDelta::ms(51)); stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&c)); EXPECT_TRUE_WAIT(a, kGetStatsReportTimeoutMs); EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs); |