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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 1800893002: Enable TURN on the host when using WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index e9245cfe593246b431367efc718b3276c58bf470..ef1c1b68ecf86d01d3d41e6c6a92bd44f43b559e 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -1510,7 +1510,7 @@ void HostProcess::StartHost() {
network_settings.port_range.max_port = NetworkSettings::kDefaultMaxPort;
}
- scoped_refptr<protocol::TransportContext> transport_context =
+ scoped_refptr<protocol::TransportContext> ice_transport_context =
new protocol::TransportContext(
signal_strategy_.get(),
make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
@@ -1518,6 +1518,8 @@ void HostProcess::StartHost() {
context_->url_request_context_getter())),
network_settings, protocol::TransportRole::SERVER);
+ scoped_refptr<protocol::TransportContext> webrtc_transport_context;
+
scoped_ptr<protocol::SessionManager> session_manager(
new protocol::JingleSessionManager(signal_strategy_.get()));
@@ -1530,13 +1532,22 @@ void HostProcess::StartHost() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kEnableWebrtcSwitchName)) {
protocol_config->set_webrtc_supported(true);
+
+ webrtc_transport_context = new protocol::TransportContext(
+ signal_strategy_.get(),
+ make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
+ make_scoped_ptr(new ChromiumUrlRequestFactory(
+ context_->url_request_context_getter())),
+ network_settings, protocol::TransportRole::SERVER);
+ webrtc_transport_context->UseTurn(
+ ServiceUrls::GetInstance()->ice_config_url());
}
session_manager->set_protocol_config(std::move(protocol_config));
- host_.reset(new ChromotingHost(desktop_environment_factory_.get(),
- std::move(session_manager), transport_context,
- context_->audio_task_runner(),
- context_->video_encode_task_runner()));
+ host_.reset(new ChromotingHost(
+ desktop_environment_factory_.get(), std::move(session_manager),
+ ice_transport_context, webrtc_transport_context,
+ context_->audio_task_runner(), context_->video_encode_task_runner()));
if (gnubby_auth_policy_enabled_ && gnubby_extension_supported_) {
host_->AddExtension(make_scoped_ptr(new GnubbyExtension()));

Powered by Google App Engine
This is Rietveld 408576698