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 |
11 #ifndef WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ | 11 #ifndef WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ |
12 #define WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ | 12 #define WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include <string> | 15 #include <string> |
15 | 16 |
16 #include "webrtc/libjingle/xmpp/xmppengine.h" | 17 #include "webrtc/libjingle/xmpp/xmppengine.h" |
17 #include "webrtc/libjingle/xmpp/xmpptask.h" | 18 #include "webrtc/libjingle/xmpp/xmpptask.h" |
18 | 19 |
19 namespace buzz { | 20 namespace buzz { |
20 | 21 |
21 class IqTask : public XmppTask { | 22 class IqTask : public XmppTask { |
22 public: | 23 public: |
23 IqTask(XmppTaskParentInterface* parent, | 24 IqTask(XmppTaskParentInterface* parent, |
24 const std::string& verb, const Jid& to, | 25 const std::string& verb, const Jid& to, |
25 XmlElement* el); | 26 XmlElement* el); |
26 virtual ~IqTask() {} | 27 virtual ~IqTask() {} |
27 | 28 |
28 const XmlElement* stanza() const { return stanza_.get(); } | 29 const XmlElement* stanza() const { return stanza_.get(); } |
29 | 30 |
30 sigslot::signal2<IqTask*, | 31 sigslot::signal2<IqTask*, |
31 const XmlElement*> SignalError; | 32 const XmlElement*> SignalError; |
32 | 33 |
33 protected: | 34 protected: |
34 virtual void HandleResult(const XmlElement* element) = 0; | 35 virtual void HandleResult(const XmlElement* element) = 0; |
35 | 36 |
36 private: | 37 private: |
37 virtual int ProcessStart(); | 38 virtual int ProcessStart(); |
38 virtual bool HandleStanza(const XmlElement* stanza); | 39 virtual bool HandleStanza(const XmlElement* stanza); |
39 virtual int ProcessResponse(); | 40 virtual int ProcessResponse(); |
40 virtual int OnTimeout(); | 41 virtual int OnTimeout(); |
41 | 42 |
42 Jid to_; | 43 Jid to_; |
43 rtc::scoped_ptr<XmlElement> stanza_; | 44 std::unique_ptr<XmlElement> stanza_; |
44 }; | 45 }; |
45 | 46 |
46 } // namespace buzz | 47 } // namespace buzz |
47 | 48 |
48 #endif // WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ | 49 #endif // WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ |
OLD | NEW |