| 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 24 matching lines...) Expand all Loading... |
| 35 XmppThread::~XmppThread() { | 35 XmppThread::~XmppThread() { |
| 36 Stop(); | 36 Stop(); |
| 37 delete pump_; | 37 delete pump_; |
| 38 } | 38 } |
| 39 | 39 |
| 40 void XmppThread::ProcessMessages(int cms) { | 40 void XmppThread::ProcessMessages(int cms) { |
| 41 rtc::Thread::ProcessMessages(cms); | 41 rtc::Thread::ProcessMessages(cms); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void XmppThread::Login(const buzz::XmppClientSettings& xcs) { | 44 void XmppThread::Login(const buzz::XmppClientSettings& xcs) { |
| 45 Post(this, MSG_LOGIN, new LoginData(xcs)); | 45 Post(RTC_FROM_HERE, this, MSG_LOGIN, new LoginData(xcs)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void XmppThread::Disconnect() { | 48 void XmppThread::Disconnect() { |
| 49 Post(this, MSG_DISCONNECT); | 49 Post(RTC_FROM_HERE, this, MSG_DISCONNECT); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void XmppThread::OnStateChange(buzz::XmppEngine::State state) { | 52 void XmppThread::OnStateChange(buzz::XmppEngine::State state) { |
| 53 } | 53 } |
| 54 | 54 |
| 55 void XmppThread::OnMessage(rtc::Message* pmsg) { | 55 void XmppThread::OnMessage(rtc::Message* pmsg) { |
| 56 if (pmsg->message_id == MSG_LOGIN) { | 56 if (pmsg->message_id == MSG_LOGIN) { |
| 57 ASSERT(pmsg->pdata != NULL); | 57 ASSERT(pmsg->pdata != NULL); |
| 58 LoginData* data = reinterpret_cast<LoginData*>(pmsg->pdata); | 58 LoginData* data = reinterpret_cast<LoginData*>(pmsg->pdata); |
| 59 pump_->DoLogin(data->xcs, new XmppSocket(buzz::TLS_DISABLED), | 59 pump_->DoLogin(data->xcs, new XmppSocket(buzz::TLS_DISABLED), |
| 60 new XmppAuth()); | 60 new XmppAuth()); |
| 61 delete data; | 61 delete data; |
| 62 } else if (pmsg->message_id == MSG_DISCONNECT) { | 62 } else if (pmsg->message_id == MSG_DISCONNECT) { |
| 63 pump_->DoDisconnect(); | 63 pump_->DoDisconnect(); |
| 64 } else { | 64 } else { |
| 65 ASSERT(false); | 65 ASSERT(false); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace buzz | 69 } // namespace buzz |
| OLD | NEW |