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

Unified Diff: webrtc/p2p/base/relayserver.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/relayserver.h ('k') | webrtc/p2p/base/stunport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/relayserver.cc
diff --git a/webrtc/p2p/base/relayserver.cc b/webrtc/p2p/base/relayserver.cc
index e208d70d0f2902325ca1a367fb1d38a69c5ce1c1..aad0070d345a190bde89f9fbdd1b0c735491806c 100644
--- a/webrtc/p2p/base/relayserver.cc
+++ b/webrtc/p2p/base/relayserver.cc
@@ -355,11 +355,12 @@ void RelayServer::HandleStunAllocate(
// else-branch will then disappear.
// Compute the appropriate lifetime for this binding.
- uint32_t lifetime = MAX_LIFETIME;
+ int lifetime = MAX_LIFETIME;
const StunUInt32Attribute* lifetime_attr =
request.GetUInt32(STUN_ATTR_LIFETIME);
if (lifetime_attr)
- lifetime = std::min(lifetime, lifetime_attr->value() * 1000);
+ lifetime =
+ std::min(lifetime, static_cast<int>(lifetime_attr->value() * 1000));
binding = new RelayServerBinding(this, username, "0", lifetime);
binding->SignalTimeout.connect(this, &RelayServer::OnTimeout);
@@ -653,7 +654,7 @@ const uint32_t MSG_LIFETIME_TIMER = 1;
RelayServerBinding::RelayServerBinding(RelayServer* server,
const std::string& username,
const std::string& password,
- uint32_t lifetime)
+ int lifetime)
: server_(server),
username_(username),
password_(password),
@@ -693,7 +694,7 @@ void RelayServerBinding::AddExternalConnection(RelayServerConnection* conn) {
}
void RelayServerBinding::NoteUsed() {
- last_used_ = rtc::Time();
+ last_used_ = rtc::Time64();
}
bool RelayServerBinding::HasMagicCookie(const char* bytes, size_t size) const {
@@ -734,7 +735,7 @@ void RelayServerBinding::OnMessage(rtc::Message *pmsg) {
// If the lifetime timeout has been exceeded, then send a signal.
// Otherwise, just keep waiting.
- if (rtc::Time() >= last_used_ + lifetime_) {
+ if (rtc::Time64() >= last_used_ + lifetime_) {
LOG(LS_INFO) << "Expiring binding " << username_;
SignalTimeout(this);
} else {
« no previous file with comments | « webrtc/p2p/base/relayserver.h ('k') | webrtc/p2p/base/stunport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698