OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2010 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/jingleinfotask.h" | 11 #include "webrtc/libjingle/xmpp/jingleinfotask.h" |
12 | 12 |
| 13 #include <memory> |
| 14 |
13 #include "webrtc/libjingle/xmpp/constants.h" | 15 #include "webrtc/libjingle/xmpp/constants.h" |
14 #include "webrtc/libjingle/xmpp/xmppclient.h" | 16 #include "webrtc/libjingle/xmpp/xmppclient.h" |
15 #include "webrtc/libjingle/xmpp/xmpptask.h" | 17 #include "webrtc/libjingle/xmpp/xmpptask.h" |
16 #include "webrtc/base/socketaddress.h" | 18 #include "webrtc/base/socketaddress.h" |
17 | 19 |
18 namespace buzz { | 20 namespace buzz { |
19 | 21 |
20 class JingleInfoTask::JingleInfoGetTask : public XmppTask { | 22 class JingleInfoTask::JingleInfoGetTask : public XmppTask { |
21 public: | 23 public: |
22 explicit JingleInfoGetTask(XmppTaskParentInterface* parent) | 24 explicit JingleInfoGetTask(XmppTaskParentInterface* parent) |
23 : XmppTask(parent, XmppEngine::HL_SINGLE), | 25 : XmppTask(parent, XmppEngine::HL_SINGLE), |
24 done_(false) {} | 26 done_(false) {} |
25 | 27 |
26 virtual int ProcessStart() { | 28 virtual int ProcessStart() { |
27 rtc::scoped_ptr<XmlElement> get( | 29 std::unique_ptr<XmlElement> get( |
28 MakeIq(STR_GET, Jid(), task_id())); | 30 MakeIq(STR_GET, Jid(), task_id())); |
29 get->AddElement(new XmlElement(QN_JINGLE_INFO_QUERY, true)); | 31 get->AddElement(new XmlElement(QN_JINGLE_INFO_QUERY, true)); |
30 if (SendStanza(get.get()) != XMPP_RETURN_OK) { | 32 if (SendStanza(get.get()) != XMPP_RETURN_OK) { |
31 return STATE_ERROR; | 33 return STATE_ERROR; |
32 } | 34 } |
33 return STATE_RESPONSE; | 35 return STATE_RESPONSE; |
34 } | 36 } |
35 virtual int ProcessResponse() { | 37 virtual int ProcessResponse() { |
36 if (done_) | 38 if (done_) |
37 return STATE_DONE; | 39 return STATE_DONE; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 std::string host = server->Attr(QN_JINGLE_INFO_HOST); | 114 std::string host = server->Attr(QN_JINGLE_INFO_HOST); |
113 if (host != STR_EMPTY) { | 115 if (host != STR_EMPTY) { |
114 relay_hosts.push_back(host); | 116 relay_hosts.push_back(host); |
115 } | 117 } |
116 } | 118 } |
117 } | 119 } |
118 SignalJingleInfo(relay_token, relay_hosts, stun_hosts); | 120 SignalJingleInfo(relay_token, relay_hosts, stun_hosts); |
119 return STATE_START; | 121 return STATE_START; |
120 } | 122 } |
121 } | 123 } |
OLD | NEW |