Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1793553002: Using 64-bit timestamp in webrtc/p2p (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index cdfcf956434723436a355032f3704f53b755de74..759fd461db20f4fd67f52a7575ed359a4dec2b18 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -1027,7 +1027,7 @@ rtc::DiffServCodePoint P2PTransportChannel::DefaultDscpValue() const {
// Monitor connection states.
void P2PTransportChannel::UpdateConnectionStates() {
- uint32_t now = rtc::Time();
+ int64_t now = rtc::Time64();
// We need to copy the list of connections since some may delete themselves
// when we call UpdateState.
@@ -1260,7 +1260,7 @@ void P2PTransportChannel::OnCheckAndPing() {
// When the best connection is either not receiving or not writable,
// switch to weak ping interval.
int ping_interval = weak() ? weak_ping_interval_ : STRONG_PING_INTERVAL;
- if (rtc::Time() >= last_ping_sent_ms_ + ping_interval) {
+ if (rtc::Time64() >= last_ping_sent_ms_ + ping_interval) {
Connection* conn = FindNextPingableConnection();
if (conn) {
PingConnection(conn);
@@ -1281,7 +1281,7 @@ bool P2PTransportChannel::IsBackupConnection(Connection* conn) const {
// Is the connection in a state for us to even consider pinging the other side?
// We consider a connection pingable even if it's not connected because that's
// how a TCP connection is kicked into reconnecting on the active side.
-bool P2PTransportChannel::IsPingable(Connection* conn, uint32_t now) {
+bool P2PTransportChannel::IsPingable(Connection* conn, int64_t now) {
const Candidate& remote = conn->remote_candidate();
// We should never get this far with an empty remote ufrag.
ASSERT(!remote.username().empty());
@@ -1319,7 +1319,7 @@ bool P2PTransportChannel::IsPingable(Connection* conn, uint32_t now) {
// ping target to become writable instead. See the big comment in
// CompareConnections.
Connection* P2PTransportChannel::FindNextPingableConnection() {
- uint32_t now = rtc::Time();
+ int64_t now = rtc::Time64();
Connection* conn_to_ping = nullptr;
if (best_connection_ && best_connection_->connected() &&
best_connection_->writable() &&
@@ -1360,7 +1360,7 @@ void P2PTransportChannel::PingConnection(Connection* conn) {
use_candidate = best_connection_->writable();
}
conn->set_use_candidate_attr(use_candidate);
- last_ping_sent_ms_ = rtc::Time();
+ last_ping_sent_ms_ = rtc::Time64();
conn->Ping(last_ping_sent_ms_);
}
@@ -1508,7 +1508,7 @@ void P2PTransportChannel::OnReadyToSend(Connection* connection) {
// (last_received_ping > last_sent_ping). But we shouldn't do
// triggered checks if the connection is already writable.
Connection* P2PTransportChannel::FindOldestConnectionNeedingTriggeredCheck(
- uint32_t now) {
+ int64_t now) {
Connection* oldest_needing_triggered_check = nullptr;
for (auto conn : connections_) {
if (!IsPingable(conn, now)) {
@@ -1532,7 +1532,7 @@ Connection* P2PTransportChannel::FindOldestConnectionNeedingTriggeredCheck(
return oldest_needing_triggered_check;
}
-Connection* P2PTransportChannel::FindConnectionToPing(uint32_t now) {
+Connection* P2PTransportChannel::FindConnectionToPing(int64_t now) {
RTC_CHECK(connections_.size() ==
pinged_connections_.size() + unpinged_connections_.size());
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698