| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 void JingleChromotocolServer::set_allow_local_ips(bool allow_local_ips) { | 217 void JingleChromotocolServer::set_allow_local_ips(bool allow_local_ips) { |
| 218 allow_local_ips_ = allow_local_ips; | 218 allow_local_ips_ = allow_local_ips; |
| 219 } | 219 } |
| 220 | 220 |
| 221 scoped_refptr<ChromotocolConnection> JingleChromotocolServer::Connect( | 221 scoped_refptr<ChromotocolConnection> JingleChromotocolServer::Connect( |
| 222 const std::string& jid, | 222 const std::string& jid, |
| 223 CandidateChromotocolConfig* chromotocol_config, | 223 CandidateChromotocolConfig* chromotocol_config, |
| 224 ChromotocolConnection::StateChangeCallback* state_change_callback) { | 224 ChromotocolConnection::StateChangeCallback* state_change_callback) { |
| 225 // Can be called from any thread. | 225 // Can be called from any thread. |
| 226 scoped_refptr<JingleChromotocolConnection> connection = | 226 scoped_refptr<JingleChromotocolConnection> connection( |
| 227 new JingleChromotocolConnection(this); | 227 new JingleChromotocolConnection(this)); |
| 228 connection->set_candidate_config(chromotocol_config); | 228 connection->set_candidate_config(chromotocol_config); |
| 229 message_loop()->PostTask( | 229 message_loop()->PostTask( |
| 230 FROM_HERE, NewRunnableMethod(this, &JingleChromotocolServer::DoConnect, | 230 FROM_HERE, NewRunnableMethod(this, &JingleChromotocolServer::DoConnect, |
| 231 connection, jid, | 231 connection, jid, |
| 232 state_change_callback)); | 232 state_change_callback)); |
| 233 return connection; | 233 return connection; |
| 234 } | 234 } |
| 235 | 235 |
| 236 void JingleChromotocolServer::DoConnect( | 236 void JingleChromotocolServer::DoConnect( |
| 237 scoped_refptr<JingleChromotocolConnection> connection, | 237 scoped_refptr<JingleChromotocolConnection> connection, |
| (...skipping 229 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 |