Skip to content

Commit

Permalink
[remoting] Remove GTURN support and JingleInfoRequest
Browse files Browse the repository at this point in the history
GTURN and Jingle-based ICE config fetching is not available in FTL
world, so this CL removes them and does a few other cleanups.

Bug: 983282
Change-Id: I2dba40fabfacd8a214d42c67f3f260267a4bca51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699521
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677062}
  • Loading branch information
ywh233 authored and Commit Bot committed Jul 12, 2019
1 parent 2cd325a commit 5bc831e
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 236 deletions.
4 changes: 1 addition & 3 deletions remoting/client/chromoting_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ void ChromotingClient::Start(
#endif
} else {
DCHECK(protocol_config_->ice_supported());
bool use_turn_api = SignalingAddress(host_jid).channel() ==
SignalingAddress::Channel::FTL;
connection_.reset(new protocol::IceConnectionToHost(use_turn_api));
connection_.reset(new protocol::IceConnectionToHost());
}
}
connection_->set_client_stub(this);
Expand Down
1 change: 0 additions & 1 deletion remoting/client/chromoting_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ void ChromotingSession::Core::ConnectOnNetworkThread() {

scoped_refptr<protocol::TransportContext> transport_context =
new protocol::TransportContext(
signaling_.get(),
std::make_unique<protocol::ChromiumPortAllocatorFactory>(),
std::make_unique<ChromiumUrlRequestFactory>(
runtime_->url_loader_factory()),
Expand Down
5 changes: 1 addition & 4 deletions remoting/host/chromoting_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "remoting/protocol/native_ip_synthesizer.h"
#include "remoting/protocol/transport_context.h"
#include "remoting/protocol/webrtc_connection_to_client.h"
#include "remoting/signaling/signaling_address.h"

using remoting::protocol::ConnectionToClient;
using remoting::protocol::InputStub;
Expand Down Expand Up @@ -244,11 +243,9 @@ void ChromotingHost::OnIncomingSession(
base::WrapUnique(session), transport_context_,
video_encode_task_runner_, audio_task_runner_));
} else {
SignalingAddress address(session->jid());
bool use_turn_api = address.channel() == SignalingAddress::Channel::FTL;
connection.reset(new protocol::IceConnectionToClient(
base::WrapUnique(session), transport_context_,
video_encode_task_runner_, audio_task_runner_, use_turn_api));
video_encode_task_runner_, audio_task_runner_));
}

// Create a ClientSession object.
Expand Down
1 change: 0 additions & 1 deletion remoting/host/it2me/it2me_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ void It2MeHost::ConnectOnNetworkThread(

scoped_refptr<protocol::TransportContext> transport_context =
new protocol::TransportContext(
signal_strategy_.get(),
base::WrapUnique(new protocol::ChromiumPortAllocatorFactory()),
base::WrapUnique(new ChromiumUrlRequestFactory(
host_context_->url_loader_factory())),
Expand Down
1 change: 0 additions & 1 deletion remoting/host/remoting_me2me_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,6 @@ void HostProcess::StartHost() {

scoped_refptr<protocol::TransportContext> transport_context =
new protocol::TransportContext(
signal_strategy_.get(),
std::make_unique<protocol::ChromiumPortAllocatorFactory>(),
std::make_unique<ChromiumUrlRequestFactory>(
context_->url_loader_factory()),
Expand Down
2 changes: 0 additions & 2 deletions remoting/protocol/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ static_library("protocol") {
"input_stub.h",
"it2me_host_authenticator_factory.cc",
"it2me_host_authenticator_factory.h",
"jingle_info_request.cc",
"jingle_info_request.h",
"jingle_messages.cc",
"jingle_messages.h",
"jingle_session.cc",
Expand Down
4 changes: 2 additions & 2 deletions remoting/protocol/connection_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ class ConnectionTest : public testing::Test,
base::WrapUnique(host_session_),
TransportContext::ForTests(protocol::TransportRole::SERVER),
scoped_task_environment_.GetMainThreadTaskRunner(),
scoped_task_environment_.GetMainThreadTaskRunner(), false));
client_connection_.reset(new IceConnectionToHost(false));
scoped_task_environment_.GetMainThreadTaskRunner()));
client_connection_.reset(new IceConnectionToHost());
}

