| 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.h" | 5 #include "remoting/protocol/jingle_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "crypto/hmac.h" | 11 #include "crypto/hmac.h" |
| 12 #include "crypto/rsa_private_key.h" | 12 #include "crypto/rsa_private_key.h" |
| 13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
| 14 #include "net/socket/stream_socket.h" | 14 #include "net/socket/stream_socket.h" |
| 15 #include "remoting/base/constants.h" | 15 #include "remoting/base/constants.h" |
| 16 #include "remoting/protocol/jingle_datagram_connector.h" | 16 #include "remoting/protocol/jingle_datagram_connector.h" |
| 17 #include "remoting/protocol/jingle_session_manager.h" | 17 #include "remoting/protocol/jingle_session_manager.h" |
| 18 #include "remoting/protocol/jingle_stream_connector.h" | 18 #include "remoting/protocol/jingle_stream_connector.h" |
| 19 #include "third_party/libjingle/source/talk/base/thread.h" | 19 #include "third_party/libjingle/source/talk/base/thread.h" |
| 20 #include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h" | 20 #include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h" |
| 21 #include "third_party/libjingle/source/talk/p2p/base/session.h" | 21 #include "third_party/libjingle/source/talk/p2p/base/session.h" |
| 22 #include "third_party/libjingle/source/talk/p2p/base/transport.h" | 22 #include "third_party/libjingle/source/talk/p2p/base/transport.h" |
| 23 | 23 |
| 24 using cricket::BaseSession; | 24 using cricket::BaseSession; |
| 25 | 25 |
| 26 namespace remoting { | 26 namespace remoting { |
| 27 namespace protocol { | 27 namespace protocol { |
| 28 | 28 |
| 29 namespace { | |
| 30 | |
| 31 const char kControlChannelName[] = "control"; | |
| 32 const char kEventChannelName[] = "event"; | |
| 33 | |
| 34 } // namespace | |
| 35 | |
| 36 // static | 29 // static |
| 37 JingleSession* JingleSession::CreateClientSession( | 30 JingleSession* JingleSession::CreateClientSession( |
| 38 JingleSessionManager* manager, const std::string& host_public_key) { | 31 JingleSessionManager* manager, const std::string& host_public_key) { |
| 39 return new JingleSession(manager, "", NULL, host_public_key); | 32 return new JingleSession(manager, "", NULL, host_public_key); |
| 40 } | 33 } |
| 41 | 34 |
| 42 // static | 35 // static |
| 43 JingleSession* JingleSession::CreateServerSession( | 36 JingleSession* JingleSession::CreateServerSession( |
| 44 JingleSessionManager* manager, | 37 JingleSessionManager* manager, |
| 45 const std::string& certificate, | 38 const std::string& certificate, |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 DCHECK_NE(state_, FAILED); | 465 DCHECK_NE(state_, FAILED); |
| 473 | 466 |
| 474 state_ = new_state; | 467 state_ = new_state; |
| 475 if (state_change_callback_.get()) | 468 if (state_change_callback_.get()) |
| 476 state_change_callback_->Run(new_state); | 469 state_change_callback_->Run(new_state); |
| 477 } | 470 } |
| 478 } | 471 } |
| 479 | 472 |
| 480 } // namespace protocol | 473 } // namespace protocol |
| 481 } // namespace remoting | 474 } // namespace remoting |
| OLD | NEW |