Index: remoting/jingle_glue/jingle_info_request.h |
diff --git a/remoting/jingle_glue/jingle_info_request.h b/remoting/jingle_glue/jingle_info_request.h |
index 9a63f82a4125a5b7e7f1ed6806882841f73607d2..ea5293ac9cf57282079b3e157f525f095c6baa76 100644 |
--- a/remoting/jingle_glue/jingle_info_request.h |
+++ b/remoting/jingle_glue/jingle_info_request.h |
@@ -5,12 +5,15 @@ |
#ifndef REMOTING_JINGLE_GLUE_JINGLE_INFO_REQUEST_H_ |
#define REMOTING_JINGLE_GLUE_JINGLE_INFO_REQUEST_H_ |
+#include <map> |
+#include <set> |
#include <string> |
#include <vector> |
#include "base/basictypes.h" |
#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
+#include "third_party/libjingle/source/talk/base/sigslot.h" |
class Task; |
@@ -25,6 +28,8 @@ class SocketAddress; |
namespace remoting { |
class IqRequest; |
+class HostAddressRequest; |
+class HostAddressResolver; |
// JingleInfoRequest handles requesting STUN/Relay infromation from |
// the Google Talk network. The query is made when Send() is |
@@ -35,7 +40,7 @@ class IqRequest; |
// created on. |
// |
// TODO(ajwong): Add support for a timeout. |
-class JingleInfoRequest { |
+class JingleInfoRequest : public sigslot::has_slots<> { |
public: |
// Callback to receive the Jingle configuration settings. The argumetns are |
// passed by pointer so the receive may call swap on them. The receiver does |
@@ -45,17 +50,36 @@ class JingleInfoRequest { |
const std::string&, const std::vector<std::string>&, |
const std::vector<talk_base::SocketAddress>&)> OnJingleInfoCallback; |
- explicit JingleInfoRequest(IqRequest* request); |
+ explicit JingleInfoRequest(IqRequest* request, |
+ HostAddressResolver* host_resolver); |
~JingleInfoRequest(); |
void Send(const OnJingleInfoCallback& callback); |
private: |
+ struct PendingDnsRequest; |
+ typedef std::map<HostAddressRequest*, PendingDnsRequest*> RequestsMap; |
+ |
void OnResponse(const buzz::XmlElement* stanza); |
+ void OnStunAddressResponse(HostAddressRequest* request, |
+ const talk_base::SocketAddress& address); |
+ void OnRelayAddressResponse(HostAddressRequest* request, |
+ const talk_base::SocketAddress& address); |
+ |
+ void VerifyAllAddressesResolved(); |
+ |
+ HostAddressResolver* host_resolver_; |
scoped_ptr<IqRequest> request_; |
OnJingleInfoCallback on_jingle_info_cb_; |
+ std::vector<std::string> relay_hosts_; |
+ std::vector<talk_base::SocketAddress> stun_hosts_; |
+ std::string relay_token_; |
+ |
+ RequestsMap stun_dns_requests_; |
+ std::set<HostAddressRequest*> relay_dns_requests_; |
+ |
DISALLOW_COPY_AND_ASSIGN(JingleInfoRequest); |
}; |