| 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_JINGLE_CLIENT_H_ | 5 #ifndef REMOTING_JINGLE_GLUE_JINGLE_CLIENT_H_ |
| 6 #define REMOTING_JINGLE_GLUE_JINGLE_CLIENT_H_ | 6 #define REMOTING_JINGLE_GLUE_JINGLE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class SessionManager; | 33 class SessionManager; |
| 34 class TunnelSessionClient; | 34 class TunnelSessionClient; |
| 35 class SessionManagerTask; | 35 class SessionManagerTask; |
| 36 class Session; | 36 class Session; |
| 37 } // namespace cricket | 37 } // namespace cricket |
| 38 | 38 |
| 39 namespace remoting { | 39 namespace remoting { |
| 40 | 40 |
| 41 class IqRequest; | 41 class IqRequest; |
| 42 class JingleThread; | 42 class JingleThread; |
| 43 class PortAllocatorSessionFactory; |
| 43 | 44 |
| 44 // TODO(ajwong): The SignalStrategy stuff needs to be separated out to separate | 45 // TODO(ajwong): The SignalStrategy stuff needs to be separated out to separate |
| 45 // files. | 46 // files. |
| 46 class SignalStrategy { | 47 class SignalStrategy { |
| 47 public: | 48 public: |
| 48 class StatusObserver { | 49 class StatusObserver { |
| 49 public: | 50 public: |
| 50 enum State { | 51 enum State { |
| 51 START, | 52 START, |
| 52 CONNECTING, | 53 CONNECTING, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Physical sockets are used if |network_manager| and | 144 // Physical sockets are used if |network_manager| and |
| 144 // |socket_factory| are not specified. Otherwise ownership of these | 145 // |socket_factory| are not specified. Otherwise ownership of these |
| 145 // objects is given to JingleClient. | 146 // objects is given to JingleClient. |
| 146 JingleClient(JingleThread* thread, | 147 JingleClient(JingleThread* thread, |
| 147 SignalStrategy* signal_strategy, | 148 SignalStrategy* signal_strategy, |
| 148 Callback* callback); | 149 Callback* callback); |
| 149 JingleClient(JingleThread* thread, | 150 JingleClient(JingleThread* thread, |
| 150 SignalStrategy* signal_strategy, | 151 SignalStrategy* signal_strategy, |
| 151 talk_base::NetworkManager* network_manager, | 152 talk_base::NetworkManager* network_manager, |
| 152 talk_base::PacketSocketFactory* socket_factory, | 153 talk_base::PacketSocketFactory* socket_factory, |
| 154 PortAllocatorSessionFactory* session_factory, |
| 153 Callback* callback); | 155 Callback* callback); |
| 154 ~JingleClient(); | 156 ~JingleClient(); |
| 155 | 157 |
| 156 // Starts the XMPP connection initialization. Must be called only once. | 158 // Starts the XMPP connection initialization. Must be called only once. |
| 157 // |callback| specifies callback object for the client and must not be NULL. | 159 // |callback| specifies callback object for the client and must not be NULL. |
| 158 void Init(); | 160 void Init(); |
| 159 | 161 |
| 160 // Closes XMPP connection and stops the thread. Must be called before the | 162 // Closes XMPP connection and stops the thread. Must be called before the |
| 161 // object is destroyed. If specified, |closed_task| is executed after the | 163 // object is destroyed. If specified, |closed_task| is executed after the |
| 162 // connection is successfully closed. | 164 // connection is successfully closed. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 base::Lock jid_lock_; | 217 base::Lock jid_lock_; |
| 216 std::string full_jid_; | 218 std::string full_jid_; |
| 217 | 219 |
| 218 // Callback for this object. Callback must not be called if closed_ == true. | 220 // Callback for this object. Callback must not be called if closed_ == true. |
| 219 Callback* callback_; | 221 Callback* callback_; |
| 220 | 222 |
| 221 SignalStrategy* signal_strategy_; | 223 SignalStrategy* signal_strategy_; |
| 222 scoped_ptr<talk_base::NetworkManager> network_manager_; | 224 scoped_ptr<talk_base::NetworkManager> network_manager_; |
| 223 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; | 225 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; |
| 224 scoped_ptr<cricket::HttpPortAllocator> port_allocator_; | 226 scoped_ptr<cricket::HttpPortAllocator> port_allocator_; |
| 227 scoped_ptr<PortAllocatorSessionFactory> port_allocator_session_factory_; |
| 225 scoped_ptr<cricket::SessionManager> session_manager_; | 228 scoped_ptr<cricket::SessionManager> session_manager_; |
| 226 | 229 |
| 227 DISALLOW_COPY_AND_ASSIGN(JingleClient); | 230 DISALLOW_COPY_AND_ASSIGN(JingleClient); |
| 228 }; | 231 }; |
| 229 | 232 |
| 230 } // namespace remoting | 233 } // namespace remoting |
| 231 | 234 |
| 232 #endif // REMOTING_JINGLE_GLUE_JINGLE_CLIENT_H_ | 235 #endif // REMOTING_JINGLE_GLUE_JINGLE_CLIENT_H_ |
| OLD | NEW |