Skip to content

Commit

Permalink
Reland "Refactor rtc_base build targets."
Browse files Browse the repository at this point in the history
This is a reland of 69241a9

Fix: The problem was related to NO_MAIN_THREAD_WRAPPING, which
affects https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/rtc_base/thread.cc;l=257-263;drc=7acc2d9fe3a6e3c4d8881d2bdfc9b8968a724cd5.
The original CL didn't attach the definition of the macro
NO_MAIN_THREAD_WRAPPING when building for Chromium (which doesn't have
to be related to //rtc_base anymore but to //rtc_base:threading).

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

Bug: webrtc:9987
Change-Id: I7cdf49d2aac8357f1f50f90010bf2c2f62fa19f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202021
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33001}
  • Loading branch information
MirkoBonadei authored and Commit Bot committed Jan 15, 2021
1 parent 79d9c37 commit e5f4c6b
Show file tree
Hide file tree
Showing 44 changed files with 676 additions and 344 deletions.
11 changes: 11 additions & 0 deletions api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if (!build_with_chromium) {
"../pc:peerconnection",
"../rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:threading",
"audio:audio_mixer_api",
"audio_codecs:audio_codecs_api",
"task_queue:default_task_queue_factory",
Expand Down Expand Up @@ -174,6 +175,7 @@ rtc_library("libjingle_peerconnection_api") {
":rtp_parameters",
":rtp_transceiver_direction",
":scoped_refptr",
"../rtc_base:network_constants",
"adaptation:resource_adaptation_api",
"audio:audio_mixer_api",
"audio_codecs:audio_codecs_api",
Expand Down Expand Up @@ -204,7 +206,10 @@ rtc_library("libjingle_peerconnection_api") {
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:deprecation",
"../rtc_base:ip_address",
"../rtc_base:rtc_base_approved",
"../rtc_base:socket_address",
"../rtc_base:threading",
"../rtc_base/system:rtc_export",
]
absl_deps = [
Expand Down Expand Up @@ -248,6 +253,7 @@ rtc_source_set("packet_socket_factory") {
"packet_socket_factory.h",
]
deps = [
"../rtc_base:async_resolver_interface",
"../rtc_base:rtc_base",
"../rtc_base/system:rtc_export",
]
Expand Down Expand Up @@ -383,6 +389,7 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
":video_quality_analyzer_api",
"../media:rtc_media_base",
"../rtc_base:rtc_base",
"../rtc_base:threading",
"rtc_event_log",
"task_queue",
"transport:network_control",
Expand Down Expand Up @@ -600,6 +607,8 @@ rtc_source_set("network_emulation_manager_api") {
":time_controller",
"../call:simulated_network",
"../rtc_base",
"../rtc_base:network_constants",
"../rtc_base:threading",
"test/network_emulation",
"units:data_rate",
"units:data_size",
Expand All @@ -617,6 +626,7 @@ rtc_source_set("time_controller") {
deps = [
"../modules/utility",
"../rtc_base",
"../rtc_base:threading",
"../rtc_base/synchronization:yield_policy",
"../system_wrappers",
"task_queue",
Expand Down Expand Up @@ -670,6 +680,7 @@ rtc_library("ice_transport_factory") {
":scoped_refptr",
"../p2p:rtc_p2p",
"../rtc_base",
"../rtc_base:threading",
"../rtc_base/system:rtc_export",
"rtc_event_log:rtc_event_log",
]
Expand Down
2 changes: 2 additions & 0 deletions api/test/network_emulation/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ rtc_library("network_emulation") {
"../..:array_view",
"../../../rtc_base",
"../../../rtc_base:checks",
"../../../rtc_base:ip_address",
"../../../rtc_base:rtc_base_approved",
"../../../rtc_base:socket_address",
"../../numerics",
"../../task_queue",
"../../units:data_rate",
Expand Down
3 changes: 3 additions & 0 deletions api/transport/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ rtc_source_set("stun_types") {
deps = [
"../../api:array_view",
"../../rtc_base:checks",
"../../rtc_base:ip_address",
"../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:socket_address",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}
Expand Down Expand Up @@ -147,6 +149,7 @@ if (rtc_include_tests) {
":stun_types",
"../../rtc_base",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:socket_address",
"../../test:test_support",
"//testing/gtest",
]
Expand Down
1 change: 1 addition & 0 deletions audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ rtc_library("audio") {
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_task_queue",
"../rtc_base:safe_minmax",
"../rtc_base:threading",
"../rtc_base/experiments:field_trial_parser",
"../rtc_base/synchronization:mutex",
"../rtc_base/synchronization:sequence_checker",
Expand Down
1 change: 1 addition & 0 deletions call/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved",
"../rtc_base:task_queue_for_test",
"../rtc_base:task_queue_for_test",
"../rtc_base:threading",
"../rtc_base/synchronization:mutex",
"../rtc_base/task_utils:repeating_task",
"../system_wrappers",
Expand Down
11 changes: 11 additions & 0 deletions examples/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ if (is_linux || is_chromeos || is_win) {
"../p2p:rtc_p2p",
"../pc:video_track_source",
"../rtc_base:checks",
"../rtc_base:net_helpers",
"../rtc_base:threading",
"../rtc_base/third_party/sigslot",
"../system_wrappers:field_trial",
"../test:field_trial",
Expand Down Expand Up @@ -777,7 +779,11 @@ if (is_linux || is_chromeos || is_win) {
"../p2p:rtc_p2p",
"../pc:rtc_pc",
"../rtc_base",
"../rtc_base:ip_address",
"../rtc_base:rtc_base_approved",
"../rtc_base:socket_address",
"../rtc_base:socket_server",
"../rtc_base:threading",
]
}
rtc_executable("stunserver") {
Expand All @@ -789,6 +795,9 @@ if (is_linux || is_chromeos || is_win) {
"../pc:rtc_pc",
"../rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:socket_address",
"../rtc_base:socket_server",
"../rtc_base:threading",
]
}
}
Expand Down Expand Up @@ -912,6 +921,8 @@ if (!build_with_chromium) {
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"../rtc_base:socket_address",
"../rtc_base:threading",
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
]
Expand Down
3 changes: 3 additions & 0 deletions examples/androidvoip/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ if (is_android) {

deps = [
":generated_jni",
"../../rtc_base:socket_address",
"../../rtc_base:socket_server",
"../../rtc_base:threading",
"//api:transport_api",
"//api/audio_codecs:audio_codecs_api",
"//api/audio_codecs:builtin_audio_decoder_factory",
Expand Down
1 change: 1 addition & 0 deletions logging/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ rtc_library("fake_rtc_event_log") {
"../api/rtc_event_log",
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:threading",
]
}

Expand Down
5 changes: 5 additions & 0 deletions media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ rtc_library("rtc_media_base") {
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_task_queue",
"../rtc_base:sanitizer",
"../rtc_base:socket",
"../rtc_base:stringutils",
"../rtc_base/synchronization:mutex",
"../rtc_base/synchronization:sequence_checker",
Expand Down Expand Up @@ -323,6 +324,7 @@ rtc_library("rtc_audio_video") {
"../rtc_base:ignore_wundef",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base:threading",
"../rtc_base/experiments:field_trial_parser",
"../rtc_base/experiments:min_video_bitrate_experiment",
"../rtc_base/experiments:normalize_simulcast_size_experiment",
Expand Down Expand Up @@ -410,6 +412,7 @@ rtc_library("rtc_data") {
"../p2p:rtc_p2p",
"../rtc_base",
"../rtc_base:rtc_base_approved",
"../rtc_base:threading",
"../rtc_base/synchronization:mutex",
"../rtc_base/task_utils:pending_task_safety_flag",
"../rtc_base/task_utils:to_queued_task",
Expand Down Expand Up @@ -486,6 +489,7 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base:threading",
"../rtc_base/synchronization:mutex",
"../rtc_base/third_party/sigslot",
"../test:test_support",
Expand Down Expand Up @@ -595,6 +599,7 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_tests_utils",
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../rtc_base:threading",
"../rtc_base/experiments:min_video_bitrate_experiment",
"../rtc_base/synchronization:mutex",
"../rtc_base/third_party/sigslot",
Expand Down
1 change: 1 addition & 0 deletions modules/audio_processing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ if (rtc_include_tests) {
"../../rtc_base:rtc_base_tests_utils",
"../../rtc_base:safe_minmax",
"../../rtc_base:task_queue_for_test",
"../../rtc_base:threading",
"../../rtc_base/synchronization:mutex",
"../../rtc_base/system:arch",
"../../rtc_base/system:file_wrapper",
Expand Down
1 change: 1 addition & 0 deletions modules/video_coding/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ rtc_library("video_coding") {
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_numerics",
"../../rtc_base:rtc_task_queue",
"../../rtc_base:threading",
"../../rtc_base/experiments:alr_experiment",
"../../rtc_base/experiments:field_trial_parser",
"../../rtc_base/experiments:jitter_upper_bound_experiment",
Expand Down
30 changes: 30 additions & 0 deletions p2p/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,17 @@ rtc_library("rtc_p2p") {
"../api/transport:stun_types",
"../logging:ice_log",
"../rtc_base",
"../rtc_base:async_resolver_interface",
"../rtc_base:async_socket",
"../rtc_base:checks",
"../rtc_base:ip_address",
"../rtc_base:net_helpers",
"../rtc_base:network_constants",
"../rtc_base:rtc_numerics",
"../rtc_base:socket",
"../rtc_base:socket_address",
"../rtc_base:socket_server",
"../rtc_base:threading",
"../rtc_base/experiments:field_trial_parser",
"../rtc_base/synchronization:sequence_checker",
"../rtc_base/system:no_unique_address",
Expand Down Expand Up @@ -148,6 +157,8 @@ if (rtc_include_tests) {
deps = [
":rtc_p2p",
"../rtc_base",
"../rtc_base:net_helpers",
"../rtc_base:threading",
]
}

Expand All @@ -173,9 +184,14 @@ if (rtc_include_tests) {
"../api/crypto:options",
"../api/transport:stun_types",
"../rtc_base",
"../rtc_base:async_resolver_interface",
"../rtc_base:async_socket",
"../rtc_base:gunit_helpers",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils",
"../rtc_base:socket_address",
"../rtc_base:socket_server",
"../rtc_base:threading",
"../rtc_base/third_party/sigslot",
"../test:test_support",
]
Expand Down Expand Up @@ -221,11 +237,18 @@ if (rtc_include_tests) {
"../api/transport:stun_types",
"../api/units:time_delta",
"../rtc_base",
"../rtc_base:async_socket",
"../rtc_base:checks",
"../rtc_base:gunit_helpers",
"../rtc_base:ip_address",
"../rtc_base:net_helpers",
"../rtc_base:network_constants",
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils",
"../rtc_base:socket",
"../rtc_base:socket_address",
"../rtc_base:testclient",
"../rtc_base:threading",
"../rtc_base/network:sent_packet",
"../rtc_base/third_party/sigslot",
"../system_wrappers:metrics",
Expand Down Expand Up @@ -256,6 +279,8 @@ rtc_library("p2p_server_utils") {
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:rtc_base_tests_utils",
"../rtc_base:socket_address",
"../rtc_base:threading",
"../rtc_base/third_party/sigslot",
]
absl_deps = [ "//third_party/abseil-cpp/absl/algorithm:container" ]
Expand All @@ -273,7 +298,11 @@ rtc_library("libstunprober") {
"../api:packet_socket_factory",
"../api/transport:stun_types",
"../rtc_base",
"../rtc_base:async_resolver_interface",
"../rtc_base:checks",
"../rtc_base:ip_address",
"../rtc_base:socket_address",
"../rtc_base:threading",
"../rtc_base/system:rtc_export",
]
}
Expand All @@ -290,6 +319,7 @@ if (rtc_include_tests) {
"../rtc_base",
"../rtc_base:checks",
"../rtc_base:gunit_helpers",
"../rtc_base:ip_address",
"../rtc_base:rtc_base_tests_utils",
"../test:test_support",
"//testing/gtest",
Expand Down
2 changes: 1 addition & 1 deletion p2p/base/basic_async_resolver_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "p2p/base/basic_async_resolver_factory.h"

#include "rtc_base/net_helpers.h"
#include "rtc_base/async_resolver.h"

namespace webrtc {

Expand Down
1 change: 1 addition & 0 deletions p2p/base/basic_packet_socket_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <string>

#include "p2p/base/async_stun_tcp_socket.h"
#include "rtc_base/async_resolver.h"
#include "rtc_base/async_tcp_socket.h"
#include "rtc_base/async_udp_socket.h"
#include "rtc_base/checks.h"
Expand Down
2 changes: 1 addition & 1 deletion p2p/base/stun_port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#include "p2p/base/connection.h"
#include "p2p/base/p2p_constants.h"
#include "p2p/base/port_allocator.h"
#include "rtc_base/async_resolver_interface.h"
#include "rtc_base/checks.h"
#include "rtc_base/helpers.h"
#include "rtc_base/ip_address.h"
#include "rtc_base/logging.h"
#include "rtc_base/net_helpers.h"
#include "rtc_base/strings/string_builder.h"

namespace cricket {
Expand Down
1 change: 1 addition & 0 deletions p2p/base/turn_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "p2p/client/basic_port_allocator.h"
#include "rtc_base/async_invoker.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/async_resolver_interface.h"
#include "rtc_base/ssl_certificate.h"

namespace webrtc {
Expand Down
Loading

0 comments on commit e5f4c6b

Please sign in to comment.