diff --git a/pc/peerconnectionwrapper.cc b/pc/peerconnectionwrapper.cc index ddfa5a6907..14308b5789 100644 --- a/pc/peerconnectionwrapper.cc +++ b/pc/peerconnectionwrapper.cc @@ -18,6 +18,7 @@ #include "api/jsepsessiondescription.h" #include "media/base/fakevideocapturer.h" #include "pc/sdputils.h" +#include "rtc_base/function_view.h" #include "rtc_base/gunit.h" #include "rtc_base/ptr_util.h" @@ -31,7 +32,9 @@ PeerConnectionWrapper::PeerConnectionWrapper( rtc::scoped_refptr pc_factory, rtc::scoped_refptr pc, std::unique_ptr observer) - : pc_factory_(pc_factory), observer_(std::move(observer)), pc_(pc) { + : pc_factory_(std::move(pc_factory)), + observer_(std::move(observer)), + pc_(std::move(pc)) { RTC_DCHECK(pc_factory_); RTC_DCHECK(pc_); RTC_DCHECK(observer_); @@ -118,7 +121,7 @@ PeerConnectionWrapper::CreateAnswerAndSetAsLocal( } std::unique_ptr PeerConnectionWrapper::CreateSdp( - std::function fn, + rtc::FunctionView fn, std::string* error_out) { rtc::scoped_refptr observer( new rtc::RefCountedObject()); @@ -151,7 +154,7 @@ bool PeerConnectionWrapper::SetRemoteDescription( } bool PeerConnectionWrapper::SetSdp( - std::function fn, + rtc::FunctionView fn, std::string* error_out) { rtc::scoped_refptr observer( new rtc::RefCountedObject()); @@ -168,7 +171,7 @@ rtc::scoped_refptr PeerConnectionWrapper::AddAudioTrack( std::vector streams) { auto media_stream_track = pc_factory()->CreateAudioTrack(track_label, nullptr); - return pc()->AddTrack(media_stream_track, streams); + return pc()->AddTrack(media_stream_track, std::move(streams)); } rtc::scoped_refptr PeerConnectionWrapper::AddVideoTrack( @@ -178,7 +181,7 @@ rtc::scoped_refptr PeerConnectionWrapper::AddVideoTrack( rtc::MakeUnique()); auto media_stream_track = pc_factory()->CreateVideoTrack(track_label, video_source); - return pc()->AddTrack(media_stream_track, streams); + return pc()->AddTrack(media_stream_track, std::move(streams)); } PeerConnectionInterface::SignalingState diff --git a/pc/peerconnectionwrapper.h b/pc/peerconnectionwrapper.h index 2554f1f499..ca805a3c13 100644 --- a/pc/peerconnectionwrapper.h +++ b/pc/peerconnectionwrapper.h @@ -18,6 +18,7 @@ #include "api/peerconnectioninterface.h" #include "pc/test/mockpeerconnectionobservers.h" +#include "rtc_base/function_view.h" namespace webrtc { @@ -117,9 +118,9 @@ class PeerConnectionWrapper { private: std::unique_ptr CreateSdp( - std::function fn, + rtc::FunctionView fn, std::string* error_out); - bool SetSdp(std::function fn, + bool SetSdp(rtc::FunctionView fn, std::string* error_out); rtc::scoped_refptr pc_factory_;