| 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 <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 friend class JingleSessionManager; | 47 friend class JingleSessionManager; |
| 48 | 48 |
| 49 typedef base::Callback<void(JingleMessageReply::ErrorType)> ReplyCallback; | 49 typedef base::Callback<void(JingleMessageReply::ErrorType)> ReplyCallback; |
| 50 | 50 |
| 51 explicit JingleSession(JingleSessionManager* session_manager); | 51 explicit JingleSession(JingleSessionManager* session_manager); |
| 52 | 52 |
| 53 // Start connection by sending session-initiate message. | 53 // Start connection by sending session-initiate message. |
| 54 void StartConnection(const std::string& peer_jid, | 54 void StartConnection(const std::string& peer_jid, |
| 55 scoped_ptr<Authenticator> authenticator); | 55 std::unique_ptr<Authenticator> authenticator); |
| 56 | 56 |
| 57 // Called by JingleSessionManager for incoming connections. | 57 // Called by JingleSessionManager for incoming connections. |
| 58 void InitializeIncomingConnection(const JingleMessage& initiate_message, | 58 void InitializeIncomingConnection( |
| 59 scoped_ptr<Authenticator> authenticator); | 59 const JingleMessage& initiate_message, |
| 60 std::unique_ptr<Authenticator> authenticator); |
| 60 void AcceptIncomingConnection(const JingleMessage& initiate_message); | 61 void AcceptIncomingConnection(const JingleMessage& initiate_message); |
| 61 | 62 |
| 62 // Callback for Transport interface to send transport-info messages. | 63 // Callback for Transport interface to send transport-info messages. |
| 63 void SendTransportInfo(scoped_ptr<buzz::XmlElement> transport_info); | 64 void SendTransportInfo(std::unique_ptr<buzz::XmlElement> transport_info); |
| 64 | 65 |
| 65 // Sends |message| to the peer. The session is closed if the send fails or no | 66 // Sends |message| to the peer. The session is closed if the send fails or no |
| 66 // response is received within a reasonable time. All other responses are | 67 // response is received within a reasonable time. All other responses are |
| 67 // ignored. | 68 // ignored. |
| 68 void SendMessage(const JingleMessage& message); | 69 void SendMessage(const JingleMessage& message); |
| 69 | 70 |
| 70 // Iq response handler. | 71 // Iq response handler. |
| 71 void OnMessageResponse(JingleMessage::ActionType request_type, | 72 void OnMessageResponse(JingleMessage::ActionType request_type, |
| 72 IqRequest* request, | 73 IqRequest* request, |
| 73 const buzz::XmlElement* response); | 74 const buzz::XmlElement* response); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 base::ThreadChecker thread_checker_; | 116 base::ThreadChecker thread_checker_; |
| 116 | 117 |
| 117 JingleSessionManager* session_manager_; | 118 JingleSessionManager* session_manager_; |
| 118 std::string peer_jid_; | 119 std::string peer_jid_; |
| 119 Session::EventHandler* event_handler_; | 120 Session::EventHandler* event_handler_; |
| 120 | 121 |
| 121 std::string session_id_; | 122 std::string session_id_; |
| 122 State state_; | 123 State state_; |
| 123 ErrorCode error_; | 124 ErrorCode error_; |
| 124 | 125 |
| 125 scoped_ptr<SessionConfig> config_; | 126 std::unique_ptr<SessionConfig> config_; |
| 126 | 127 |
| 127 scoped_ptr<Authenticator> authenticator_; | 128 std::unique_ptr<Authenticator> authenticator_; |
| 128 | 129 |
| 129 Transport* transport_ = nullptr; | 130 Transport* transport_ = nullptr; |
| 130 | 131 |
| 131 // Pending Iq requests. Used for all messages except transport-info. | 132 // Pending Iq requests. Used for all messages except transport-info. |
| 132 std::set<IqRequest*> pending_requests_; | 133 std::set<IqRequest*> pending_requests_; |
| 133 | 134 |
| 134 // Pending transport-info requests. | 135 // Pending transport-info requests. |
| 135 std::list<IqRequest*> transport_info_requests_; | 136 std::list<IqRequest*> transport_info_requests_; |
| 136 | 137 |
| 137 base::WeakPtrFactory<JingleSession> weak_factory_; | 138 base::WeakPtrFactory<JingleSession> weak_factory_; |
| 138 | 139 |
| 139 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 140 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 } // namespace protocol | 143 } // namespace protocol |
| 143 } // namespace remoting | 144 } // namespace remoting |
| 144 | 145 |
| 145 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 146 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| OLD | NEW |