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

Unified Diff: remoting/protocol/webrtc_transport.cc

Issue 1516163002: Reland of Removing references to webrtc::PortAllocatorFactoryInterface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « remoting/protocol/webrtc_transport.h ('k') | remoting/remoting_srcs.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « remoting/protocol/webrtc_transport.h ('k') | remoting/remoting_srcs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698