Skip to content

Commit

Permalink
[remoting] Cleanup (Muxing|Xmpp)SignalStrategy
Browse files Browse the repository at this point in the history
This CL Removes MuxingSignalStrategy, XmppSignalStrategy, and other
unused classes, constants, and command line parameters from the code
base.

Bug: 983282
Change-Id: Iedaed704368ca90f01c3aff7cd11cd73e4a8bc79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703363
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Auto-Submit: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677726}
  • Loading branch information
ywh233 authored and Commit Bot committed Jul 16, 2019
1 parent 2c7f32d commit 78d03ff
Show file tree
Hide file tree
Showing 23 changed files with 7 additions and 3,177 deletions.
16 changes: 0 additions & 16 deletions remoting/base/service_urls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// Configurable service data.
constexpr char kDirectoryBaseUrl[] = "https://www.googleapis.com/chromoting/v1";
constexpr char kGcdBaseUrl[] = "https://www.googleapis.com/clouddevices/v1";
constexpr char kXmppServerAddress[] = "talk.google.com:443";
constexpr char kXmppServerAddressForMe2MeHost[] = "talk.google.com:5222";
constexpr bool kXmppServerUseTls = true;
constexpr char kGcdJid[] = "clouddevices.gserviceaccount.com";
constexpr char kFtlServerEndpoint[] = "instantmessaging-pa.googleapis.com";
constexpr char kRemotingServerEndpoint[] = "remotedesktop-pa.googleapis.com";
Expand All @@ -23,8 +20,6 @@ constexpr char kRemotingServerEndpoint[] = "remotedesktop-pa.googleapis.com";
#if !defined(NDEBUG)
constexpr char kDirectoryBaseUrlSwitch[] = "directory-base-url";
constexpr char kGcdBaseUrlSwitch[] = "gcd-base-url";
constexpr char kXmppServerAddressSwitch[] = "xmpp-server-address";
constexpr char kXmppServerDisableTlsSwitch[] = "disable-xmpp-server-tls";
constexpr char kDirectoryBotJidSwitch[] = "directory-bot-jid";
constexpr char kGcdJidSwitch[] = "gcd-jid";
constexpr char kFtlServerEndpointSwitch[] = "ftl-server-endpoint";
Expand All @@ -40,9 +35,6 @@ namespace remoting {
ServiceUrls::ServiceUrls()
: directory_base_url_(kDirectoryBaseUrl),
gcd_base_url_(kGcdBaseUrl),
xmpp_server_address_(kXmppServerAddress),
xmpp_server_address_for_me2me_host_(kXmppServerAddressForMe2MeHost),
xmpp_server_use_tls_(kXmppServerUseTls),
directory_bot_jid_(kRemotingBotJid),
gcd_jid_(kGcdJid),
ftl_server_endpoint_(kFtlServerEndpoint),
Expand All @@ -60,14 +52,6 @@ ServiceUrls::ServiceUrls()
if (command_line->HasSwitch(kGcdBaseUrlSwitch)) {
gcd_base_url_ = command_line->GetSwitchValueASCII(kGcdBaseUrlSwitch);
}
if (command_line->HasSwitch(kXmppServerAddressSwitch)) {
xmpp_server_address_ =
command_line->GetSwitchValueASCII(kXmppServerAddressSwitch);
xmpp_server_address_for_me2me_host_ = xmpp_server_address_;
}
if (command_line->HasSwitch(kXmppServerDisableTlsSwitch)) {
xmpp_server_use_tls_ = false;
}
if (command_line->HasSwitch(kDirectoryBotJidSwitch)) {
directory_bot_jid_ =
command_line->GetSwitchValueASCII(kDirectoryBotJidSwitch);
Expand Down
12 changes: 0 additions & 12 deletions remoting/base/service_urls.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ class ServiceUrls {
}
const std::string& gcd_base_url() const { return gcd_base_url_; }

// XMPP Server configuration.
const std::string& xmpp_server_address() const {
return xmpp_server_address_;
}
const std::string& xmpp_server_address_for_me2me_host() const {
return xmpp_server_address_for_me2me_host_;
}
bool xmpp_server_use_tls() const { return xmpp_server_use_tls_; }

// Remoting directory bot JID (for registering hosts, logging, heartbeats).
const std::string& directory_bot_jid() const { return directory_bot_jid_; }

Expand Down Expand Up @@ -69,9 +60,6 @@ class ServiceUrls {
std::string directory_base_url_;
std::string directory_hosts_url_;
std::string gcd_base_url_;
std::string xmpp_server_address_;
std::string xmpp_server_address_for_me2me_host_;
bool xmpp_server_use_tls_;
std::string directory_bot_jid_;
std::string gcd_jid_;
std::string ice_config_url_;
Expand Down
26 changes: 4 additions & 22 deletions remoting/client/chromoting_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ namespace remoting {

namespace {

const char* const kXmppServer = "talk.google.com";
const int kXmppPort = 5222;
const bool kXmppUseTls = true;

// Default DPI to assume for old clients that use notifyClientResolution.
const int kDefaultDPI = 96;

Expand Down Expand Up @@ -489,24 +485,10 @@ void ChromotingSession::Core::ConnectOnNetworkThread() {
client_context_.get(), this, session_context_->video_renderer.get(),
session_context_->audio_player_weak_factory->GetWeakPtr()));

XmppSignalStrategy::XmppServerConfig xmpp_config;
xmpp_config.host = kXmppServer;
xmpp_config.port = kXmppPort;
xmpp_config.use_tls = kXmppUseTls;
xmpp_config.username = session_context_->info.username;
xmpp_config.auth_token = session_context_->info.auth_token;

if (!session_context_->info.host_ftl_id.empty()) {
signaling_ = std::make_unique<FtlSignalStrategy>(
runtime_->CreateOAuthTokenGetter(),
std::make_unique<FtlClientUuidDeviceIdProvider>());
logger_->SetSignalStrategyType(ChromotingEvent::SignalStrategyType::FTL);
} else {
signaling_ = std::make_unique<XmppSignalStrategy>(
net::ClientSocketFactory::GetDefaultFactory(),
runtime_->url_requester(), xmpp_config);
logger_->SetSignalStrategyType(ChromotingEvent::SignalStrategyType::XMPP);
}
signaling_ = std::make_unique<FtlSignalStrategy>(
runtime_->CreateOAuthTokenGetter(),
std::make_unique<FtlClientUuidDeviceIdProvider>());
logger_->SetSignalStrategyType(ChromotingEvent::SignalStrategyType::FTL);

token_getter_ = runtime_->CreateOAuthTokenGetter();

Expand Down
2 changes: 1 addition & 1 deletion remoting/client/chromoting_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "remoting/protocol/clipboard_stub.h"
#include "remoting/protocol/cursor_shape_stub.h"
#include "remoting/signaling/ftl_device_id_provider.h"
#include "remoting/signaling/xmpp_signal_strategy.h"
#include "remoting/signaling/signal_strategy.h"

namespace remoting {

Expand Down
2 changes: 1 addition & 1 deletion remoting/host/heartbeat_sender_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class HeartbeatSenderTest : public testing::Test, public LogToServer {

ServerLogEntry::Mode mode() const override { return ServerLogEntry::ME2ME; }

// |heartbeat_sender_| must be deleted before |muxing_signal_strategy_|.
// |heartbeat_sender_| must be deleted before |signal_strategy_|.
std::unique_ptr<HeartbeatSender> heartbeat_sender_;

FakeOAuthTokenGetter oauth_token_getter_{OAuthTokenGetter::Status::SUCCESS,
Expand Down
2 changes: 1 addition & 1 deletion remoting/host/it2me/it2me_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "remoting/protocol/errors.h"
#include "remoting/protocol/port_range.h"
#include "remoting/protocol/validating_authenticator.h"
#include "remoting/signaling/xmpp_signal_strategy.h"
#include "remoting/signaling/signal_strategy.h"

namespace base {
class DictionaryValue;
Expand Down
192 changes: 0 additions & 192 deletions remoting/host/signaling_connector.cc

This file was deleted.

Loading

0 comments on commit 78d03ff

Please sign in to comment.