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

Unified Diff: remoting/protocol/webrtc_transport.cc

Issue 1571943002: Simplify PortAllocatorBase and make PortAllocator creation synchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « remoting/protocol/webrtc_transport.h ('k') | remoting/test/fake_port_allocator.h » ('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 0950e7c2ffed0546dd9bec8e18b93391d1df5410..cf3235e38addeb1e45118184933dd44f3cf8840f 100644
--- a/remoting/protocol/webrtc_transport.cc
+++ b/remoting/protocol/webrtc_transport.cc
@@ -122,21 +122,15 @@ void WebrtcTransport::Start(
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(send_transport_info_callback_.is_null());
- send_transport_info_callback_ = std::move(send_transport_info_callback);
-
- // TODO(sergeyu): Use the |authenticator| to authenticate PeerConnection.
-
- transport_context_->CreatePortAllocator(base::Bind(
- &WebrtcTransport::OnPortAllocatorCreated, weak_factory_.GetWeakPtr()));
-}
-
-void WebrtcTransport::OnPortAllocatorCreated(
- scoped_ptr<cricket::PortAllocator> port_allocator) {
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
// TODO(sergeyu): Investigate if it's possible to avoid Send().
jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true);
+ send_transport_info_callback_ = std::move(send_transport_info_callback);
+
+ // TODO(sergeyu): Use the |authenticator| to authenticate PeerConnection.
+
fake_audio_device_module_.reset(new webrtc::FakeAudioDeviceModule());
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
@@ -152,6 +146,9 @@ void WebrtcTransport::OnPortAllocatorCreated(
constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp,
webrtc::MediaConstraintsInterface::kValueTrue);
+ scoped_ptr<cricket::PortAllocator> port_allocator =
+ transport_context_->port_allocator_factory()->CreatePortAllocator(
+ transport_context_);
peer_connection_ = peer_connection_factory_->CreatePeerConnection(
rtc_config, &constraints,
rtc::scoped_ptr<cricket::PortAllocator>(port_allocator.release()),
« no previous file with comments | « remoting/protocol/webrtc_transport.h ('k') | remoting/test/fake_port_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698