| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 | 687 |
| 688 void RelayServerBinding::AddInternalConnection(RelayServerConnection* conn) { | 688 void RelayServerBinding::AddInternalConnection(RelayServerConnection* conn) { |
| 689 internal_connections_.push_back(conn); | 689 internal_connections_.push_back(conn); |
| 690 } | 690 } |
| 691 | 691 |
| 692 void RelayServerBinding::AddExternalConnection(RelayServerConnection* conn) { | 692 void RelayServerBinding::AddExternalConnection(RelayServerConnection* conn) { |
| 693 external_connections_.push_back(conn); | 693 external_connections_.push_back(conn); |
| 694 } | 694 } |
| 695 | 695 |
| 696 void RelayServerBinding::NoteUsed() { | 696 void RelayServerBinding::NoteUsed() { |
| 697 last_used_ = rtc::Time64(); | 697 last_used_ = rtc::TimeMillis(); |
| 698 } | 698 } |
| 699 | 699 |
| 700 bool RelayServerBinding::HasMagicCookie(const char* bytes, size_t size) const { | 700 bool RelayServerBinding::HasMagicCookie(const char* bytes, size_t size) const { |
| 701 if (size < 24 + magic_cookie_.size()) { | 701 if (size < 24 + magic_cookie_.size()) { |
| 702 return false; | 702 return false; |
| 703 } else { | 703 } else { |
| 704 return memcmp(bytes + 24, magic_cookie_.c_str(), magic_cookie_.size()) == 0; | 704 return memcmp(bytes + 24, magic_cookie_.c_str(), magic_cookie_.size()) == 0; |
| 705 } | 705 } |
| 706 } | 706 } |
| 707 | 707 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 728 } | 728 } |
| 729 return 0; | 729 return 0; |
| 730 } | 730 } |
| 731 | 731 |
| 732 void RelayServerBinding::OnMessage(rtc::Message *pmsg) { | 732 void RelayServerBinding::OnMessage(rtc::Message *pmsg) { |
| 733 if (pmsg->message_id == MSG_LIFETIME_TIMER) { | 733 if (pmsg->message_id == MSG_LIFETIME_TIMER) { |
| 734 ASSERT(!pmsg->pdata); | 734 ASSERT(!pmsg->pdata); |
| 735 | 735 |
| 736 // If the lifetime timeout has been exceeded, then send a signal. | 736 // If the lifetime timeout has been exceeded, then send a signal. |
| 737 // Otherwise, just keep waiting. | 737 // Otherwise, just keep waiting. |
| 738 if (rtc::Time64() >= last_used_ + lifetime_) { | 738 if (rtc::TimeMillis() >= last_used_ + lifetime_) { |
| 739 LOG(LS_INFO) << "Expiring binding " << username_; | 739 LOG(LS_INFO) << "Expiring binding " << username_; |
| 740 SignalTimeout(this); | 740 SignalTimeout(this); |
| 741 } else { | 741 } else { |
| 742 server_->thread()->PostDelayed(lifetime_, this, MSG_LIFETIME_TIMER); | 742 server_->thread()->PostDelayed(lifetime_, this, MSG_LIFETIME_TIMER); |
| 743 } | 743 } |
| 744 | 744 |
| 745 } else { | 745 } else { |
| 746 ASSERT(false); | 746 ASSERT(false); |
| 747 } | 747 } |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace cricket | 750 } // namespace cricket |
| OLD | NEW |