| 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/pepper_session.h" | 5 #include "remoting/protocol/pepper_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 11 #include "remoting/base/constants.h" | 11 #include "remoting/base/constants.h" |
| 12 #include "remoting/jingle_glue/iq_sender.h" | 12 #include "remoting/jingle_glue/iq_sender.h" |
| 13 #include "remoting/protocol/content_description.h" | 13 #include "remoting/protocol/content_description.h" |
| 14 #include "remoting/protocol/jingle_messages.h" | 14 #include "remoting/protocol/jingle_messages.h" |
| 15 #include "remoting/protocol/pepper_session_manager.h" | 15 #include "remoting/protocol/pepper_session_manager.h" |
| 16 #include "remoting/protocol/pepper_stream_channel.h" | 16 #include "remoting/protocol/pepper_stream_channel.h" |
| 17 #include "remoting/protocol/simple_client_channel_authenticator.h" |
| 17 #include "third_party/libjingle/source/talk/p2p/base/candidate.h" | 18 #include "third_party/libjingle/source/talk/p2p/base/candidate.h" |
| 18 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 19 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
| 19 | 20 |
| 20 using buzz::XmlElement; | 21 using buzz::XmlElement; |
| 21 | 22 |
| 22 namespace remoting { | 23 namespace remoting { |
| 23 namespace protocol { | 24 namespace protocol { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 // Delay after candidate creation before sending transport-info | 27 // Delay after candidate creation before sending transport-info |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 110 } |
| 110 | 111 |
| 111 void PepperSession::CreateStreamChannel( | 112 void PepperSession::CreateStreamChannel( |
| 112 const std::string& name, | 113 const std::string& name, |
| 113 const StreamChannelCallback& callback) { | 114 const StreamChannelCallback& callback) { |
| 114 DCHECK(!channels_[name]); | 115 DCHECK(!channels_[name]); |
| 115 | 116 |
| 116 PepperStreamChannel* channel = new PepperStreamChannel(this, name, callback); | 117 PepperStreamChannel* channel = new PepperStreamChannel(this, name, callback); |
| 117 channels_[name] = channel; | 118 channels_[name] = channel; |
| 118 channel->Connect(session_manager_->pp_instance_, | 119 channel->Connect(session_manager_->pp_instance_, |
| 119 session_manager_->transport_config_, remote_cert_); | 120 session_manager_->transport_config_, |
| 121 new SimpleClientChannelAuthenticator( |
| 122 remote_cert_, shared_secret_)); |
| 120 } | 123 } |
| 121 | 124 |
| 122 void PepperSession::CreateDatagramChannel( | 125 void PepperSession::CreateDatagramChannel( |
| 123 const std::string& name, | 126 const std::string& name, |
| 124 const DatagramChannelCallback& callback) { | 127 const DatagramChannelCallback& callback) { |
| 125 // TODO(sergeyu): Implement datagram channel support. | 128 // TODO(sergeyu): Implement datagram channel support. |
| 126 NOTREACHED(); | 129 NOTREACHED(); |
| 127 } | 130 } |
| 128 | 131 |
| 129 void PepperSession::CancelChannelCreation(const std::string& name) { | 132 void PepperSession::CancelChannelCreation(const std::string& name) { |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 DCHECK_NE(state_, FAILED); | 421 DCHECK_NE(state_, FAILED); |
| 419 | 422 |
| 420 state_ = new_state; | 423 state_ = new_state; |
| 421 if (!state_change_callback_.is_null()) | 424 if (!state_change_callback_.is_null()) |
| 422 state_change_callback_.Run(new_state); | 425 state_change_callback_.Run(new_state); |
| 423 } | 426 } |
| 424 } | 427 } |
| 425 | 428 |
| 426 } // namespace protocol | 429 } // namespace protocol |
| 427 } // namespace remoting | 430 } // namespace remoting |
| OLD | NEW |