| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // The XmppSignalStrategy encapsulates all the logic to perform the signaling | 5 // The XmppSignalStrategy encapsulates all the logic to perform the signaling |
| 6 // STUN/ICE for jingle via a direct XMPP connection. | 6 // STUN/ICE for jingle via a direct XMPP connection. |
| 7 // | 7 // |
| 8 // This class is not threadsafe. | 8 // This class is not threadsafe. |
| 9 | 9 |
| 10 #ifndef REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 10 #ifndef REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
| 11 #define REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 11 #define REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
| 12 | 12 |
| 13 #include "remoting/signaling/signal_strategy.h" | 13 #include "remoting/signaling/signal_strategy.h" |
| 14 | 14 |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/non_thread_safe.h" |
| 20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
| 21 #include "third_party/libjingle/source/talk/base/sigslot.h" | |
| 22 #include "third_party/libjingle/source/talk/xmpp/xmppclient.h" | 21 #include "third_party/libjingle/source/talk/xmpp/xmppclient.h" |
| 22 #include "third_party/webrtc/base/sigslot.h" |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 class ClientSocketFactory; | 25 class ClientSocketFactory; |
| 26 class URLRequestContextGetter; | 26 class URLRequestContextGetter; |
| 27 } // namespace net | 27 } // namespace net |
| 28 | 28 |
| 29 namespace talk_base { | 29 namespace rtc { |
| 30 class TaskRunner; | 30 class TaskRunner; |
| 31 } // namespace talk_base | 31 } // namespace rtc |
| 32 | 32 |
| 33 namespace remoting { | 33 namespace remoting { |
| 34 | 34 |
| 35 class JingleThread; | 35 class JingleThread; |
| 36 | 36 |
| 37 class XmppSignalStrategy : public base::NonThreadSafe, | 37 class XmppSignalStrategy : public base::NonThreadSafe, |
| 38 public SignalStrategy, | 38 public SignalStrategy, |
| 39 public buzz::XmppStanzaHandler, | 39 public buzz::XmppStanzaHandler, |
| 40 public sigslot::has_slots<> { | 40 public sigslot::has_slots<> { |
| 41 public: | 41 public: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const buzz::XmppClientSettings& settings); | 89 const buzz::XmppClientSettings& settings); |
| 90 | 90 |
| 91 void OnConnectionStateChanged(buzz::XmppEngine::State state); | 91 void OnConnectionStateChanged(buzz::XmppEngine::State state); |
| 92 void SetState(State new_state); | 92 void SetState(State new_state); |
| 93 | 93 |
| 94 void SendKeepAlive(); | 94 void SendKeepAlive(); |
| 95 | 95 |
| 96 net::ClientSocketFactory* socket_factory_; | 96 net::ClientSocketFactory* socket_factory_; |
| 97 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 97 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 98 std::string resource_name_; | 98 std::string resource_name_; |
| 99 scoped_ptr<talk_base::TaskRunner> task_runner_; | 99 scoped_ptr<rtc::TaskRunner> task_runner_; |
| 100 buzz::XmppClient* xmpp_client_; | 100 buzz::XmppClient* xmpp_client_; |
| 101 XmppServerConfig xmpp_server_config_; | 101 XmppServerConfig xmpp_server_config_; |
| 102 | 102 |
| 103 State state_; | 103 State state_; |
| 104 Error error_; | 104 Error error_; |
| 105 | 105 |
| 106 ObserverList<Listener, true> listeners_; | 106 ObserverList<Listener, true> listeners_; |
| 107 | 107 |
| 108 base::RepeatingTimer<XmppSignalStrategy> keep_alive_timer_; | 108 base::RepeatingTimer<XmppSignalStrategy> keep_alive_timer_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); | 110 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace remoting | 113 } // namespace remoting |
| 114 | 114 |
| 115 #endif // REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 115 #endif // REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
| OLD | NEW |