| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 const ReplyCallback& reply_callback); | 125 const ReplyCallback& reply_callback); |
| 126 void OnTerminate(const JingleMessage& message, | 126 void OnTerminate(const JingleMessage& message, |
| 127 const ReplyCallback& reply_callback); | 127 const ReplyCallback& reply_callback); |
| 128 void ProcessTransportInfo(const JingleMessage& message); | 128 void ProcessTransportInfo(const JingleMessage& message); |
| 129 | 129 |
| 130 // Called from OnAccept() to initialize session config. | 130 // Called from OnAccept() to initialize session config. |
| 131 bool InitializeConfigFromDescription(const ContentDescription* description); | 131 bool InitializeConfigFromDescription(const ContentDescription* description); |
| 132 | 132 |
| 133 // Called after the initial incoming authenticator message is processed. | 133 // Called after the initial incoming authenticator message is processed. |
| 134 void ContinueAcceptIncomingConnection(); | 134 void ContinueAcceptIncomingConnection(); |
| 135 |
| 135 // Called after subsequent authenticator messages are processed. | 136 // Called after subsequent authenticator messages are processed. |
| 136 void ProcessAuthenticationStep(); | 137 void ProcessAuthenticationStep(); |
| 137 | 138 |
| 139 // Called after the authenticating step is finished. |
| 140 void ContinueAuthenticationStep(); |
| 141 |
| 138 // Terminates the session and sends session-terminate if it is | 142 // Terminates the session and sends session-terminate if it is |
| 139 // necessary. |error| specifies the error code in case when the | 143 // necessary. |error| specifies the error code in case when the |
| 140 // session is being closed due to an error. | 144 // session is being closed due to an error. |
| 141 void CloseInternal(ErrorCode error); | 145 void CloseInternal(ErrorCode error); |
| 142 | 146 |
| 143 // Sets |state_| to |new_state| and calls state change callback. | 147 // Sets |state_| to |new_state| and calls state change callback. |
| 144 void SetState(State new_state); | 148 void SetState(State new_state); |
| 145 | 149 |
| 150 // Returns true if the state of the session is not CLOSED or FAILED |
| 151 bool is_session_active(); |
| 152 |
| 146 JingleSessionManager* session_manager_; | 153 JingleSessionManager* session_manager_; |
| 147 std::string peer_jid_; | 154 std::string peer_jid_; |
| 148 scoped_ptr<CandidateSessionConfig> candidate_config_; | 155 scoped_ptr<CandidateSessionConfig> candidate_config_; |
| 149 Session::EventHandler* event_handler_; | 156 Session::EventHandler* event_handler_; |
| 150 | 157 |
| 151 std::string session_id_; | 158 std::string session_id_; |
| 152 State state_; | 159 State state_; |
| 153 ErrorCode error_; | 160 ErrorCode error_; |
| 154 | 161 |
| 155 SessionConfig config_; | 162 SessionConfig config_; |
| 156 bool config_is_set_; | 163 bool config_is_set_; |
| 157 | 164 |
| 158 scoped_ptr<Authenticator> authenticator_; | 165 scoped_ptr<Authenticator> authenticator_; |
| 159 | 166 |
| 160 // Pending Iq requests. Used for all messages except transport-info. | 167 // Pending Iq requests. Used for all messages except transport-info. |
| 161 std::set<IqRequest*> pending_requests_; | 168 std::set<IqRequest*> pending_requests_; |
| 162 | 169 |
| 163 // Pending transport-info requests. | 170 // Pending transport-info requests. |
| 164 std::list<IqRequest*> transport_info_requests_; | 171 std::list<IqRequest*> transport_info_requests_; |
| 165 | 172 |
| 166 ChannelsMap channels_; | 173 ChannelsMap channels_; |
| 167 scoped_ptr<ChannelMultiplexer> channel_multiplexer_; | 174 scoped_ptr<ChannelMultiplexer> channel_multiplexer_; |
| 168 | 175 |
| 169 base::OneShotTimer<JingleSession> transport_infos_timer_; | 176 base::OneShotTimer<JingleSession> transport_infos_timer_; |
| 170 std::list<JingleMessage::NamedCandidate> pending_candidates_; | 177 std::list<JingleMessage::NamedCandidate> pending_candidates_; |
| 171 | 178 |
| 172 // Pending remote candidates, received before the local channels were created. | 179 // Pending remote candidates, received before the local channels were created. |
| 173 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_; | 180 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_; |
| 174 | 181 |
| 182 base::WeakPtrFactory<JingleSession> weak_factory_; |
| 183 |
| 175 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 184 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
| 176 }; | 185 }; |
| 177 | 186 |
| 178 } // namespace protocol | 187 } // namespace protocol |
| 179 } // namespace remoting | 188 } // namespace remoting |
| 180 | 189 |
| 181 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 190 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| OLD | NEW |