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

Unified Diff: remoting/host/cast_extension_session.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/host/cast_extension_session.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/cast_extension_session.cc
diff --git a/remoting/host/cast_extension_session.cc b/remoting/host/cast_extension_session.cc
index 1b8df914dee9adba2fb571bcde6ce0df778f3bb7..9e4b12df4ab44575c82573fbf69cd44adaaf3609 100644
--- a/remoting/host/cast_extension_session.cc
+++ b/remoting/host/cast_extension_session.cc
@@ -12,7 +12,7 @@
#include "net/url_request/url_request_context_getter.h"
#include "remoting/host/client_session.h"
#include "remoting/proto/control.pb.h"
-#include "remoting/protocol/chromium_port_allocator_factory.h"
+#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/webrtc_video_capturer_adapter.h"
#include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
@@ -50,8 +50,9 @@ const char kVideoLabel[] = "cast_video_label";
const char kStreamLabel[] = "stream_label";
// Default STUN server used to construct
-// webrtc::PeerConnectionInterface::RTCConfiguration for the PeerConnection.
-const char kDefaultStunURI[] = "stun:stun.l.google.com:19302";
+// ChromiumPortAllocator for the PeerConnection.
+const char kDefaultStunHost[] = "stun.l.google.com";
+const int kDefaultStunPort = 19302;
const char kWorkerThreadName[] = "CastExtensionSessionWorkerThread";
@@ -481,13 +482,6 @@ bool CastExtensionSession::InitializePeerConnection() {
VLOG(1) << "Created PeerConnectionFactory successfully.";
- webrtc::PeerConnectionInterface::IceServers servers;
- webrtc::PeerConnectionInterface::IceServer server;
- server.uri = kDefaultStunURI;
- servers.push_back(server);
- webrtc::PeerConnectionInterface::RTCConfiguration rtc_config;
- rtc_config.servers = servers;
-
// DTLS-SRTP is the preferred encryption method. If set to kValueFalse, the
// peer connection uses SDES. Disabling SDES as well will cause the peer
// connection to fail to connect.
@@ -497,12 +491,17 @@ bool CastExtensionSession::InitializePeerConnection() {
constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp,
webrtc::MediaConstraintsInterface::kValueTrue);
- rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
- port_allocator_factory = protocol::ChromiumPortAllocatorFactory::Create(
- network_settings_, url_request_context_getter_);
+ rtc::scoped_ptr<protocol::ChromiumPortAllocator> port_allocator(
+ protocol::ChromiumPortAllocator::Create(url_request_context_getter_,
+ network_settings_)
+ .release());
+ std::vector<rtc::SocketAddress> stun_hosts;
+ stun_hosts.push_back(rtc::SocketAddress(kDefaultStunHost, kDefaultStunPort));
+ port_allocator->SetStunHosts(stun_hosts);
+ webrtc::PeerConnectionInterface::RTCConfiguration rtc_config;
peer_connection_ = peer_conn_factory_->CreatePeerConnection(
- rtc_config, &constraints, port_allocator_factory, nullptr, this);
+ rtc_config, &constraints, port_allocator.Pass(), nullptr, this);
if (!peer_connection_.get()) {
CleanupPeerConnection();
« no previous file with comments | « remoting/host/cast_extension_session.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698