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

Side by Side Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 685993006: Explicitly set the observer to null in the dtor of MediaStreamRemoteVideoSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 MediaStreamRemoteVideoSource::MediaStreamRemoteVideoSource( 192 MediaStreamRemoteVideoSource::MediaStreamRemoteVideoSource(
193 const scoped_refptr<MediaStreamRemoteVideoSource::Observer>& observer) 193 const scoped_refptr<MediaStreamRemoteVideoSource::Observer>& observer)
194 : observer_(observer), weak_factory_(this) { 194 : observer_(observer), weak_factory_(this) {
195 observer->SetSource(weak_factory_.GetWeakPtr()); 195 observer->SetSource(weak_factory_.GetWeakPtr());
196 } 196 }
197 197
198 MediaStreamRemoteVideoSource::~MediaStreamRemoteVideoSource() { 198 MediaStreamRemoteVideoSource::~MediaStreamRemoteVideoSource() {
199 DCHECK(CalledOnValidThread()); 199 DCHECK(CalledOnValidThread());
200 observer_ = nullptr;
200 } 201 }
201 202
202 void MediaStreamRemoteVideoSource::GetCurrentSupportedFormats( 203 void MediaStreamRemoteVideoSource::GetCurrentSupportedFormats(
203 int max_requested_width, 204 int max_requested_width,
204 int max_requested_height, 205 int max_requested_height,
205 double max_requested_frame_rate, 206 double max_requested_frame_rate,
206 const VideoCaptureDeviceFormatsCB& callback) { 207 const VideoCaptureDeviceFormatsCB& callback) {
207 DCHECK(CalledOnValidThread()); 208 DCHECK(CalledOnValidThread());
208 media::VideoCaptureFormats formats; 209 media::VideoCaptureFormats formats;
209 // Since the remote end is free to change the resolution at any point in time 210 // Since the remote end is free to change the resolution at any point in time
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 case webrtc::MediaStreamTrackInterface::kEnded: 247 case webrtc::MediaStreamTrackInterface::kEnded:
247 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); 248 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded);
248 break; 249 break;
249 default: 250 default:
250 NOTREACHED(); 251 NOTREACHED();
251 break; 252 break;
252 } 253 }
253 } 254 }
254 255
255 } // namespace content 256 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698