| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_chromotocol_server.h" | 5 #include "remoting/protocol/jingle_chromotocol_server.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
| 10 #include "remoting/jingle_glue/jingle_thread.h" | 10 #include "remoting/jingle_glue/jingle_thread.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 DCHECK_EQ(message_loop(), MessageLoop::current()); | 263 DCHECK_EQ(message_loop(), MessageLoop::current()); |
| 264 | 264 |
| 265 // Allow local connections if neccessary. | 265 // Allow local connections if neccessary. |
| 266 session->set_allow_local_ips(allow_local_ips_); | 266 session->set_allow_local_ips(allow_local_ips_); |
| 267 | 267 |
| 268 // If this is an outcoming session the connection object is already | 268 // If this is an outcoming session the connection object is already |
| 269 // created. | 269 // created. |
| 270 if (incoming) { | 270 if (incoming) { |
| 271 JingleChromotocolConnection* connection = | 271 JingleChromotocolConnection* connection = |
| 272 new JingleChromotocolConnection(this); | 272 new JingleChromotocolConnection(this); |
| 273 connections_.push_back(connection); | 273 connections_.push_back(make_scoped_refptr(connection)); |
| 274 connection->Init(session); | 274 connection->Init(session); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 void JingleChromotocolServer::OnSessionDestroy(Session* session) { | 278 void JingleChromotocolServer::OnSessionDestroy(Session* session) { |
| 279 DCHECK_EQ(message_loop(), MessageLoop::current()); | 279 DCHECK_EQ(message_loop(), MessageLoop::current()); |
| 280 | 280 |
| 281 std::list<scoped_refptr<JingleChromotocolConnection> >::iterator it; | 281 std::list<scoped_refptr<JingleChromotocolConnection> >::iterator it; |
| 282 for (it = connections_.begin(); it != connections_.end(); ++it) { | 282 for (it = connections_.begin(); it != connections_.end(); ++it) { |
| 283 if ((*it)->HasSession(session)) { | 283 if ((*it)->HasSession(session)) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 SessionDescription* JingleChromotocolServer::CreateSessionDescription( | 467 SessionDescription* JingleChromotocolServer::CreateSessionDescription( |
| 468 const CandidateChromotocolConfig* config) { | 468 const CandidateChromotocolConfig* config) { |
| 469 SessionDescription* desc = new SessionDescription(); | 469 SessionDescription* desc = new SessionDescription(); |
| 470 desc->AddContent(JingleChromotocolConnection::kChromotingContentName, | 470 desc->AddContent(JingleChromotocolConnection::kChromotingContentName, |
| 471 kChromotingXmlNamespace, | 471 kChromotingXmlNamespace, |
| 472 new ChromotocolContentDescription(config)); | 472 new ChromotocolContentDescription(config)); |
| 473 return desc; | 473 return desc; |
| 474 } | 474 } |
| 475 | 475 |
| 476 } // namespace remoting | 476 } // namespace remoting |
| OLD | NEW |