Move pc/channel.h to only be used in .cc files
This is an implementation API, user classes should in principle
only use the channel_interface.h
Bug: webrtc:13931
Change-Id: I85c285217858dc087c90a50792e980f731f4439f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260185
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36674}
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index e0a9b97..e40df74 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -59,7 +59,10 @@
}
rtc_source_set("channel") {
- visibility = [ ":*" ]
+ visibility = [
+ ":*",
+ "../test/peer_scenario",
+ ]
sources = [
"channel.cc",
"channel.h",
@@ -2617,6 +2620,7 @@
]
deps = [
+ ":channel",
":channel_interface",
":jitter_buffer_delay",
":libjingle_peerconnection",
diff --git a/pc/channel_manager.cc b/pc/channel_manager.cc
index 1482d7f..9cdba42 100644
--- a/pc/channel_manager.cc
+++ b/pc/channel_manager.cc
@@ -18,6 +18,7 @@
#include "api/media_types.h"
#include "api/sequence_checker.h"
#include "media/base/media_constants.h"
+#include "pc/channel.h"
#include "rtc_base/checks.h"
#include "rtc_base/location.h"
#include "rtc_base/trace_event.h"
diff --git a/pc/channel_manager.h b/pc/channel_manager.h
index 0e95c96..b4de2d1 100644
--- a/pc/channel_manager.h
+++ b/pc/channel_manager.h
@@ -26,7 +26,6 @@
#include "media/base/media_channel.h"
#include "media/base/media_config.h"
#include "media/base/media_engine.h"
-#include "pc/channel.h"
#include "pc/channel_interface.h"
#include "pc/session_description.h"
#include "rtc_base/system/file_wrapper.h"
diff --git a/pc/channel_manager_unittest.cc b/pc/channel_manager_unittest.cc
index 7b0146c..ebc3873 100644
--- a/pc/channel_manager_unittest.cc
+++ b/pc/channel_manager_unittest.cc
@@ -17,6 +17,7 @@
#include "media/engine/fake_webrtc_call.h"
#include "p2p/base/fake_dtls_transport.h"
#include "p2p/base/p2p_constants.h"
+#include "pc/channel.h"
#include "pc/dtls_srtp_transport.h"
#include "pc/rtp_transport_internal.h"
#include "rtc_base/arraysize.h"
diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h
index e79ab05..3b7832c 100644
--- a/pc/jsep_transport_controller.h
+++ b/pc/jsep_transport_controller.h
@@ -46,7 +46,6 @@
#include "p2p/base/port_allocator.h"
#include "p2p/base/transport_description.h"
#include "p2p/base/transport_info.h"
-#include "pc/channel.h"
#include "pc/dtls_srtp_transport.h"
#include "pc/dtls_transport.h"
#include "pc/jsep_transport.h"
diff --git a/pc/remote_audio_source.h b/pc/remote_audio_source.h
index 2eae073..89af4db 100644
--- a/pc/remote_audio_source.h
+++ b/pc/remote_audio_source.h
@@ -21,7 +21,6 @@
#include "api/media_stream_interface.h"
#include "api/notifier.h"
#include "media/base/media_channel.h"
-#include "pc/channel.h"
#include "rtc_base/message_handler.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread.h"
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc
index 0e5ca0e..325e033 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -39,6 +39,7 @@
#include "p2p/base/transport_description.h"
#include "p2p/base/transport_description_factory.h"
#include "p2p/base/transport_info.h"
+#include "pc/channel.h"
#include "pc/channel_interface.h"
#include "pc/dtls_transport.h"
#include "pc/media_stream.h"
diff --git a/pc/sdp_offer_answer.h b/pc/sdp_offer_answer.h
index 532d8cc..ae5b668 100644
--- a/pc/sdp_offer_answer.h
+++ b/pc/sdp_offer_answer.h
@@ -41,7 +41,6 @@
#include "media/base/media_channel.h"
#include "media/base/stream_params.h"
#include "p2p/base/port_allocator.h"
-#include "pc/channel.h"
#include "pc/channel_manager.h"
#include "pc/connection_context.h"
#include "pc/data_channel_controller.h"
diff --git a/pc/test/fake_peer_connection_for_stats.h b/pc/test/fake_peer_connection_for_stats.h
index 132174e..44b2f5b 100644
--- a/pc/test/fake_peer_connection_for_stats.h
+++ b/pc/test/fake_peer_connection_for_stats.h
@@ -19,6 +19,7 @@
#include <vector>
#include "media/base/fake_media_engine.h"
+#include "pc/channel.h"
#include "pc/stream_collection.h"
#include "pc/test/fake_data_channel_provider.h"
#include "pc/test/fake_peer_connection_base.h"
diff --git a/test/peer_scenario/BUILD.gn b/test/peer_scenario/BUILD.gn
index 44bd7a3..bea18bf 100644
--- a/test/peer_scenario/BUILD.gn
+++ b/test/peer_scenario/BUILD.gn
@@ -43,6 +43,7 @@
"../../modules/audio_device:audio_device_impl",
"../../modules/rtp_rtcp:rtp_rtcp_format",
"../../p2p:rtc_p2p",
+ "../../pc:channel",
"../../pc:jsep_transport_controller",
"../../pc:pc_test_utils",
"../../pc:rtp_transport_internal",
diff --git a/test/peer_scenario/scenario_connection.cc b/test/peer_scenario/scenario_connection.cc
index 07da453..9b240b8 100644
--- a/test/peer_scenario/scenario_connection.cc
+++ b/test/peer_scenario/scenario_connection.cc
@@ -13,6 +13,7 @@
#include "media/base/rtp_utils.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
#include "p2p/client/basic_port_allocator.h"
+#include "pc/channel.h"
#include "pc/jsep_transport_controller.h"
#include "pc/rtp_transport_internal.h"
#include "pc/session_description.h"