// Setup host side.
Expand Down
5 changes: 2 additions & 3 deletions remoting/protocol/ice_connection_to_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ IceConnectionToClient::IceConnectionToClient(
std::unique_ptr<protocol::Session> session,
scoped_refptr<TransportContext> transport_context,
scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
bool use_turn_api)
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner)
: event_handler_(nullptr),
session_(std::move(session)),
video_encode_task_runner_(std::move(video_encode_task_runner)),
audio_task_runner_(std::move(audio_task_runner)),
transport_(transport_context, this, use_turn_api),
transport_(transport_context, this),
control_dispatcher_(new HostControlDispatcher()),
event_dispatcher_(new HostEventDispatcher()),
video_dispatcher_(new HostVideoDispatcher()) {
Expand Down
3 changes: 1 addition & 2 deletions remoting/protocol/ice_connection_to_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class IceConnectionToClient : public ConnectionToClient,
std::unique_ptr<Session> session,
scoped_refptr<TransportContext> transport_context,
scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
bool use_turn_api);
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner);
~IceConnectionToClient() override;

// ConnectionToClient interface.
Expand Down
5 changes: 2 additions & 3 deletions remoting/protocol/ice_connection_to_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
namespace remoting {
namespace protocol {

IceConnectionToHost::IceConnectionToHost(bool use_turn_api)
: use_turn_api_(use_turn_api) {}
IceConnectionToHost::IceConnectionToHost() = default;

IceConnectionToHost::~IceConnectionToHost() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
Expand All @@ -42,7 +41,7 @@ void IceConnectionToHost::Connect(
DCHECK(clipboard_stub_);
DCHECK(video_renderer_);

transport_.reset(new IceTransport(transport_context, this, use_turn_api_));
transport_.reset(new IceTransport(transport_context, this));

session_ = std::move(session);
session_->SetEventHandler(this);
Expand Down
6 changes: 1 addition & 5 deletions remoting/protocol/ice_connection_to_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class IceConnectionToHost : public ConnectionToHost,
public IceTransport::EventHandler,
public ChannelDispatcherBase::EventHandler {
public:
IceConnectionToHost(bool use_turn_api);
IceConnectionToHost();
~IceConnectionToHost() override;

// ConnectionToHost interface.
Expand Down Expand Up @@ -106,10 +106,6 @@ class IceConnectionToHost : public ConnectionToHost,
State state_ = INITIALIZING;
ErrorCode error_ = OK;

// If this is true, ICE connection will use TURN API instead of the gTalk TURN
// services to allocate relay sessions.
bool use_turn_api_;

private:
SEQUENCE_CHECKER(sequence_checker_);

Expand Down
6 changes: 1 addition & 5 deletions remoting/protocol/ice_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ const int kTransportInfoSendDelayMs = 20;
static const char kMuxChannelName[] = "mux";

IceTransport::IceTransport(scoped_refptr<TransportContext> transport_context,
EventHandler* event_handler,
bool use_turn_api)
EventHandler* event_handler)
: transport_context_(transport_context),
event_handler_(event_handler),
weak_factory_(this) {
transport_context_->set_relay_mode(use_turn_api
? TransportContext::RelayMode::TURN
: TransportContext::RelayMode::GTURN);
transport_context->Prepare();
}

Expand Down
6 changes: 1 addition & 5 deletions remoting/protocol/ice_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ class IceTransport : public Transport,
};

// |transport_context| must outlive the session.
// If |use_turn_api| is true, ICE connection will use TURN API instead of the
// gTalk TURN services to allocate relay sessions.
// TODO(yuweih): Remove |use_turn_api| once the XMPP->FTL transition is done.
IceTransport(scoped_refptr<TransportContext> transport_context,
EventHandler* event_handler,
bool use_turn_api);
EventHandler* event_handler);
~IceTransport() override;

MessageChannelFactory* GetChannelFactory();
Expand Down
10 changes: 4 additions & 6 deletions remoting/protocol/ice_transport_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,18 @@ class IceTransportTest : public testing::Test {
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();

host_transport_.reset(new IceTransport(
new TransportContext(nullptr,
std::make_unique<ChromiumPortAllocatorFactory>(),
new TransportContext(std::make_unique<ChromiumPortAllocatorFactory>(),
nullptr, network_settings_, TransportRole::SERVER),
&host_event_handler_, false));
&host_event_handler_));
if (!host_authenticator_) {
host_authenticator_.reset(
new FakeAuthenticator(FakeAuthenticator::ACCEPT));
}

client_transport_.reset(new IceTransport(
new TransportContext(nullptr,
std::make_unique<ChromiumPortAllocatorFactory>(),
new TransportContext(std::make_unique<ChromiumPortAllocatorFactory>(),
nullptr, network_settings_, TransportRole::CLIENT),
&client_event_handler_, false));
&client_event_handler_));
if (!client_authenticator_) {
client_authenticator_.reset(
new FakeAuthenticator(FakeAuthenticator::ACCEPT));
Expand Down
115 changes: 0 additions & 115 deletions remoting/protocol/jingle_info_request.cc

This file was deleted.

50 changes: 0 additions & 50 deletions remoting/protocol/jingle_info_request.h

This file was deleted.

Loading

0 comments on commit 5bc831e

Please sign in to comment.