Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: remoting/protocol/jingle_session.h

Issue 205583011: [Draft] Fix canceling pin prompt causes host overload (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Unittests and also reject connections upon authenticating Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void OnSessionInfo(const JingleMessage& message, 124 void OnSessionInfo(const JingleMessage& message,
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
Sergey Ulanov 2014/03/27 19:06:55 Don't need this empty line.
kelvinp 2014/04/01 21:23:49 Done.
134 void ContinueAcceptIncomingConnection(); 135 void ContinueAcceptIncomingConnection();
136
135 // Called after subsequent authenticator messages are processed. 137 // Called after subsequent authenticator messages are processed.
136 void ProcessAuthenticationStep(); 138 void ProcessAuthenticationStep();
137 139
140 // Called after the authenticating step is finished
Sergey Ulanov 2014/03/27 19:06:55 nit: add '.' at the end.
kelvinp 2014/04/01 21:23:49 Done.
141 void ContinueAuthenticationStep();
142
138 // Terminates the session and sends session-terminate if it is 143 // Terminates the session and sends session-terminate if it is
139 // necessary. |error| specifies the error code in case when the 144 // necessary. |error| specifies the error code in case when the
140 // session is being closed due to an error. 145 // session is being closed due to an error.
141 void CloseInternal(ErrorCode error); 146 void CloseInternal(ErrorCode error);
142 147
143 // Sets |state_| to |new_state| and calls state change callback. 148 // Sets |state_| to |new_state| and calls state change callback.
144 void SetState(State new_state); 149 void SetState(State new_state);
145 150
151 // Returns true if the state of the session is not CLOSED or FAILED
152 bool is_session_active();
153
146 JingleSessionManager* session_manager_; 154 JingleSessionManager* session_manager_;
147 std::string peer_jid_; 155 std::string peer_jid_;
148 scoped_ptr<CandidateSessionConfig> candidate_config_; 156 scoped_ptr<CandidateSessionConfig> candidate_config_;
149 Session::EventHandler* event_handler_; 157 Session::EventHandler* event_handler_;
158 base::WeakPtrFactory<JingleSession> weak_factory_;
Sergey Ulanov 2014/03/27 19:06:55 We normally put weak_factory_ as last field - that
kelvinp 2014/04/01 21:23:49 Done.
150 159
151 std::string session_id_; 160 std::string session_id_;
152 State state_; 161 State state_;
153 ErrorCode error_; 162 ErrorCode error_;
154 163
155 SessionConfig config_; 164 SessionConfig config_;
156 bool config_is_set_; 165 bool config_is_set_;
157 166
158 scoped_ptr<Authenticator> authenticator_; 167 scoped_ptr<Authenticator> authenticator_;
159 168
(...skipping 12 matching lines...) Expand all
172 // Pending remote candidates, received before the local channels were created. 181 // Pending remote candidates, received before the local channels were created.
173 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_; 182 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_;
174 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698