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

Unified Diff: remoting/host/chromoting_host.cc

Issue 1506383004: Enable WebRTC support in the remoting host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webrtc_protocol
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 | « no previous file | remoting/host/chromoting_host_unittest.cc » ('j') | remoting/host/host_status_logger.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index c640cdb29baeb0e97c7d272c9a915e6bbec6c7a8..e951e9cce50d10ee16e1edea61c7d3360a568c0f 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -22,6 +22,7 @@
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/ice_connection_to_client.h"
#include "remoting/protocol/input_stub.h"
+#include "remoting/protocol/webrtc_connection_to_client.h"
using remoting::protocol::ConnectionToClient;
using remoting::protocol::InputStub;
@@ -273,23 +274,24 @@ void ChromotingHost::OnIncomingSession(
HOST_LOG << "Client connected: " << session->jid();
- // Create a client object.
- scoped_ptr<protocol::ConnectionToClient> connection(
- new protocol::IceConnectionToClient(make_scoped_ptr(session),
- video_encode_task_runner_));
+ // Create either IceConnectionToClient or WebrtcConnectionToClient.
+ // TODO(sergeyu): Move this logic to the protocol layer.
+ scoped_ptr<protocol::ConnectionToClient> connection;
+ if (session->config().protocol() ==
+ protocol::SessionConfig::Protocol::WEBRTC) {
+ connection.reset(
+ new protocol::WebrtcConnectionToClient(make_scoped_ptr(session)));
+ } else {
+ connection.reset(new protocol::IceConnectionToClient(
+ make_scoped_ptr(session), video_encode_task_runner_));
+ }
+
+ // Create a ClientSession object.
ClientSession* client = new ClientSession(
- this,
- audio_task_runner_,
- input_task_runner_,
- video_capture_task_runner_,
- video_encode_task_runner_,
- network_task_runner_,
- ui_task_runner_,
- connection.Pass(),
- desktop_environment_factory_,
- max_session_duration_,
- pairing_registry_,
- extensions_.get());
+ this, audio_task_runner_, input_task_runner_, video_capture_task_runner_,
+ video_encode_task_runner_, network_task_runner_, ui_task_runner_,
+ connection.Pass(), desktop_environment_factory_, max_session_duration_,
+ pairing_registry_, extensions_.get());
clients_.push_back(client);
}
« no previous file with comments | « no previous file | remoting/host/chromoting_host_unittest.cc » ('j') | remoting/host/host_status_logger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698