Skip to content

Commit

Permalink
Removing the remaining NACL references from //remoting
Browse files Browse the repository at this point in the history
This is a cleanup CL which removes the NACL build rules and preprocessor
directives from //remoting.  I removed the client plugin a while ago but
missed these and I want to do some work in TransportContext which
included a NACL reference.  Once this is removed it will be easier to
clean that file up.

Change-Id: I3c3442a59e939c50f9bb825e5d020812fa072f04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186468
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766635}
  • Loading branch information
joedow-42 authored and Commit Bot committed May 7, 2020
1 parent e43c9ec commit 64f1b30
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 137 deletions.
10 changes: 0 additions & 10 deletions remoting/base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ source_set("base") {
"//third_party/webrtc_overrides:webrtc_component",
"//url",
]
if (is_nacl) {
sources -= [
"chromium_url_request.cc",
"chromoting_event.cc",
"telemetry_log_writer.cc",
"url_request_context_getter.cc",
]
public_deps -= [ "//remoting/proto/remoting/v1:telemetry_grpc_library" ]
deps -= [ "//google_apis" ]
}
}

source_set("authorization") {
Expand Down
8 changes: 3 additions & 5 deletions remoting/base/auto_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "build/build_config.h"
#include "remoting/base/auto_thread_task_runner.h"

#if defined(OS_POSIX) && !defined(OS_NACL)
#if defined(OS_POSIX)
#include "base/files/file_descriptor_watcher_posix.h"
#endif

Expand Down Expand Up @@ -213,16 +213,14 @@ void AutoThread::ThreadMain() {
// startup_data_ can't be touched anymore since the starting thread is now
// unlocked.

#if defined(OS_POSIX) && !defined(OS_NACL)
#if defined(OS_POSIX)
// Allow threads running a MessageLoopForIO to use FileDescriptorWatcher.
std::unique_ptr<base::FileDescriptorWatcher> file_descriptor_watcher;
if (single_thread_task_executor.type() == base::MessagePumpType::IO) {
file_descriptor_watcher.reset(new base::FileDescriptorWatcher(
single_thread_task_executor.task_runner()));
}
#endif

#if defined(OS_WIN)
#elif defined(OS_WIN)
// Initialize COM on the thread, if requested.
std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer(
CreateComInitializer(com_init_type_));
Expand Down
2 changes: 1 addition & 1 deletion remoting/build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config("version") {
}

config("enable_webrtc_remoting_client") {
if (!is_official_build && !is_nacl) {
if (!is_official_build) {
defines = [ "ENABLE_WEBRTC_REMOTING_CLIENT=1" ]
}
}
Expand Down
102 changes: 45 additions & 57 deletions remoting/protocol/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ static_library("protocol") {
"channel_multiplexer.h",
"channel_socket_adapter.cc",
"channel_socket_adapter.h",
"chromium_port_allocator_factory.cc",
"chromium_port_allocator_factory.h",
"chromium_socket_factory.cc",
"chromium_socket_factory.h",
"client_authentication_config.cc",
"client_authentication_config.h",
"client_control_dispatcher.cc",
Expand Down Expand Up @@ -141,6 +145,8 @@ static_library("protocol") {
"pseudotcp_channel_factory.h",
"rejecting_authenticator.cc",
"rejecting_authenticator.h",
"remoting_ice_config_request.cc",
"remoting_ice_config_request.h",
"sdp_message.cc",
"sdp_message.h",
"secure_channel_factory.cc",
Expand All @@ -149,6 +155,7 @@ static_library("protocol") {
"session_config.cc",
"session_config.h",
"session_manager.h",
"session_options_provider.h",
"session_plugin.h",
"socket_util.cc",
"socket_util.h",
Expand All @@ -159,6 +166,11 @@ static_library("protocol") {
"stream_channel_factory.h",
"stream_message_pipe_adapter.cc",
"stream_message_pipe_adapter.h",
"stream_packet_processor.h",
"stream_packet_socket.cc",
"stream_packet_socket.h",
"stun_tcp_packet_processor.cc",
"stun_tcp_packet_processor.h",
"third_party_authenticator_base.cc",
"third_party_authenticator_base.h",
"third_party_client_authenticator.cc",
Expand All @@ -178,8 +190,22 @@ static_library("protocol") {
"video_renderer.h",
"video_stats_stub.h",
"video_stub.h",
"webrtc_audio_module.cc",
"webrtc_audio_module.h",
"webrtc_audio_sink_adapter.cc",
"webrtc_audio_sink_adapter.h",
"webrtc_bandwidth_estimator.cc",
"webrtc_bandwidth_estimator.h",
"webrtc_connection_to_host.cc",
"webrtc_connection_to_host.h",
"webrtc_data_stream_adapter.cc",
"webrtc_data_stream_adapter.h",
"webrtc_dummy_video_encoder.cc",
"webrtc_dummy_video_encoder.h",
"webrtc_transport.cc",
"webrtc_transport.h",
"webrtc_video_renderer_adapter.cc",
"webrtc_video_renderer_adapter.h",
]

configs += [
Expand All @@ -199,73 +225,23 @@ static_library("protocol") {
"//net",
"//remoting/base",
"//remoting/codec:decoder",
"//remoting/proto/remoting/v1:network_traversal_grpc_library",
"//remoting/proto/remoting/v1:network_traversal_proto",
"//remoting/signaling",
"//third_party/boringssl",
"//third_party/libyuv",
"//third_party/webrtc_overrides:webrtc_component",
"//ui/events:dom_keycode_converter",
]

defines = []

if (!is_nacl) {
# This condition needs to match with //remoting/codec/BUILD.gn
if (is_win || is_linux) {
defines += [ "USE_H264_ENCODER" ]
deps += [
"//media",
"//skia",
]
}

sources += [
"chromium_port_allocator_factory.cc",
"chromium_port_allocator_factory.h",
"chromium_socket_factory.cc",
"chromium_socket_factory.h",
"remoting_ice_config_request.cc",
"remoting_ice_config_request.h",
"session_options_provider.h",
"stream_packet_processor.h",
"stream_packet_socket.cc",
"stream_packet_socket.h",
"stun_tcp_packet_processor.cc",
"stun_tcp_packet_processor.h",
"webrtc_audio_module.cc",
"webrtc_audio_module.h",
"webrtc_audio_sink_adapter.cc",
"webrtc_audio_sink_adapter.h",
"webrtc_connection_to_host.cc",
"webrtc_connection_to_host.h",
"webrtc_data_stream_adapter.cc",
"webrtc_data_stream_adapter.h",
"webrtc_dummy_video_encoder.cc",
"webrtc_dummy_video_encoder.h",
"webrtc_transport.cc",
"webrtc_transport.h",
"webrtc_video_renderer_adapter.cc",
"webrtc_video_renderer_adapter.h",
]

if (enable_remoting_host) {
sources += [
"webrtc_audio_source_adapter.cc",
"webrtc_audio_source_adapter.h",
"webrtc_audio_stream.cc",
"webrtc_audio_stream.h",
"webrtc_connection_to_client.cc",
"webrtc_connection_to_client.h",
"webrtc_frame_scheduler.h",
"webrtc_frame_scheduler_simple.cc",
"webrtc_frame_scheduler_simple.h",
"webrtc_video_stream.cc",
"webrtc_video_stream.h",
]
}

# Must match condition in //remoting/codec/BUILD.gn
if (is_win || is_linux) {
defines += [ "USE_H264_ENCODER" ]
deps += [
"//remoting/proto/remoting/v1:network_traversal_grpc_library",
"//third_party/webrtc_overrides:webrtc_component",
"//media",
"//skia",
]
}

Expand All @@ -281,7 +257,19 @@ static_library("protocol") {
"ice_connection_to_client.h",
"video_frame_pump.cc",
"video_frame_pump.h",
"webrtc_audio_source_adapter.cc",
"webrtc_audio_source_adapter.h",
"webrtc_audio_stream.cc",
"webrtc_audio_stream.h",
"webrtc_connection_to_client.cc",
"webrtc_connection_to_client.h",
"webrtc_frame_scheduler.h",
"webrtc_frame_scheduler_simple.cc",
"webrtc_frame_scheduler_simple.h",
"webrtc_video_stream.cc",
"webrtc_video_stream.h",
]

deps += [ "//remoting/codec:encoder" ]
}
}
Expand Down
20 changes: 1 addition & 19 deletions remoting/protocol/ssl_hmac_channel_authenticator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "net/cert/x509_certificate.h"
#include "net/http/transport_security_state.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/ssl_server_socket.h"
#include "net/socket/stream_socket.h"
Expand All @@ -38,12 +39,6 @@
#include "remoting/protocol/auth_util.h"
#include "remoting/protocol/p2p_stream_socket.h"

#if defined(OS_NACL)
#include "net/socket/ssl_client_socket_impl.h"
#else
#include "net/socket/client_socket_factory.h"
#endif

namespace remoting {
namespace protocol {

Expand Down Expand Up @@ -257,12 +252,6 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate(

int result;
if (is_ssl_server()) {
#if defined(OS_NACL)
// Client plugin doesn't use server SSL sockets, and so SSLServerSocket
// implementation is not compiled for NaCl as part of net_nacl.
NOTREACHED();
result = net::ERR_FAILED;
#else
scoped_refptr<net::X509Certificate> cert =
net::X509Certificate::CreateFromBytes(local_cert_.data(),
local_cert_.length());
Expand All @@ -285,7 +274,6 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate(
socket_ = std::move(server_socket);
result = raw_server_socket->Handshake(base::BindOnce(
&SslHmacChannelAuthenticator::OnConnected, base::Unretained(this)));
#endif
} else {
socket_context_.transport_security_state =
std::make_unique<net::TransportSecurityState>();
Expand Down Expand Up @@ -318,16 +306,10 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate(
net::HostPortPair host_and_port(kSslFakeHostName, 0);
std::unique_ptr<net::StreamSocket> stream_socket =
std::make_unique<NetStreamSocketAdapter>(std::move(socket));
#if defined(OS_NACL)
// net_nacl doesn't include ClientSocketFactory.
socket_ = socket_context_.client_context->CreateSSLClientSocket(
std::move(stream_socket), host_and_port, ssl_config);
#else
socket_ =
net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket(
socket_context_.client_context.get(), std::move(stream_socket),
host_and_port, ssl_config);
#endif

result = socket_->Connect(base::BindOnce(
&SslHmacChannelAuthenticator::OnConnected, base::Unretained(this)));
Expand Down
17 changes: 4 additions & 13 deletions remoting/protocol/transport_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "remoting/base/logging.h"
#include "remoting/base/url_request.h"
#include "remoting/protocol/port_allocator_factory.h"
#include "third_party/webrtc/rtc_base/socket_address.h"

#if !defined(OS_NACL)
#include "jingle/glue/thread_wrapper.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/base/logging.h"
#include "remoting/base/url_request.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/port_allocator_factory.h"
#include "remoting/protocol/remoting_ice_config_request.h"
#endif // !defined(OS_NACL)
#include "third_party/webrtc/rtc_base/socket_address.h"

namespace remoting {
namespace protocol {
Expand Down Expand Up @@ -57,7 +54,6 @@ void PrintIceConfig(const IceConfig& ice_config) {

} // namespace

#if !defined(OS_NACL)
// static
scoped_refptr<TransportContext> TransportContext::ForTests(TransportRole role) {
jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
Expand All @@ -67,7 +63,6 @@ scoped_refptr<TransportContext> TransportContext::ForTests(TransportRole role) {
protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING),
role);
}
#endif // !defined(OS_NACL)

TransportContext::TransportContext(
std::unique_ptr<PortAllocatorFactory> port_allocator_factory,
Expand Down Expand Up @@ -115,13 +110,9 @@ void TransportContext::EnsureFreshIceConfig() {

if ((base::Time::Now() + kMinimumIceConfigLifetime) >
ice_config_.expiration_time) {
#if defined(OS_NACL)
NOTREACHED() << "TURN is not supported on NACL";
#else
ice_config_request_ = std::make_unique<RemotingIceConfigRequest>();
ice_config_request_->Send(
base::BindOnce(&TransportContext::OnIceConfig, base::Unretained(this)));
#endif
}
}

Expand Down
32 changes: 0 additions & 32 deletions remoting/signaling/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -71,38 +71,6 @@ static_library("signaling") {
"//remoting/proto/remoting/v1:telemetry_messages",
"//third_party/grpc:grpcpp",
]

if (is_nacl) {
sources -= [
"ftl_client_uuid_device_id_provider.cc",
"ftl_client_uuid_device_id_provider.h",
"ftl_grpc_context.cc",
"ftl_grpc_context.h",
"ftl_host_device_id_provider.cc",
"ftl_host_device_id_provider.h",
"ftl_message_reception_channel.cc",
"ftl_message_reception_channel.h",
"ftl_messaging_client.cc",
"ftl_messaging_client.h",
"ftl_registration_manager.cc",
"ftl_registration_manager.h",
"ftl_signal_strategy.cc",
"ftl_signal_strategy.h",
"remoting_log_to_server.cc",
"remoting_log_to_server.h",
"server_log_entry.cc",
"xmpp_log_to_server.cc",
]
deps -= [
"//google_apis",
"//remoting/base/grpc_support",
"//third_party/grpc:grpcpp",
]
public_deps -= [
"//remoting/proto/ftl/v1:ftl_grpc_library",
"//remoting/proto/remoting/v1:telemetry_grpc_library",
]
}
}

static_library("test_support") {
Expand Down

0 comments on commit 64f1b30

Please sign in to comment.