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

Unified Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 699613002: Change DtmfSenderHandler to handle events on the signaling thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android build. Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/webrtc/media_stream_remote_video_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc/media_stream_remote_video_source.cc
diff --git a/content/renderer/media/webrtc/media_stream_remote_video_source.cc b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
index c9cb883af843142e012053f3fe11d1b5d2112eac..c74fb52a32eb94bc86d511c4b0bc70e332202bb9 100644
--- a/content/renderer/media/webrtc/media_stream_remote_video_source.cc
+++ b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
@@ -131,7 +131,12 @@ RemoteVideoSourceDelegate::DoRenderFrameOnIOThread(
MediaStreamRemoteVideoSource::Observer::Observer(
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread,
webrtc::VideoTrackInterface* track)
- : main_thread_(main_thread), track_(track), state_(track->state()) {
+ : main_thread_(main_thread),
+#if DCHECK_IS_ON
+ source_set_(false),
+#endif
+ track_(track),
+ state_(track->state()) {
track->RegisterObserver(this);
}
@@ -157,6 +162,13 @@ void MediaStreamRemoteVideoSource::Observer::SetSource(
DCHECK(main_thread_->BelongsToCurrentThread());
DCHECK(!source_);
source_ = source;
+#if DCHECK_IS_ON
+ // |source_set_| means that there is a MediaStreamRemoteVideoSource that
+ // should handle all state changes. Since an Observer is always created when
+ // a remote MediaStream changes in RemoteMediaStreamImpl::Observer::OnChanged,
+ // it can happen that an Observer is created but SetSource is never called.
+ source_set_ = true;
+#endif
}
void MediaStreamRemoteVideoSource::Observer::OnChanged() {
@@ -169,7 +181,9 @@ void MediaStreamRemoteVideoSource::Observer::OnChanged() {
void MediaStreamRemoteVideoSource::Observer::OnChangedImpl(
webrtc::MediaStreamTrackInterface::TrackState state) {
DCHECK(main_thread_->BelongsToCurrentThread());
- DCHECK(source_) << "Dropping a state change event. " << state;
+#if DCHECK_IS_ON
+ DCHECK(source_ || !source_set_) << "Dropping a state change event. " << state;
+#endif
if (source_ && state != state_)
source_->OnChanged(state);
state_ = state;
« no previous file with comments | « content/renderer/media/webrtc/media_stream_remote_video_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698