Remove channel_manager.h from most .h files

This ensures that only the compilation units that actually need
ChannelManager details can see it.

Bug: webrtc:13931
Change-Id: Iddd37580c0ceceba5b7095e84b981e6a525b2800
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261200
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36762}
This commit is contained in:
Harald Alvestrand 2022-05-04 13:38:31 +00:00 committed by WebRTC LUCI CQ
parent 31e31c8c0a
commit 9e334b7d99
15 changed files with 44 additions and 21 deletions

View File

@ -2658,6 +2658,7 @@ if (rtc_include_tests && !build_with_chromium) {
deps = [
":channel",
":channel_interface",
":channel_manager",
":jitter_buffer_delay",
":libjingle_peerconnection",
":peer_connection_internal",

View File

@ -16,6 +16,7 @@
#include "api/transport/field_trial_based_config.h"
#include "media/base/media_engine.h"
#include "media/sctp/sctp_transport_factory.h"
#include "pc/channel_manager.h"
#include "rtc_base/helpers.h"
#include "rtc_base/internal/default_socket_server.h"
#include "rtc_base/socket_server.h"

View File

@ -24,7 +24,6 @@
#include "api/transport/sctp_transport_factory_interface.h"
#include "media/base/media_engine.h"
#include "p2p/base/basic_packet_socket_factory.h"
#include "pc/channel_manager.h"
#include "rtc_base/checks.h"
#include "rtc_base/network.h"
#include "rtc_base/network_monitor_factory.h"
@ -33,6 +32,10 @@
#include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h"
namespace cricket {
class ChannelManager;
}
namespace rtc {
class BasicNetworkManager;
class BasicPacketSocketFactory;
@ -116,6 +119,7 @@ class ConnectionContext final
std::unique_ptr<FieldTrialsView> const trials_;
// channel_manager is accessed both on signaling thread and worker thread.
// Const after construction, explicitly cleared in destructor.
std::unique_ptr<cricket::ChannelManager> channel_manager_;
std::unique_ptr<rtc::NetworkMonitorFactory> const network_monitor_factory_
RTC_GUARDED_BY(signaling_thread_);

View File

@ -42,6 +42,7 @@
#include "p2p/base/p2p_constants.h"
#include "p2p/base/p2p_transport_channel.h"
#include "p2p/base/transport_info.h"
#include "pc/channel_manager.h"
#include "pc/ice_server_parsing.h"
#include "pc/rtp_receiver.h"
#include "pc/rtp_receiver_proxy.h"
@ -1676,10 +1677,6 @@ void PeerConnection::AddAdaptationResource(
call_->AddAdaptationResource(resource);
}
cricket::ChannelManager* PeerConnection::channel_manager() {
return context_->channel_manager();
}
bool PeerConnection::StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) {
return worker_thread()->Invoke<bool>(

View File

@ -55,7 +55,6 @@
#include "p2p/base/port_allocator.h"
#include "p2p/base/transport_description.h"
#include "pc/channel_interface.h"
#include "pc/channel_manager.h"
#include "pc/connection_context.h"
#include "pc/data_channel_controller.h"
#include "pc/data_channel_utils.h"
@ -85,6 +84,10 @@
#include "rtc_base/thread_annotations.h"
#include "rtc_base/weak_ptr.h"
namespace cricket {
class ChannelManager;
}
namespace webrtc {
// PeerConnection is the implementation of the PeerConnection object as defined
@ -340,7 +343,6 @@ class PeerConnection : public PeerConnectionInternal,
const RtpTransmissionManager* rtp_manager() const override {
return rtp_manager_.get();
}
cricket::ChannelManager* channel_manager();
JsepTransportController* transport_controller_s() override {
RTC_DCHECK_RUN_ON(signaling_thread());
@ -589,6 +591,10 @@ class PeerConnection : public PeerConnectionInternal,
int64_t packet_time_us)>
InitializeRtcpCallback();
cricket::ChannelManager* channel_manager() {
return context_->channel_manager();
}
const rtc::scoped_refptr<ConnectionContext> context_;
// Field trials active for this PeerConnection is the first of:
// a) Specified in PeerConnectionDependencies (owned).

View File

@ -33,6 +33,7 @@
#include "p2p/base/port_allocator.h"
#include "p2p/client/basic_port_allocator.h"
#include "pc/audio_track.h"
#include "pc/channel_manager.h"
#include "pc/local_audio_source.h"
#include "pc/media_stream.h"
#include "pc/media_stream_proxy.h"
@ -294,10 +295,6 @@ rtc::scoped_refptr<AudioTrackInterface> PeerConnectionFactory::CreateAudioTrack(
return AudioTrackProxy::Create(signaling_thread(), track);
}
cricket::ChannelManager* PeerConnectionFactory::channel_manager() {
return context_->channel_manager();
}
std::unique_ptr<RtcEventLog> PeerConnectionFactory::CreateRtcEventLog_w() {
RTC_DCHECK_RUN_ON(worker_thread());

View File

@ -40,13 +40,16 @@
#include "call/call.h"
#include "call/rtp_transport_controller_send_factory_interface.h"
#include "p2p/base/port_allocator.h"
#include "pc/channel_manager.h"
#include "pc/connection_context.h"
#include "rtc_base/checks.h"
#include "rtc_base/rtc_certificate_generator.h"
#include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h"
namespace cricket {
class ChannelManager;
}
namespace rtc {
class BasicNetworkManager;
class BasicPacketSocketFactory;
@ -100,8 +103,6 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface {
return context_->sctp_transport_factory();
}
virtual cricket::ChannelManager* channel_manager();
rtc::Thread* signaling_thread() const {
// This method can be called on a different thread when the factory is
// created in CreatePeerConnectionFactory().
@ -135,6 +136,10 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface {
rtc::Thread* network_thread() const { return context_->network_thread(); }
bool IsTrialEnabled(absl::string_view key) const;
cricket::ChannelManager* channel_manager() {
return context_->channel_manager();
}
const cricket::ChannelManager* channel_manager() const {
return context_->channel_manager();
}

View File

@ -34,7 +34,6 @@
#include "api/video/video_bitrate_allocator_factory.h"
#include "media/base/media_channel.h"
#include "pc/channel_interface.h"
#include "pc/channel_manager.h"
#include "pc/proxy.h"
#include "pc/rtp_receiver.h"
#include "pc/rtp_receiver_proxy.h"
@ -46,6 +45,10 @@
#include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread_annotations.h"
namespace cricket {
class ChannelManager;
}
namespace webrtc {
class PeerConnectionSdpMethods;

View File

@ -20,6 +20,7 @@
#include "api/rtp_parameters.h"
#include "media/base/fake_media_engine.h"
#include "media/base/media_engine.h"
#include "pc/channel_manager.h"
#include "pc/test/mock_channel_interface.h"
#include "pc/test/mock_rtp_receiver_internal.h"
#include "pc/test/mock_rtp_sender_internal.h"

View File

@ -18,6 +18,7 @@
#include "api/rtp_transceiver_direction.h"
#include "pc/audio_rtp_receiver.h"
#include "pc/channel_interface.h"
#include "pc/channel_manager.h"
#include "pc/stats_collector_interface.h"
#include "pc/video_rtp_receiver.h"
#include "rtc_base/checks.h"

View File

@ -27,7 +27,6 @@
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
#include "media/base/media_channel.h"
#include "pc/channel_manager.h"
#include "pc/rtp_receiver.h"
#include "pc/rtp_receiver_proxy.h"
#include "pc/rtp_sender.h"
@ -41,6 +40,10 @@
#include "rtc_base/thread_annotations.h"
#include "rtc_base/weak_ptr.h"
namespace cricket {
class ChannelManager;
}
namespace rtc {
class Thread;
}
@ -255,9 +258,9 @@ class RtpTransmissionManager : public RtpSenderBase::SetStreamsObserver {
bool closed_ = false;
bool const is_unified_plan_;
rtc::Thread* signaling_thread_;
rtc::Thread* worker_thread_;
cricket::ChannelManager* channel_manager_;
rtc::Thread* const signaling_thread_;
rtc::Thread* const worker_thread_;
cricket::ChannelManager* const channel_manager_;
UsagePattern* usage_pattern_;
PeerConnectionObserver* observer_;
StatsCollectorInterface* const stats_;

View File

@ -41,6 +41,7 @@
#include "p2p/base/transport_description_factory.h"
#include "p2p/base/transport_info.h"
#include "pc/channel_interface.h"
#include "pc/channel_manager.h"
#include "pc/dtls_transport.h"
#include "pc/media_stream.h"
#include "pc/media_stream_proxy.h"

View File

@ -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_manager.h"
#include "pc/connection_context.h"
#include "pc/data_channel_controller.h"
#include "pc/jsep_transport_controller.h"
@ -65,6 +64,10 @@
#include "rtc_base/unique_id_generator.h"
#include "rtc_base/weak_ptr.h"
namespace cricket {
class ChannelManager;
}
namespace webrtc {
// SdpOfferAnswerHandler is a component

View File

@ -20,6 +20,7 @@
#include "media/base/fake_media_engine.h"
#include "pc/channel.h"
#include "pc/channel_manager.h"
#include "pc/stream_collection.h"
#include "pc/test/fake_data_channel_provider.h"
#include "pc/test/fake_peer_connection_base.h"

View File

@ -23,7 +23,6 @@
#include "api/scoped_refptr.h"
#include "p2p/base/transport_description.h"
#include "p2p/base/transport_description_factory.h"
#include "pc/channel_manager.h"
#include "pc/media_session.h"
#include "pc/sdp_state_provider.h"
#include "rtc_base/message_handler.h"