Index: remoting/protocol/webrtc_transport.cc |
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc |
index 253293eb264e887fbee46702da8e65b042d09207..2c82aabb9fdd1a4f601f96ab26e3c9a9cbcb04da 100644 |
--- a/remoting/protocol/webrtc_transport.cc |
+++ b/remoting/protocol/webrtc_transport.cc |
@@ -99,11 +99,9 @@ class SetSessionDescriptionObserver |
} // namespace |
-WebrtcTransport::WebrtcTransport( |
- rtc::Thread* worker_thread, |
- rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface> |
- port_allocator_factory, |
- TransportRole role) |
+WebrtcTransport::WebrtcTransport(rtc::Thread* worker_thread, |
+ PortAllocatorFactory* port_allocator_factory, |
+ TransportRole role) |
: port_allocator_factory_(port_allocator_factory), |
role_(role), |
worker_thread_(worker_thread), |
@@ -138,8 +136,11 @@ void WebrtcTransport::Start(EventHandler* event_handler, |
constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
webrtc::MediaConstraintsInterface::kValueTrue); |
+ rtc::scoped_ptr<cricket::PortAllocator> port_allocator( |
+ port_allocator_factory_->CreatePortAllocator()); |
+ |
peer_connection_ = peer_connection_factory_->CreatePeerConnection( |
- rtc_config, &constraints, port_allocator_factory_, nullptr, this); |
+ rtc_config, &constraints, std::move(port_allocator), nullptr, this); |
data_stream_adapter_.Initialize(peer_connection_, |
role_ == TransportRole::SERVER); |
@@ -488,19 +489,18 @@ void WebrtcTransport::AddPendingCandidatesIfPossible() { |
WebrtcTransportFactory::WebrtcTransportFactory( |
rtc::Thread* worker_thread, |
SignalStrategy* signal_strategy, |
- rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface> |
- port_allocator_factory, |
+ scoped_ptr<PortAllocatorFactory> port_allocator_factory, |
TransportRole role) |
: worker_thread_(worker_thread), |
signal_strategy_(signal_strategy), |
- port_allocator_factory_(port_allocator_factory), |
+ port_allocator_factory_(std::move(port_allocator_factory)), |
role_(role) {} |
WebrtcTransportFactory::~WebrtcTransportFactory() {} |
scoped_ptr<Transport> WebrtcTransportFactory::CreateTransport() { |
- return make_scoped_ptr( |
- new WebrtcTransport(worker_thread_, port_allocator_factory_, role_)); |
+ return make_scoped_ptr(new WebrtcTransport( |
+ worker_thread_, port_allocator_factory_.get(), role_)); |
} |
} // namespace protocol |