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

Side by Side Diff: talk/app/webrtc/webrtcsession.h

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments except for naming. Created 5 years, 5 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 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Called any time the IceGatheringState changes 89 // Called any time the IceGatheringState changes
90 virtual void OnIceGatheringChange( 90 virtual void OnIceGatheringChange(
91 PeerConnectionInterface::IceGatheringState new_state) {} 91 PeerConnectionInterface::IceGatheringState new_state) {}
92 // New Ice candidate have been found. 92 // New Ice candidate have been found.
93 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; 93 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0;
94 // All Ice candidates have been found. 94 // All Ice candidates have been found.
95 // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange. 95 // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange.
96 // (via PeerConnectionObserver) 96 // (via PeerConnectionObserver)
97 virtual void OnIceComplete() {} 97 virtual void OnIceComplete() {}
98 98
99 // Called anytime when all ICE transport channels becomes flaky or
100 // at least one changes back to unflaky.
101 virtual void OnIceFlakinessChange(bool flaky) {}
102
99 protected: 103 protected:
100 ~IceObserver() {} 104 ~IceObserver() {}
101 105
102 private: 106 private:
103 DISALLOW_COPY_AND_ASSIGN(IceObserver); 107 DISALLOW_COPY_AND_ASSIGN(IceObserver);
104 }; 108 };
105 109
106 class WebRtcSession : public cricket::BaseSession, 110 class WebRtcSession : public cricket::BaseSession,
107 public AudioProviderInterface, 111 public AudioProviderInterface,
108 public DataChannelFactory, 112 public DataChannelFactory,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Transport related callbacks, override from cricket::BaseSession. 295 // Transport related callbacks, override from cricket::BaseSession.
292 virtual void OnTransportRequestSignaling(cricket::Transport* transport); 296 virtual void OnTransportRequestSignaling(cricket::Transport* transport);
293 virtual void OnTransportConnecting(cricket::Transport* transport); 297 virtual void OnTransportConnecting(cricket::Transport* transport);
294 virtual void OnTransportWritable(cricket::Transport* transport); 298 virtual void OnTransportWritable(cricket::Transport* transport);
295 virtual void OnTransportCompleted(cricket::Transport* transport); 299 virtual void OnTransportCompleted(cricket::Transport* transport);
296 virtual void OnTransportFailed(cricket::Transport* transport); 300 virtual void OnTransportFailed(cricket::Transport* transport);
297 virtual void OnTransportProxyCandidatesReady( 301 virtual void OnTransportProxyCandidatesReady(
298 cricket::TransportProxy* proxy, 302 cricket::TransportProxy* proxy,
299 const cricket::Candidates& candidates); 303 const cricket::Candidates& candidates);
300 virtual void OnCandidatesAllocationDone(); 304 virtual void OnCandidatesAllocationDone();
305 void OnTransportFlaky(cricket::Transport* transport) override;
pthatcher1 2015/06/26 19:24:02 How about OnTransportReceiving?
honghaiz3 2015/08/05 23:56:56 Done.
301 306
302 // Enables media channels to allow sending of media. 307 // Enables media channels to allow sending of media.
303 void EnableChannels(); 308 void EnableChannels();
304 // Creates a JsepIceCandidate and adds it to the local session description 309 // Creates a JsepIceCandidate and adds it to the local session description
305 // and notify observers. Called when a new local candidate have been found. 310 // and notify observers. Called when a new local candidate have been found.
306 void ProcessNewLocalCandidate(const std::string& content_name, 311 void ProcessNewLocalCandidate(const std::string& content_name,
307 const cricket::Candidates& candidates); 312 const cricket::Candidates& candidates);
308 // Returns the media index for a local ice candidate given the content name. 313 // Returns the media index for a local ice candidate given the content name.
309 // Returns false if the local session description does not have a media 314 // Returns false if the local session description does not have a media
310 // content called |content_name|. 315 // content called |content_name|.
(...skipping 24 matching lines...) Expand all
335 void CopySavedCandidates(SessionDescriptionInterface* dest_desc); 340 void CopySavedCandidates(SessionDescriptionInterface* dest_desc);
336 341
337 // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN 342 // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN
338 // messages. 343 // messages.
339 void OnDataChannelMessageReceived(cricket::DataChannel* channel, 344 void OnDataChannelMessageReceived(cricket::DataChannel* channel,
340 const cricket::ReceiveDataParams& params, 345 const cricket::ReceiveDataParams& params,
341 const rtc::Buffer& payload); 346 const rtc::Buffer& payload);
342 347
343 std::string BadStateErrMsg(State state); 348 std::string BadStateErrMsg(State state);
344 void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state); 349 void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state);
350 void SetIceFlaky(bool flaky);
pthatcher1 2015/06/26 19:24:02 How about SetIceConnectionReceiving(bool receiving
honghaiz3 2015/08/05 23:56:56 Done, although not sure if I should just change it
345 351
346 bool ValidateBundleSettings(const cricket::SessionDescription* desc); 352 bool ValidateBundleSettings(const cricket::SessionDescription* desc);
347 bool HasRtcpMuxEnabled(const cricket::ContentInfo* content); 353 bool HasRtcpMuxEnabled(const cricket::ContentInfo* content);
348 // Below methods are helper methods which verifies SDP. 354 // Below methods are helper methods which verifies SDP.
349 bool ValidateSessionDescription(const SessionDescriptionInterface* sdesc, 355 bool ValidateSessionDescription(const SessionDescriptionInterface* sdesc,
350 cricket::ContentSource source, 356 cricket::ContentSource source,
351 std::string* err_desc); 357 std::string* err_desc);
352 358
353 // Check if a call to SetLocalDescription is acceptable with |action|. 359 // Check if a call to SetLocalDescription is acceptable with |action|.
354 bool ExpectSetLocalDescription(Action action); 360 bool ExpectSetLocalDescription(Action action);
(...skipping 17 matching lines...) Expand all
372 // of IPv4/IPv6 as best connection. 378 // of IPv4/IPv6 as best connection.
373 void ReportBestConnectionState(cricket::Transport* transport); 379 void ReportBestConnectionState(cricket::Transport* transport);
374 380
375 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_; 381 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_;
376 rtc::scoped_ptr<cricket::VideoChannel> video_channel_; 382 rtc::scoped_ptr<cricket::VideoChannel> video_channel_;
377 rtc::scoped_ptr<cricket::DataChannel> data_channel_; 383 rtc::scoped_ptr<cricket::DataChannel> data_channel_;
378 cricket::ChannelManager* channel_manager_; 384 cricket::ChannelManager* channel_manager_;
379 MediaStreamSignaling* mediastream_signaling_; 385 MediaStreamSignaling* mediastream_signaling_;
380 IceObserver* ice_observer_; 386 IceObserver* ice_observer_;
381 PeerConnectionInterface::IceConnectionState ice_connection_state_; 387 PeerConnectionInterface::IceConnectionState ice_connection_state_;
388 bool ice_flaky_;
pthatcher1 2015/06/26 19:24:02 How about "bool ice_connection_receiving_"?
honghaiz3 2015/08/05 23:56:56 Done.
382 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_; 389 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_;
383 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_; 390 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_;
384 // Candidates that arrived before the remote description was set. 391 // Candidates that arrived before the remote description was set.
385 std::vector<IceCandidateInterface*> saved_candidates_; 392 std::vector<IceCandidateInterface*> saved_candidates_;
386 // If the remote peer is using a older version of implementation. 393 // If the remote peer is using a older version of implementation.
387 bool older_version_remote_peer_; 394 bool older_version_remote_peer_;
388 bool dtls_enabled_; 395 bool dtls_enabled_;
389 // Specifies which kind of data channel is allowed. This is controlled 396 // Specifies which kind of data channel is allowed. This is controlled
390 // by the chrome command-line flag and constraints: 397 // by the chrome command-line flag and constraints:
391 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, 398 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled,
(...skipping 20 matching lines...) Expand all
412 PeerConnectionInterface::BundlePolicy bundle_policy_; 419 PeerConnectionInterface::BundlePolicy bundle_policy_;
413 420
414 // Declares the RTCP mux policy for the WebRTCSession. 421 // Declares the RTCP mux policy for the WebRTCSession.
415 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; 422 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_;
416 423
417 DISALLOW_COPY_AND_ASSIGN(WebRtcSession); 424 DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
418 }; 425 };
419 } // namespace webrtc 426 } // namespace webrtc
420 427
421 #endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_ 428 #endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698