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 #include "remoting/protocol/jingle_session_manager.h" | 5 #include "remoting/protocol/jingle_session_manager.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 return jingle_session; | 176 return jingle_session; |
177 } | 177 } |
178 | 178 |
179 void JingleSessionManager::OnSessionCreate( | 179 void JingleSessionManager::OnSessionCreate( |
180 cricket::Session* cricket_session, bool incoming) { | 180 cricket::Session* cricket_session, bool incoming) { |
181 DCHECK(CalledOnValidThread()); | 181 DCHECK(CalledOnValidThread()); |
182 | 182 |
183 // Allow local connections if neccessary. | 183 // Allow local connections if neccessary. |
184 cricket_session->set_allow_local_ips(allow_local_ips_); | 184 cricket_session->set_allow_local_ips(allow_local_ips_); |
185 | 185 |
186 // If this is an outcoming session the session object is already created. | 186 // If this is an incoming session, create a JingleSession on top of it. |
187 if (incoming) { | 187 if (incoming) { |
188 DCHECK(!certificate_.empty()); | 188 DCHECK(!certificate_.empty()); |
189 DCHECK(private_key_.get()); | 189 DCHECK(private_key_.get()); |
190 | 190 |
191 JingleSession* jingle_session = JingleSession::CreateServerSession( | 191 JingleSession* jingle_session = JingleSession::CreateServerSession( |
192 this, certificate_, private_key_.get()); | 192 this, certificate_, private_key_.get()); |
193 sessions_.push_back(jingle_session); | 193 sessions_.push_back(jingle_session); |
194 jingle_session->Init(cricket_session); | 194 jingle_session->Init(cricket_session); |
195 } | 195 } |
196 } | 196 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 const std::string& certificate) { | 341 const std::string& certificate) { |
342 cricket::SessionDescription* desc = new cricket::SessionDescription(); | 342 cricket::SessionDescription* desc = new cricket::SessionDescription(); |
343 desc->AddContent( | 343 desc->AddContent( |
344 JingleSession::kChromotingContentName, kChromotingXmlNamespace, | 344 JingleSession::kChromotingContentName, kChromotingXmlNamespace, |
345 new ContentDescription(config, "", "", certificate)); | 345 new ContentDescription(config, "", "", certificate)); |
346 return desc; | 346 return desc; |
347 } | 347 } |
348 | 348 |
349 } // namespace protocol | 349 } // namespace protocol |
350 } // namespace remoting | 350 } // namespace remoting |
OLD | NEW |