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

Unified Diff: content/renderer/media/user_media_client_impl.cc

Issue 843943002: Refactor VideoCapturerDelegate to use WeakPtr instead of refcount. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And make it right. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/user_media_client_impl.cc
diff --git a/content/renderer/media/user_media_client_impl.cc b/content/renderer/media/user_media_client_impl.cc
index 16d439a59966ee51186e2218f52d7db263dd5cf0..8bf45f5528198922554e1787859a5fabbd2e96e9 100644
--- a/content/renderer/media/user_media_client_impl.cc
+++ b/content/renderer/media/user_media_client_impl.cc
@@ -580,10 +580,11 @@ void UserMediaClientImpl::InitializeSourceObject(
MediaStreamVideoSource* UserMediaClientImpl::CreateVideoSource(
const StreamDeviceInfo& device,
const MediaStreamSource::SourceStoppedCallback& stop_callback) {
+ scoped_ptr<VideoCapturerDelegate> delegate(new VideoCapturerDelegate(device));
return new content::MediaStreamVideoCapturerSource(
device,
stop_callback,
- new VideoCapturerDelegate(device));
+ delegate.Pass());
}
void UserMediaClientImpl::CreateVideoTracks(

Powered by Google App Engine
This is Rietveld 408576698