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

Unified Diff: webrtc/media/engine/webrtcvideocapturerfactory.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/media/engine/webrtcvideocapturerfactory.cc
diff --git a/webrtc/media/engine/webrtcvideocapturerfactory.cc b/webrtc/media/engine/webrtcvideocapturerfactory.cc
index 3cf360953b9d9190d2d454610107fb54534f43f5..6ee361a0dfe1090f643d4330d60a72fcab5be07a 100644
--- a/webrtc/media/engine/webrtcvideocapturerfactory.cc
+++ b/webrtc/media/engine/webrtcvideocapturerfactory.cc
@@ -15,16 +15,17 @@
namespace cricket {
-VideoCapturer* WebRtcVideoDeviceCapturerFactory::Create(const Device& device) {
+std::unique_ptr<VideoCapturer> WebRtcVideoDeviceCapturerFactory::Create(
+ const Device& device) {
#ifdef HAVE_WEBRTC_VIDEO
std::unique_ptr<WebRtcVideoCapturer> capturer(
new WebRtcVideoCapturer());
if (!capturer->Init(device)) {
- return nullptr;
+ return std::unique_ptr<VideoCapturer>();
}
- return capturer.release();
+ return std::move(capturer);
#else
- return nullptr;
+ return std::unique_ptr<VideoCapturer>();
#endif
}

Powered by Google App Engine
This is Rietveld 408576698