Index: remoting/protocol/jingle_session_manager.cc |
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc |
index 314f3a0fa1c48124c0a679492c1446b3660b1fa0..70bf70a2290c417e7019a7f496f4cdfa7bdc4f89 100644 |
--- a/remoting/protocol/jingle_session_manager.cc |
+++ b/remoting/protocol/jingle_session_manager.cc |
@@ -26,6 +26,20 @@ using buzz::XmlElement; |
namespace remoting { |
namespace protocol { |
+// static |
+JingleSessionManager* JingleSessionManager::Create() { |
+ return JingleSessionManager::Create(); |
Wez
2011/07/06 21:24:25
Eeep, recursion!
Sergey Ulanov
2011/07/06 23:15:01
Ouch.
|
+} |
+ |
+// static |
+JingleSessionManager* JingleSessionManager::Create( |
+ talk_base::NetworkManager* network_manager, |
+ talk_base::PacketSocketFactory* socket_factory, |
+ PortAllocatorSessionFactory* port_allocator_session_factory) { |
+ return JingleSessionManager::Create(network_manager, socket_factory, |
+ port_allocator_session_factory); |
Wez
2011/07/06 21:24:25
Eeep, recursion!
Sergey Ulanov
2011/07/06 23:15:01
Done.
|
+} |
+ |
JingleSessionManager::JingleSessionManager( |
talk_base::NetworkManager* network_manager, |
talk_base::PacketSocketFactory* socket_factory, |
@@ -42,7 +56,7 @@ JingleSessionManager::JingleSessionManager( |
} |
JingleSessionManager::~JingleSessionManager() { |
- DCHECK(closed_); |
+ Close(); |
Wez
2011/07/06 21:24:25
Once we have removed ourself from |cricket_session
Sergey Ulanov
2011/07/06 23:15:01
No, it should not call us after that. We also dest
|
} |
void JingleSessionManager::Init( |
@@ -127,21 +141,6 @@ Session* JingleSessionManager::Connect( |
jingle_session->set_candidate_config(candidate_config); |
jingle_session->set_receiver_token(receiver_token); |
- // TODO(sergeyu): Does this need to be asynchronous? |
- MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( |
- &JingleSessionManager::DoConnect, jingle_session, host_jid, |
- host_public_key, receiver_token, state_change_callback)); |
- return jingle_session; |
-} |
- |
-void JingleSessionManager::DoConnect( |
- JingleSession* jingle_session, |
- const std::string& host_jid, |
- const std::string& host_public_key, |
- const std::string& receiver_token, |
- Session::StateChangeCallback* state_change_callback) { |
- DCHECK(CalledOnValidThread()); |
- |
cricket::Session* cricket_session = cricket_session_manager_->CreateSession( |
local_jid_, kChromotingXmlNamespace); |
@@ -153,6 +152,8 @@ void JingleSessionManager::DoConnect( |
cricket_session->Initiate(host_jid, CreateClientSessionDescription( |
jingle_session->candidate_config()->Clone(), receiver_token, |
jingle_session->GetEncryptedMasterKey())); |
+ |
+ return jingle_session; |
} |
void JingleSessionManager::OnSessionCreate( |
@@ -261,7 +262,7 @@ void JingleSessionManager::OnJingleInfo( |
const std::vector<talk_base::SocketAddress>& stun_hosts) { |
DCHECK(CalledOnValidThread()); |
- if (port_allocator_.get()) { |
+ if (http_port_allocator_) { |
// TODO(ajwong): Avoid string processing if log-level is low. |
std::string stun_servers; |
for (size_t i = 0; i < stun_hosts.size(); ++i) { |