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

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.h

Issue 1311433009: A few updates on connection states (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void UpdateConnectionStates(); 170 void UpdateConnectionStates();
171 void RequestSort(); 171 void RequestSort();
172 void SortConnections(); 172 void SortConnections();
173 void SwitchBestConnectionTo(Connection* conn); 173 void SwitchBestConnectionTo(Connection* conn);
174 void UpdateChannelState(); 174 void UpdateChannelState();
175 void HandleWritable(); 175 void HandleWritable();
176 void HandleNotWritable(); 176 void HandleNotWritable();
177 void HandleAllTimedOut(); 177 void HandleAllTimedOut();
178 178
179 Connection* GetBestConnectionOnNetwork(rtc::Network* network) const; 179 Connection* GetBestConnectionOnNetwork(rtc::Network* network) const;
180 bool CreateConnections(const Candidate &remote_candidate, 180 bool CreateConnections(const Candidate& remote_candidate,
181 PortInterface* origin_port, bool readable); 181 PortInterface* origin_port);
182 bool CreateConnection(PortInterface* port, const Candidate& remote_candidate, 182 bool CreateConnection(PortInterface* port,
183 PortInterface* origin_port, bool readable); 183 const Candidate& remote_candidate,
184 PortInterface* origin_port);
184 bool FindConnection(cricket::Connection* connection) const; 185 bool FindConnection(cricket::Connection* connection) const;
185 186
186 uint32 GetRemoteCandidateGeneration(const Candidate& candidate); 187 uint32 GetRemoteCandidateGeneration(const Candidate& candidate);
187 bool IsDuplicateRemoteCandidate(const Candidate& candidate); 188 bool IsDuplicateRemoteCandidate(const Candidate& candidate);
188 void RememberRemoteCandidate(const Candidate& remote_candidate, 189 void RememberRemoteCandidate(const Candidate& remote_candidate,
189 PortInterface* origin_port); 190 PortInterface* origin_port);
190 bool IsPingable(Connection* conn); 191 bool IsPingable(Connection* conn);
191 void PingConnection(Connection* conn); 192 void PingConnection(Connection* conn);
192 void AddAllocatorSession(PortAllocatorSession* session); 193 void AddAllocatorSession(PortAllocatorSession* session);
193 void AddConnection(Connection* connection); 194 void AddConnection(Connection* connection);
(...skipping 14 matching lines...) Expand all
208 void OnConnectionStateChange(Connection* connection); 209 void OnConnectionStateChange(Connection* connection);
209 void OnReadPacket(Connection *connection, const char *data, size_t len, 210 void OnReadPacket(Connection *connection, const char *data, size_t len,
210 const rtc::PacketTime& packet_time); 211 const rtc::PacketTime& packet_time);
211 void OnReadyToSend(Connection* connection); 212 void OnReadyToSend(Connection* connection);
212 void OnConnectionDestroyed(Connection *connection); 213 void OnConnectionDestroyed(Connection *connection);
213 214
214 void OnNominated(Connection* conn); 215 void OnNominated(Connection* conn);
215 216
216 virtual void OnMessage(rtc::Message *pmsg); 217 virtual void OnMessage(rtc::Message *pmsg);
217 void OnSort(); 218 void OnSort();
218 void OnPing(); 219 void OnCheckAndPing();
219
220 void OnCheckReceiving();
221 220
222 void PruneConnections(); 221 void PruneConnections();
223 Connection* best_nominated_connection() const; 222 Connection* best_nominated_connection() const;
224 223
225 P2PTransport* transport_; 224 P2PTransport* transport_;
226 PortAllocator *allocator_; 225 PortAllocator *allocator_;
227 rtc::Thread *worker_thread_; 226 rtc::Thread *worker_thread_;
228 bool incoming_only_; 227 bool incoming_only_;
229 bool waiting_for_signaling_; 228 bool waiting_for_signaling_;
230 int error_; 229 int error_;
231 std::vector<PortAllocatorSession*> allocator_sessions_; 230 std::vector<PortAllocatorSession*> allocator_sessions_;
232 std::vector<PortInterface *> ports_; 231 std::vector<PortInterface *> ports_;
233 std::vector<Connection *> connections_; 232 std::vector<Connection *> connections_;
234 Connection* best_connection_; 233 Connection* best_connection_;
235 // Connection selected by the controlling agent. This should be used only 234 // Connection selected by the controlling agent. This should be used only
236 // at controlled side when protocol type is RFC5245. 235 // at controlled side when protocol type is RFC5245.
237 Connection* pending_best_connection_; 236 Connection* pending_best_connection_;
237 Connection* next_connection_to_ping_;
238 std::vector<RemoteCandidate> remote_candidates_; 238 std::vector<RemoteCandidate> remote_candidates_;
239 bool sort_dirty_; // indicates whether another sort is needed right now 239 bool sort_dirty_; // indicates whether another sort is needed right now
240 bool was_writable_; 240 bool was_writable_;
241 typedef std::map<rtc::Socket::Option, int> OptionMap; 241 typedef std::map<rtc::Socket::Option, int> OptionMap;
242 OptionMap options_; 242 OptionMap options_;
243 std::string ice_ufrag_; 243 std::string ice_ufrag_;
244 std::string ice_pwd_; 244 std::string ice_pwd_;
245 std::string remote_ice_ufrag_; 245 std::string remote_ice_ufrag_;
246 std::string remote_ice_pwd_; 246 std::string remote_ice_pwd_;
247 IceMode remote_ice_mode_; 247 IceMode remote_ice_mode_;
248 IceRole ice_role_; 248 IceRole ice_role_;
249 uint64 tiebreaker_; 249 uint64 tiebreaker_;
250 uint32 remote_candidate_generation_; 250 uint32 remote_candidate_generation_;
251 251
252 int check_receiving_delay_; 252 int check_receiving_delay_;
253 int receiving_timeout_; 253 int receiving_timeout_;
254 int ping_delay_;
255 uint32 last_ping_sent_;
254 256
255 DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 257 DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
256 }; 258 };
257 259
258 } // namespace cricket 260 } // namespace cricket
259 261
260 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 262 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698