| 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 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| 7 | 7 |
| 8 #include "base/lock.h" | 8 #include "base/lock.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "remoting/protocol/session.h" | 10 #include "remoting/protocol/session.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 virtual net::Socket* control_channel(); | 44 virtual net::Socket* control_channel(); |
| 45 virtual net::Socket* event_channel(); | 45 virtual net::Socket* event_channel(); |
| 46 virtual net::Socket* video_channel(); | 46 virtual net::Socket* video_channel(); |
| 47 | 47 |
| 48 virtual net::Socket* video_rtp_channel(); | 48 virtual net::Socket* video_rtp_channel(); |
| 49 virtual net::Socket* video_rtcp_channel(); | 49 virtual net::Socket* video_rtcp_channel(); |
| 50 | 50 |
| 51 virtual const std::string& jid(); | 51 virtual const std::string& jid(); |
| 52 virtual MessageLoop* message_loop(); | 52 virtual MessageLoop* message_loop(); |
| 53 | 53 |
| 54 virtual const CandidateChromotocolConfig* candidate_config(); | 54 virtual const CandidateSessionConfig* candidate_config(); |
| 55 virtual const ChromotocolConfig* config(); | 55 virtual const SessionConfig* config(); |
| 56 | 56 |
| 57 virtual void set_config(const ChromotocolConfig* config); | 57 virtual void set_config(const SessionConfig* config); |
| 58 | 58 |
| 59 virtual void Close(Task* closed_task); | 59 virtual void Close(Task* closed_task); |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 virtual ~JingleSession(); | 62 virtual ~JingleSession(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 friend class JingleSessionManager; | 65 friend class JingleSessionManager; |
| 66 | 66 |
| 67 // Called by JingleSessionManager. | 67 // Called by JingleSessionManager. |
| 68 void set_candidate_config(const CandidateChromotocolConfig* candidate_config); | 68 void set_candidate_config(const CandidateSessionConfig* candidate_config); |
| 69 void Init(cricket::Session* cricket_session); | 69 void Init(cricket::Session* cricket_session); |
| 70 bool HasSession(cricket::Session* cricket_session); | 70 bool HasSession(cricket::Session* cricket_session); |
| 71 cricket::Session* ReleaseSession(); | 71 cricket::Session* ReleaseSession(); |
| 72 | 72 |
| 73 // Used for Session.SignalState sigslot. | 73 // Used for Session.SignalState sigslot. |
| 74 void OnSessionState(cricket::BaseSession* session, | 74 void OnSessionState(cricket::BaseSession* session, |
| 75 cricket::BaseSession::State state); | 75 cricket::BaseSession::State state); |
| 76 | 76 |
| 77 void OnInitiate(); | 77 void OnInitiate(); |
| 78 void OnAccept(); | 78 void OnAccept(); |
| 79 void OnTerminate(); | 79 void OnTerminate(); |
| 80 | 80 |
| 81 void SetState(State new_state); | 81 void SetState(State new_state); |
| 82 | 82 |
| 83 // JingleSessionManager that created this session. | 83 // JingleSessionManager that created this session. |
| 84 scoped_refptr<JingleSessionManager> jingle_session_manager_; | 84 scoped_refptr<JingleSessionManager> jingle_session_manager_; |
| 85 | 85 |
| 86 State state_; | 86 State state_; |
| 87 scoped_ptr<StateChangeCallback> state_change_callback_; | 87 scoped_ptr<StateChangeCallback> state_change_callback_; |
| 88 | 88 |
| 89 bool closed_; | 89 bool closed_; |
| 90 | 90 |
| 91 // JID of the other side. Set when the connection is initialized, | 91 // JID of the other side. Set when the connection is initialized, |
| 92 // and never changed after that. | 92 // and never changed after that. |
| 93 std::string jid_; | 93 std::string jid_; |
| 94 | 94 |
| 95 // The corresponding libjingle session. | 95 // The corresponding libjingle session. |
| 96 cricket::Session* cricket_session_; | 96 cricket::Session* cricket_session_; |
| 97 | 97 |
| 98 scoped_ptr<const CandidateChromotocolConfig> candidate_config_; | 98 scoped_ptr<const CandidateSessionConfig> candidate_config_; |
| 99 scoped_ptr<const ChromotocolConfig> config_; | 99 scoped_ptr<const SessionConfig> config_; |
| 100 | 100 |
| 101 cricket::PseudoTcpChannel* control_channel_; | 101 cricket::PseudoTcpChannel* control_channel_; |
| 102 scoped_ptr<StreamSocketAdapter> control_channel_adapter_; | 102 scoped_ptr<StreamSocketAdapter> control_channel_adapter_; |
| 103 cricket::PseudoTcpChannel* event_channel_; | 103 cricket::PseudoTcpChannel* event_channel_; |
| 104 scoped_ptr<StreamSocketAdapter> event_channel_adapter_; | 104 scoped_ptr<StreamSocketAdapter> event_channel_adapter_; |
| 105 cricket::PseudoTcpChannel* video_channel_; | 105 cricket::PseudoTcpChannel* video_channel_; |
| 106 scoped_ptr<StreamSocketAdapter> video_channel_adapter_; | 106 scoped_ptr<StreamSocketAdapter> video_channel_adapter_; |
| 107 scoped_ptr<TransportChannelSocketAdapter> video_rtp_channel_; | 107 scoped_ptr<TransportChannelSocketAdapter> video_rtp_channel_; |
| 108 scoped_ptr<TransportChannelSocketAdapter> video_rtcp_channel_; | 108 scoped_ptr<TransportChannelSocketAdapter> video_rtcp_channel_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 110 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace protocol | 113 } // namespace protocol |
| 114 | 114 |
| 115 } // namespace remoting | 115 } // namespace remoting |
| 116 | 116 |
| 117 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 117 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| OLD | NEW |