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

Unified Diff: webrtc/pc/videocapturertracksource.cc

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: Rebase onto master Created 3 years, 10 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: webrtc/pc/videocapturertracksource.cc
diff --git a/webrtc/pc/videocapturertracksource.cc b/webrtc/pc/videocapturertracksource.cc
index 771429aecdf0ffbc4c25777bd6ca33245b36fa8e..2bb29da1145a36f46aabc1a947f279e360ba4984 100644
--- a/webrtc/pc/videocapturertracksource.cc
+++ b/webrtc/pc/videocapturertracksource.cc
@@ -258,39 +258,39 @@ namespace webrtc {
rtc::scoped_refptr<VideoTrackSourceInterface> VideoCapturerTrackSource::Create(
rtc::Thread* worker_thread,
- cricket::VideoCapturer* capturer,
+ std::unique_ptr<cricket::VideoCapturer> capturer,
const webrtc::MediaConstraintsInterface* constraints,
bool remote) {
RTC_DCHECK(worker_thread != NULL);
RTC_DCHECK(capturer != NULL);
rtc::scoped_refptr<VideoCapturerTrackSource> source(
- new rtc::RefCountedObject<VideoCapturerTrackSource>(worker_thread,
- capturer, remote));
+ new rtc::RefCountedObject<VideoCapturerTrackSource>(
+ worker_thread, std::move(capturer), remote));
source->Initialize(constraints);
return source;
}
rtc::scoped_refptr<VideoTrackSourceInterface> VideoCapturerTrackSource::Create(
rtc::Thread* worker_thread,
- cricket::VideoCapturer* capturer,
+ std::unique_ptr<cricket::VideoCapturer> capturer,
bool remote) {
RTC_DCHECK(worker_thread != NULL);
RTC_DCHECK(capturer != NULL);
rtc::scoped_refptr<VideoCapturerTrackSource> source(
- new rtc::RefCountedObject<VideoCapturerTrackSource>(worker_thread,
- capturer, remote));
+ new rtc::RefCountedObject<VideoCapturerTrackSource>(
+ worker_thread, std::move(capturer), remote));
source->Initialize(nullptr);
return source;
}
VideoCapturerTrackSource::VideoCapturerTrackSource(
rtc::Thread* worker_thread,
- cricket::VideoCapturer* capturer,
+ std::unique_ptr<cricket::VideoCapturer> capturer,
bool remote)
- : VideoTrackSource(capturer, remote),
+ : VideoTrackSource(capturer.get(), remote),
signaling_thread_(rtc::Thread::Current()),
worker_thread_(worker_thread),
- video_capturer_(capturer),
+ video_capturer_(std::move(capturer)),
started_(false) {
video_capturer_->SignalStateChange.connect(
this, &VideoCapturerTrackSource::OnStateChange);

Powered by Google App Engine
This is Rietveld 408576698