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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 lifetime_(lifetime) { | 661 lifetime_(lifetime) { |
662 // For now, every connection uses the standard magic cookie value. | 662 // For now, every connection uses the standard magic cookie value. |
663 magic_cookie_.append( | 663 magic_cookie_.append( |
664 reinterpret_cast<const char*>(TURN_MAGIC_COOKIE_VALUE), | 664 reinterpret_cast<const char*>(TURN_MAGIC_COOKIE_VALUE), |
665 sizeof(TURN_MAGIC_COOKIE_VALUE)); | 665 sizeof(TURN_MAGIC_COOKIE_VALUE)); |
666 | 666 |
667 // Initialize the last-used time to now. | 667 // Initialize the last-used time to now. |
668 NoteUsed(); | 668 NoteUsed(); |
669 | 669 |
670 // Set the first timeout check. | 670 // Set the first timeout check. |
671 server_->thread()->PostDelayed(lifetime_, this, MSG_LIFETIME_TIMER); | 671 server_->thread()->PostDelayed(RTC_FROM_HERE, lifetime_, this, |
| 672 MSG_LIFETIME_TIMER); |
672 } | 673 } |
673 | 674 |
674 RelayServerBinding::~RelayServerBinding() { | 675 RelayServerBinding::~RelayServerBinding() { |
675 // Clear the outstanding timeout check. | 676 // Clear the outstanding timeout check. |
676 server_->thread()->Clear(this); | 677 server_->thread()->Clear(this); |
677 | 678 |
678 // Clean up all of the connections. | 679 // Clean up all of the connections. |
679 for (size_t i = 0; i < internal_connections_.size(); ++i) | 680 for (size_t i = 0; i < internal_connections_.size(); ++i) |
680 delete internal_connections_[i]; | 681 delete internal_connections_[i]; |
681 for (size_t i = 0; i < external_connections_.size(); ++i) | 682 for (size_t i = 0; i < external_connections_.size(); ++i) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 void RelayServerBinding::OnMessage(rtc::Message *pmsg) { | 733 void RelayServerBinding::OnMessage(rtc::Message *pmsg) { |
733 if (pmsg->message_id == MSG_LIFETIME_TIMER) { | 734 if (pmsg->message_id == MSG_LIFETIME_TIMER) { |
734 ASSERT(!pmsg->pdata); | 735 ASSERT(!pmsg->pdata); |
735 | 736 |
736 // If the lifetime timeout has been exceeded, then send a signal. | 737 // If the lifetime timeout has been exceeded, then send a signal. |
737 // Otherwise, just keep waiting. | 738 // Otherwise, just keep waiting. |
738 if (rtc::TimeMillis() >= last_used_ + lifetime_) { | 739 if (rtc::TimeMillis() >= last_used_ + lifetime_) { |
739 LOG(LS_INFO) << "Expiring binding " << username_; | 740 LOG(LS_INFO) << "Expiring binding " << username_; |
740 SignalTimeout(this); | 741 SignalTimeout(this); |
741 } else { | 742 } else { |
742 server_->thread()->PostDelayed(lifetime_, this, MSG_LIFETIME_TIMER); | 743 server_->thread()->PostDelayed(RTC_FROM_HERE, lifetime_, this, |
| 744 MSG_LIFETIME_TIMER); |
743 } | 745 } |
744 | 746 |
745 } else { | 747 } else { |
746 ASSERT(false); | 748 ASSERT(false); |
747 } | 749 } |
748 } | 750 } |
749 | 751 |
750 } // namespace cricket | 752 } // namespace cricket |
OLD | NEW |