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

Unified Diff: remoting/protocol/webrtc_transport.cc

Issue 1500663003: Removing references to webrtc::PortAllocatorFactoryInterface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing merge conflict, and removing some dead code. 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/protocol/webrtc_transport_unittest.cc » ('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 3a6ad6ffa8bc15acac88eabc886310099870f38c..8e0ad0898c52822138c653d3b3587f6eafecaba8 100644
--- a/remoting/protocol/webrtc_transport.cc
+++ b/remoting/protocol/webrtc_transport.cc
@@ -9,6 +9,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/task_runner_util.h"
#include "jingle/glue/thread_wrapper.h"
+#include "remoting/protocol/chromium_port_allocator.h"
#include "third_party/libjingle/source/talk/app/webrtc/test/fakeconstraints.h"
#include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
#include "third_party/webrtc/modules/audio_device/include/fake_audio_device.h"
@@ -108,11 +109,10 @@ class SetSessionDescriptionObserver
} // namespace
WebrtcTransport::WebrtcTransport(
- rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
Sergey Ulanov 2015/12/04 18:54:07 Pass PortAllocator instead of PortAllocatorFactory
- port_allocator_factory,
+ const NetworkSettings& network_settings,
TransportRole role,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner)
- : port_allocator_factory_(port_allocator_factory),
+ : network_settings_(network_settings),
role_(role),
worker_task_runner_(worker_task_runner),
weak_factory_(this) {}
@@ -250,8 +250,11 @@ void WebrtcTransport::DoStart(rtc::Thread* worker_thread) {
constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp,
webrtc::MediaConstraintsInterface::kValueTrue);
+ rtc::scoped_ptr<ChromiumPortAllocator> port_allocator(
+ ChromiumPortAllocator::Create(nullptr, network_settings_).release());
Sergey Ulanov 2015/12/04 18:54:07 This is not right. This class shouldn't depend on
+
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);
@@ -473,11 +476,10 @@ void WebrtcTransport::AddPendingCandidatesIfPossible() {
WebrtcTransportFactory::WebrtcTransportFactory(
SignalStrategy* signal_strategy,
- rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
- port_allocator_factory,
+ const NetworkSettings& network_settings,
TransportRole role)
: signal_strategy_(signal_strategy),
- port_allocator_factory_(port_allocator_factory),
+ network_settings_(network_settings),
role_(role),
worker_thread_("ChromotingWebrtcWorkerThread") {
worker_thread_.StartWithOptions(
@@ -487,7 +489,7 @@ WebrtcTransportFactory::WebrtcTransportFactory(
WebrtcTransportFactory::~WebrtcTransportFactory() {}
scoped_ptr<Transport> WebrtcTransportFactory::CreateTransport() {
- return make_scoped_ptr(new WebrtcTransport(port_allocator_factory_, role_,
+ return make_scoped_ptr(new WebrtcTransport(network_settings_, role_,
worker_thread_.task_runner()));
}
« no previous file with comments | « remoting/protocol/webrtc_transport.h ('k') | remoting/protocol/webrtc_transport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698