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 |
11 #include "webrtc/libjingle/xmpp/constants.h" | 11 #include "webrtc/libjingle/xmpp/constants.h" |
12 #include "webrtc/libjingle/xmpp/xmppclient.h" | 12 #include "webrtc/libjingle/xmpp/xmppclient.h" |
13 #include "webrtc/libjingle/xmpp/xmppengine.h" | 13 #include "webrtc/libjingle/xmpp/xmppengine.h" |
14 #include "webrtc/libjingle/xmpp/xmpptask.h" | 14 #include "webrtc/libjingle/xmpp/xmpptask.h" |
15 | 15 |
16 namespace buzz { | 16 namespace buzz { |
17 | 17 |
18 XmppClientInterface::XmppClientInterface() { | 18 XmppClientInterface::XmppClientInterface() { |
19 } | 19 } |
20 | 20 |
21 XmppClientInterface::~XmppClientInterface() { | 21 XmppClientInterface::~XmppClientInterface() { |
22 } | 22 } |
23 | 23 |
24 XmppTask::XmppTask(XmppTaskParentInterface* parent, | 24 XmppTask::XmppTask(XmppTaskParentInterface* parent, |
25 XmppEngine::HandlerLevel level) | 25 XmppEngine::HandlerLevel level) |
26 : XmppTaskBase(parent), stopped_(false) { | 26 : XmppTaskBase(parent), stopped_(false) { |
27 #ifdef _DEBUG | 27 #if !defined(NDEBUG) |
28 debug_force_timeout_ = false; | 28 debug_force_timeout_ = false; |
29 #endif | 29 #endif |
30 | 30 |
31 id_ = GetClient()->NextId(); | 31 id_ = GetClient()->NextId(); |
32 GetClient()->AddXmppTask(this, level); | 32 GetClient()->AddXmppTask(this, level); |
33 GetClient()->SignalDisconnected.connect(this, &XmppTask::OnDisconnect); | 33 GetClient()->SignalDisconnected.connect(this, &XmppTask::OnDisconnect); |
34 } | 34 } |
35 | 35 |
36 XmppTask::~XmppTask() { | 36 XmppTask::~XmppTask() { |
37 StopImpl(); | 37 StopImpl(); |
(...skipping 25 matching lines...) Expand all Loading... |
63 void XmppTask::Stop() { | 63 void XmppTask::Stop() { |
64 StopImpl(); | 64 StopImpl(); |
65 Task::Stop(); | 65 Task::Stop(); |
66 } | 66 } |
67 | 67 |
68 void XmppTask::OnDisconnect() { | 68 void XmppTask::OnDisconnect() { |
69 Error(); | 69 Error(); |
70 } | 70 } |
71 | 71 |
72 void XmppTask::QueueStanza(const XmlElement* stanza) { | 72 void XmppTask::QueueStanza(const XmlElement* stanza) { |
73 #ifdef _DEBUG | 73 #if !defined(NDEBUG) |
74 if (debug_force_timeout_) | 74 if (debug_force_timeout_) |
75 return; | 75 return; |
76 #endif | 76 #endif |
77 | 77 |
78 stanza_queue_.push_back(new XmlElement(*stanza)); | 78 stanza_queue_.push_back(new XmlElement(*stanza)); |
79 Wake(); | 79 Wake(); |
80 } | 80 } |
81 | 81 |
82 const XmlElement* XmppTask::NextStanza() { | 82 const XmlElement* XmppTask::NextStanza() { |
83 XmlElement* result = NULL; | 83 XmlElement* result = NULL; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (stanza->Attr(QN_TYPE) != type) | 149 if (stanza->Attr(QN_TYPE) != type) |
150 return false; | 150 return false; |
151 | 151 |
152 if (stanza->FirstNamed(qn) == NULL) | 152 if (stanza->FirstNamed(qn) == NULL) |
153 return false; | 153 return false; |
154 | 154 |
155 return true; | 155 return true; |
156 } | 156 } |
157 | 157 |
158 } | 158 } |
OLD | NEW |