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

Unified Diff: webrtc/pc/videocapturertracksource_unittest.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_unittest.cc
diff --git a/webrtc/pc/videocapturertracksource_unittest.cc b/webrtc/pc/videocapturertracksource_unittest.cc
index 144d4b4b794288989b23f8064887d536adc57b0d..3fe726a49a03719e21ec098f9b2f7b97365fdf13 100644
--- a/webrtc/pc/videocapturertracksource_unittest.cc
+++ b/webrtc/pc/videocapturertracksource_unittest.cc
@@ -109,9 +109,8 @@ class VideoCapturerTrackSourceTest : public testing::Test {
protected:
VideoCapturerTrackSourceTest() { InitCapturer(false); }
void InitCapturer(bool is_screencast) {
- capturer_cleanup_ = std::unique_ptr<TestVideoCapturer>(
- new TestVideoCapturer(is_screencast));
- capturer_ = capturer_cleanup_.get();
+ capturer_ = new TestVideoCapturer(is_screencast);
+ capturer_cleanup_.reset(capturer_);
}
void InitScreencast() { InitCapturer(true); }
@@ -120,9 +119,8 @@ class VideoCapturerTrackSourceTest : public testing::Test {
void CreateVideoCapturerSource(
const webrtc::MediaConstraintsInterface* constraints) {
- // VideoSource take ownership of |capturer_|
source_ = VideoCapturerTrackSource::Create(rtc::Thread::Current(),
- capturer_cleanup_.release(),
+ std::move(capturer_cleanup_),
constraints, false);
ASSERT_TRUE(source_.get() != NULL);
@@ -132,7 +130,7 @@ class VideoCapturerTrackSourceTest : public testing::Test {
source_->AddOrUpdateSink(&renderer_, rtc::VideoSinkWants());
}
- std::unique_ptr<TestVideoCapturer> capturer_cleanup_;
+ std::unique_ptr<cricket::VideoCapturer> capturer_cleanup_;
TestVideoCapturer* capturer_;
cricket::FakeVideoRenderer renderer_;
std::unique_ptr<StateObserver> state_observer_;

Powered by Google App Engine
This is Rietveld 408576698