| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 std::unique_ptr<buzz::XmlElement> stanza( | 70 std::unique_ptr<buzz::XmlElement> stanza( |
| 71 MakeIq(buzz::STR_GET, Jid(STR_EMPTY), task_id())); | 71 MakeIq(buzz::STR_GET, Jid(STR_EMPTY), task_id())); |
| 72 stanza->AddElement(new buzz::XmlElement(QN_PING)); | 72 stanza->AddElement(new buzz::XmlElement(QN_PING)); |
| 73 SendStanza(stanza.get()); | 73 SendStanza(stanza.get()); |
| 74 | 74 |
| 75 ping_response_deadline_ = now + ping_timeout_millis_; | 75 ping_response_deadline_ = now + ping_timeout_millis_; |
| 76 next_ping_time_ = now + ping_period_millis_; | 76 next_ping_time_ = now + ping_period_millis_; |
| 77 | 77 |
| 78 // Wake ourselves up when it's time to send another ping or when the ping | 78 // Wake ourselves up when it's time to send another ping or when the ping |
| 79 // times out (so we can fire a signal). | 79 // times out (so we can fire a signal). |
| 80 message_queue_->PostDelayed(ping_timeout_millis_, this); | 80 message_queue_->PostDelayed(RTC_FROM_HERE, ping_timeout_millis_, this); |
| 81 message_queue_->PostDelayed(ping_period_millis_, this); | 81 message_queue_->PostDelayed(RTC_FROM_HERE, ping_period_millis_, this); |
| 82 } | 82 } |
| 83 | 83 |
| 84 return STATE_BLOCKED; | 84 return STATE_BLOCKED; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void PingTask::OnMessage(rtc::Message* msg) { | 87 void PingTask::OnMessage(rtc::Message* msg) { |
| 88 // Get the task manager to run this task so we can send a ping or signal or | 88 // Get the task manager to run this task so we can send a ping or signal or |
| 89 // process a ping response. | 89 // process a ping response. |
| 90 Wake(); | 90 Wake(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace buzz | 93 } // namespace buzz |
| OLD | NEW |