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

Unified Diff: remoting/protocol/ice_transport_channel.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/chromium_port_allocator.cc ('k') | remoting/protocol/port_allocator_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ice_transport_channel.cc
diff --git a/remoting/protocol/ice_transport_channel.cc b/remoting/protocol/ice_transport_channel.cc
index 75413d7ec45de1b499cd094de006a1e52fd61f7b..a7ab222e14891140d8ff0b1e69ce475a86dac64b 100644
--- a/remoting/protocol/ice_transport_channel.cc
+++ b/remoting/protocol/ice_transport_channel.cc
@@ -14,6 +14,7 @@
#include "jingle/glue/utils.h"
#include "net/base/net_errors.h"
#include "remoting/protocol/channel_socket_adapter.h"
+#include "remoting/protocol/port_allocator_factory.h"
#include "remoting/protocol/transport_context.h"
#include "third_party/webrtc/base/network.h"
#include "third_party/webrtc/p2p/base/constants.h"
@@ -83,16 +84,9 @@ void IceTransportChannel::Connect(const std::string& name,
delegate_ = delegate;
callback_ = callback;
- transport_context_->CreatePortAllocator(
- base::Bind(&IceTransportChannel::OnPortAllocatorCreated,
- weak_factory_.GetWeakPtr()));
-}
-
-void IceTransportChannel::OnPortAllocatorCreated(
- scoped_ptr<cricket::PortAllocator> port_allocator){
- DCHECK(!channel_.get());
-
- port_allocator_ = std::move(port_allocator);
+ port_allocator_ =
+ transport_context_->port_allocator_factory()->CreatePortAllocator(
+ transport_context_);
// Create P2PTransportChannel, attach signal handlers and connect it.
// TODO(sergeyu): Specify correct component ID for the channel.
« no previous file with comments | « remoting/protocol/chromium_port_allocator.cc ('k') | remoting/protocol/port_allocator_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698