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

Unified Diff: webrtc/pc/channelmanager.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/channelmanager.cc
diff --git a/webrtc/pc/channelmanager.cc b/webrtc/pc/channelmanager.cc
index d0957a7b55f507af873a4b8b554c78865977408f..d8ecc9a7d8e3f2d181e62a82642031a5da0326b0 100644
--- a/webrtc/pc/channelmanager.cc
+++ b/webrtc/pc/channelmanager.cc
@@ -28,28 +28,26 @@ namespace cricket {
using rtc::Bind;
-static DataEngineInterface* ConstructDataEngine() {
- return new RtpDataEngine();
-}
-
-ChannelManager::ChannelManager(MediaEngineInterface* me,
- DataEngineInterface* dme,
+ChannelManager::ChannelManager(std::unique_ptr<MediaEngineInterface> me,
+ std::unique_ptr<DataEngineInterface> dme,
rtc::Thread* thread) {
- Construct(me, dme, thread, thread);
+ Construct(std::move(me), std::move(dme), thread, thread);
}
-ChannelManager::ChannelManager(MediaEngineInterface* me,
+ChannelManager::ChannelManager(std::unique_ptr<MediaEngineInterface> me,
rtc::Thread* worker_thread,
rtc::Thread* network_thread) {
- Construct(me, ConstructDataEngine(), worker_thread, network_thread);
+ Construct(std::move(me),
+ std::unique_ptr<DataEngineInterface>(new RtpDataEngine()),
+ worker_thread, network_thread);
}
-void ChannelManager::Construct(MediaEngineInterface* me,
- DataEngineInterface* dme,
+void ChannelManager::Construct(std::unique_ptr<MediaEngineInterface> me,
+ std::unique_ptr<DataEngineInterface> dme,
rtc::Thread* worker_thread,
rtc::Thread* network_thread) {
- media_engine_.reset(me);
- data_media_engine_.reset(dme);
+ media_engine_ = std::move(me);
+ data_media_engine_ = std::move(dme);
initialized_ = false;
main_thread_ = rtc::Thread::Current();
worker_thread_ = worker_thread;

Powered by Google App Engine
This is Rietveld 408576698