OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_JINGLE_GLUE_XMPP_IQ_REQUEST_H_ | 5 #ifndef REMOTING_JINGLE_GLUE_XMPP_IQ_REQUEST_H_ |
6 #define REMOTING_JINGLE_GLUE_XMPP_IQ_REQUEST_H_ | 6 #define REMOTING_JINGLE_GLUE_XMPP_IQ_REQUEST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "remoting/jingle_glue/iq_request.h" | 9 #include "remoting/jingle_glue/iq_request.h" |
10 #include "third_party/libjingle/source/talk/base/sigslot.h" | 10 #include "third_party/libjingle/source/talk/base/sigslot.h" |
11 #include "third_party/libjingle/source/talk/xmpp/xmppengine.h" | 11 #include "third_party/libjingle/source/talk/xmpp/xmppengine.h" |
12 | 12 |
13 class MessageLoop; | 13 class MessageLoop; |
14 | 14 |
15 namespace buzz { | 15 namespace buzz { |
16 class XmppClient; | 16 class XmppClient; |
17 } // namespace buzz | 17 } // namespace buzz |
18 | 18 |
19 namespace remoting { | 19 namespace remoting { |
20 | 20 |
21 class XmppIqRequest : public IqRequest, public buzz::XmppIqHandler { | 21 class XmppIqRequest : public IqRequest, public buzz::XmppIqHandler { |
22 public: | 22 public: |
23 XmppIqRequest(MessageLoop* message_loop, buzz::XmppClient* xmpp_client); | 23 XmppIqRequest(MessageLoop* message_loop, buzz::XmppClient* xmpp_client); |
24 virtual ~XmppIqRequest(); | 24 virtual ~XmppIqRequest(); |
25 | 25 |
26 // IqRequest interface. | 26 // IqRequest interface. |
27 virtual void SendIq(const std::string& type, const std::string& addressee, | 27 virtual void SendIq(buzz::XmlElement* stanza) OVERRIDE; |
28 buzz::XmlElement* iq_body) OVERRIDE; | |
29 virtual void set_callback(const ReplyCallback& callback) OVERRIDE; | 28 virtual void set_callback(const ReplyCallback& callback) OVERRIDE; |
30 | 29 |
31 // buzz::XmppIqHandler interface. | 30 // buzz::XmppIqHandler interface. |
32 virtual void IqResponse(buzz::XmppIqCookie cookie, | 31 virtual void IqResponse(buzz::XmppIqCookie cookie, |
33 const buzz::XmlElement* stanza) OVERRIDE; | 32 const buzz::XmlElement* stanza) OVERRIDE; |
34 | 33 |
35 private: | 34 private: |
36 FRIEND_TEST_ALL_PREFIXES(IqRequestTest, MakeIqStanza); | 35 FRIEND_TEST_ALL_PREFIXES(IqRequestTest, MakeIqStanza); |
37 | 36 |
38 void Unregister(); | 37 void Unregister(); |
39 | 38 |
40 // TODO(ajwong): This used to hold a reference to the jingle client...make | 39 // TODO(ajwong): This used to hold a reference to the jingle client...make |
41 // sure the lifetime names sense now. | 40 // sure the lifetime names sense now. |
42 MessageLoop* message_loop_; | 41 MessageLoop* message_loop_; |
43 buzz::XmppClient* xmpp_client_; | 42 buzz::XmppClient* xmpp_client_; |
44 buzz::XmppIqCookie cookie_; | 43 buzz::XmppIqCookie cookie_; |
45 ReplyCallback callback_; | 44 ReplyCallback callback_; |
46 }; | 45 }; |
47 | 46 |
48 } // namespace remoting | 47 } // namespace remoting |
49 | 48 |
50 #endif // REMOTING_JINGLE_GLUE_XMPP_IQ_REQUEST_H_ | 49 #endif // REMOTING_JINGLE_GLUE_XMPP_IQ_REQUEST_H_ |
OLD | NEW |