Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: remoting/protocol/libjingle_transport_factory.h

Issue 98173006: Fix LibjingleTransportFactory to refresh STUN/Relay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/libjingle_transport_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/libjingle_transport_factory.h
diff --git a/remoting/protocol/libjingle_transport_factory.h b/remoting/protocol/libjingle_transport_factory.h
index dfa0ab13c0dde43b16c749262df481c8971bb975..637410c97c3ba4666752a927c36b0d75ad4afd0b 100644
--- a/remoting/protocol/libjingle_transport_factory.h
+++ b/remoting/protocol/libjingle_transport_factory.h
@@ -5,6 +5,10 @@
#ifndef REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_
#define REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_
+#include <list>
+
+#include "base/callback_forward.h"
+#include "remoting/jingle_glue/network_settings.h"
#include "remoting/protocol/transport.h"
namespace cricket {
@@ -19,34 +23,49 @@ class URLRequestContextGetter;
namespace talk_base {
class NetworkManager;
class PacketSocketFactory;
+class SocketAddress;
} // namespace talk_base
namespace remoting {
-struct NetworkSettings;
+class SignalStrategy;
+class JingleInfoRequest;
namespace protocol {
class LibjingleTransportFactory : public TransportFactory {
public:
- // Need to use cricket::HttpPortAllocatorBase pointer for the
- // |port_allocator|, so that it is possible to configure
- // |port_allocator| with STUN/Relay addresses.
- // TODO(sergeyu): Reconsider this design.
+ // |signal_strategy| must outlive LibjingleTransportFactory. Need to use
+ // cricket::HttpPortAllocatorBase pointer for the |port_allocator|, so that it
+ // is possible to configure |port_allocator| with STUN/Relay addresses.
LibjingleTransportFactory(
+ SignalStrategy* signal_strategy,
scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator,
- bool incoming_only);
+ const NetworkSettings& network_settings);
virtual ~LibjingleTransportFactory();
// TransportFactory interface.
- virtual void SetTransportConfig(const TransportConfig& config) OVERRIDE;
+ virtual void PrepareTokens() OVERRIDE;
virtual scoped_ptr<StreamTransport> CreateStreamTransport() OVERRIDE;
virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() OVERRIDE;
private:
+ void EnsureFreshJingleInfo();
+ void OnJingleInfo(const std::string& relay_token,
+ const std::vector<std::string>& relay_hosts,
+ const std::vector<talk_base::SocketAddress>& stun_hosts);
+
+ SignalStrategy* signal_strategy_;
scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator_;
- bool incoming_only_;
+ NetworkSettings network_settings_;
+
+ base::TimeTicks last_jingle_info_update_time_;
+ scoped_ptr<JingleInfoRequest> jingle_info_request_;
+
+ // When there is an active |jingle_info_request_| stores list of callbacks to
+ // be called once the |jingle_info_request_| is finished.
+ std::list<base::Closure> on_jingle_info_callbacks_;
DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory);
};
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/libjingle_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698