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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 virtual const Jid& jid() const = 0; | 60 virtual const Jid& jid() const = 0; |
61 virtual std::string NextId() = 0; | 61 virtual std::string NextId() = 0; |
62 virtual XmppReturnStatus SendStanza(const XmlElement* stanza) = 0; | 62 virtual XmppReturnStatus SendStanza(const XmlElement* stanza) = 0; |
63 virtual XmppReturnStatus SendStanzaError(const XmlElement* original_stanza, | 63 virtual XmppReturnStatus SendStanzaError(const XmlElement* original_stanza, |
64 XmppStanzaError error_code, | 64 XmppStanzaError error_code, |
65 const std::string& message) = 0; | 65 const std::string& message) = 0; |
66 virtual void AddXmppTask(XmppTask* task, XmppEngine::HandlerLevel level) = 0; | 66 virtual void AddXmppTask(XmppTask* task, XmppEngine::HandlerLevel level) = 0; |
67 virtual void RemoveXmppTask(XmppTask* task) = 0; | 67 virtual void RemoveXmppTask(XmppTask* task) = 0; |
68 sigslot::signal0<> SignalDisconnected; | 68 sigslot::signal0<> SignalDisconnected; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(XmppClientInterface); | 70 RTC_DISALLOW_COPY_AND_ASSIGN(XmppClientInterface); |
71 }; | 71 }; |
72 | 72 |
73 // XmppTaskParentInterface is the interface require for any parent of | 73 // XmppTaskParentInterface is the interface require for any parent of |
74 // an XmppTask. It needs, for example, a way to get an | 74 // an XmppTask. It needs, for example, a way to get an |
75 // XmppClientInterface. | 75 // XmppClientInterface. |
76 | 76 |
77 // We really ought to inherit from a TaskParentInterface, but we tried | 77 // We really ought to inherit from a TaskParentInterface, but we tried |
78 // that and it's way too complicated to change | 78 // that and it's way too complicated to change |
79 // Task/TaskParent/TaskRunner. For now, this works. | 79 // Task/TaskParent/TaskRunner. For now, this works. |
80 class XmppTaskParentInterface : public rtc::Task { | 80 class XmppTaskParentInterface : public rtc::Task { |
81 public: | 81 public: |
82 explicit XmppTaskParentInterface(rtc::TaskParent* parent) | 82 explicit XmppTaskParentInterface(rtc::TaskParent* parent) |
83 : Task(parent) { | 83 : Task(parent) { |
84 } | 84 } |
85 virtual ~XmppTaskParentInterface() {} | 85 virtual ~XmppTaskParentInterface() {} |
86 | 86 |
87 virtual XmppClientInterface* GetClient() = 0; | 87 virtual XmppClientInterface* GetClient() = 0; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(XmppTaskParentInterface); | 89 RTC_DISALLOW_COPY_AND_ASSIGN(XmppTaskParentInterface); |
90 }; | 90 }; |
91 | 91 |
92 class XmppTaskBase : public XmppTaskParentInterface { | 92 class XmppTaskBase : public XmppTaskParentInterface { |
93 public: | 93 public: |
94 explicit XmppTaskBase(XmppTaskParentInterface* parent) | 94 explicit XmppTaskBase(XmppTaskParentInterface* parent) |
95 : XmppTaskParentInterface(parent), | 95 : XmppTaskParentInterface(parent), |
96 parent_(parent) { | 96 parent_(parent) { |
97 } | 97 } |
98 virtual ~XmppTaskBase() {} | 98 virtual ~XmppTaskBase() {} |
99 | 99 |
100 virtual XmppClientInterface* GetClient() { | 100 virtual XmppClientInterface* GetClient() { |
101 return parent_->GetClient(); | 101 return parent_->GetClient(); |
102 } | 102 } |
103 | 103 |
104 protected: | 104 protected: |
105 XmppTaskParentInterface* parent_; | 105 XmppTaskParentInterface* parent_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(XmppTaskBase); | 107 RTC_DISALLOW_COPY_AND_ASSIGN(XmppTaskBase); |
108 }; | 108 }; |
109 | 109 |
110 class XmppTask : public XmppTaskBase, | 110 class XmppTask : public XmppTaskBase, |
111 public XmppStanzaHandler, | 111 public XmppStanzaHandler, |
112 public sigslot::has_slots<> | 112 public sigslot::has_slots<> |
113 { | 113 { |
114 public: | 114 public: |
115 XmppTask(XmppTaskParentInterface* parent, | 115 XmppTask(XmppTaskParentInterface* parent, |
116 XmppEngine::HandlerLevel level = XmppEngine::HL_NONE); | 116 XmppEngine::HandlerLevel level = XmppEngine::HL_NONE); |
117 virtual ~XmppTask(); | 117 virtual ~XmppTask(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 std::string id_; | 163 std::string id_; |
164 | 164 |
165 #ifdef _DEBUG | 165 #ifdef _DEBUG |
166 bool debug_force_timeout_; | 166 bool debug_force_timeout_; |
167 #endif | 167 #endif |
168 }; | 168 }; |
169 | 169 |
170 } // namespace buzz | 170 } // namespace buzz |
171 | 171 |
172 #endif // WEBRTC_LIBJINGLE_XMPP_XMPPTASK_H_ | 172 #endif // WEBRTC_LIBJINGLE_XMPP_XMPPTASK_H_ |
OLD | NEW |