Reland "[cleanup] Remove useless includes."
Reason for reland: Downstream project fixed.
Original change's description:
> [cleanup] Remove useless includes.
>
> Manual cleanup guided by include-what-you-use diagnostic.
>
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}
Bug: webrtc:8311
Change-Id: Id6ec4aeb798886a90ace640a190eaf16497ba31b
Reviewed-on: https://webrtc-review.googlesource.com/c/104120
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25034}
diff --git a/api/audio_codecs/audio_encoder.h b/api/audio_codecs/audio_encoder.h
index 6a1f653..562b42d 100644
--- a/api/audio_codecs/audio_encoder.h
+++ b/api/audio_codecs/audio_encoder.h
@@ -11,7 +11,6 @@
#ifndef API_AUDIO_CODECS_AUDIO_ENCODER_H_
#define API_AUDIO_CODECS_AUDIO_ENCODER_H_
-#include <algorithm>
#include <memory>
#include <string>
#include <vector>
diff --git a/api/audio_codecs/audio_format.h b/api/audio_codecs/audio_format.h
index aa5dbb1..8d28b4f 100644
--- a/api/audio_codecs/audio_format.h
+++ b/api/audio_codecs/audio_format.h
@@ -13,10 +13,10 @@
#include <map>
#include <string>
+// TODO(yvesg) Fix presubmit check and/or remove unused swap function.
#include <utility>
#include "absl/strings/string_view.h"
-#include "absl/types/optional.h"
#include "rtc_base/checks.h"
namespace webrtc {
diff --git a/api/candidate.cc b/api/candidate.cc
index c2c6c53..10751ae 100644
--- a/api/candidate.cc
+++ b/api/candidate.cc
@@ -10,6 +10,7 @@
#include "api/candidate.h"
+#include "rtc_base/helpers.h"
#include "rtc_base/strings/string_builder.h"
namespace cricket {
diff --git a/api/candidate.h b/api/candidate.h
index 6e0547b..0a84591 100644
--- a/api/candidate.h
+++ b/api/candidate.h
@@ -18,7 +18,6 @@
#include <string>
#include "rtc_base/checks.h"
-#include "rtc_base/helpers.h"
#include "rtc_base/network_constants.h"
#include "rtc_base/socketaddress.h"
diff --git a/api/jsepicecandidate.h b/api/jsepicecandidate.h
index 50520fe..a57f861 100644
--- a/api/jsepicecandidate.h
+++ b/api/jsepicecandidate.h
@@ -15,7 +15,6 @@
#define API_JSEPICECANDIDATE_H_
#include <string>
-#include <utility>
#include <vector>
#include "api/candidate.h"
diff --git a/api/mediaconstraintsinterface.h b/api/mediaconstraintsinterface.h
index c6a914a..560fa4a 100644
--- a/api/mediaconstraintsinterface.h
+++ b/api/mediaconstraintsinterface.h
@@ -24,7 +24,6 @@
#include <string>
#include <vector>
-#include "absl/types/optional.h"
#include "api/peerconnectioninterface.h"
namespace webrtc {
diff --git a/api/mediastreaminterface.h b/api/mediastreaminterface.h
index b661351..2eb2f31 100644
--- a/api/mediastreaminterface.h
+++ b/api/mediastreaminterface.h
@@ -24,17 +24,11 @@
#include "absl/types/optional.h"
#include "api/video/video_frame.h"
-// TODO(zhihuang): Remove unrelated headers once downstream applications stop
-// relying on them; they were previously transitively included by
-// mediachannel.h, which is no longer a dependency of this file.
#include "api/video/video_sink_interface.h"
#include "api/video/video_source_interface.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
-#include "rtc_base/ratetracker.h"
#include "rtc_base/refcount.h"
#include "rtc_base/scoped_ref_ptr.h"
-#include "rtc_base/thread.h"
-#include "rtc_base/timeutils.h"
namespace webrtc {
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index 1c32b69..c6850e1 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -69,7 +69,6 @@
#include <memory>
#include <string>
-#include <utility>
#include <vector>
#include "api/asyncresolverfactory.h"
@@ -79,7 +78,6 @@
#include "api/audio_options.h"
#include "api/call/callfactoryinterface.h"
#include "api/datachannelinterface.h"
-#include "api/dtmfsenderinterface.h"
#include "api/fec_controller.h"
#include "api/jsep.h"
#include "api/mediastreaminterface.h"
@@ -94,7 +92,6 @@
#include "api/transport/bitrate_settings.h"
#include "api/transport/network_control.h"
#include "api/turncustomizer.h"
-#include "api/umametrics.h"
#include "logging/rtc_event_log/rtc_event_log_factory_interface.h"
#include "media/base/mediaconfig.h"
// TODO(bugs.webrtc.org/6353): cricket::VideoCapturer is deprecated and should
diff --git a/api/rtp_headers.cc b/api/rtp_headers.cc
index da7f1ea..bf973b6 100644
--- a/api/rtp_headers.cc
+++ b/api/rtp_headers.cc
@@ -10,14 +10,6 @@
#include "api/rtp_headers.h"
-#include <string.h>
-#include <algorithm>
-#include <limits>
-#include <type_traits>
-
-#include "rtc_base/checks.h"
-#include "rtc_base/stringutils.h"
-
namespace webrtc {
RTPHeaderExtension::RTPHeaderExtension()
diff --git a/api/rtp_headers.h b/api/rtp_headers.h
index 41f3988..799058d 100644
--- a/api/rtp_headers.h
+++ b/api/rtp_headers.h
@@ -13,10 +13,7 @@
#include <stddef.h>
#include <string.h>
-#include <string>
-#include <vector>
-#include "absl/types/optional.h"
#include "api/array_view.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame_marking.h"
@@ -24,8 +21,6 @@
#include "api/video/video_timing.h"
#include "common_types.h" // NOLINT(build/include)
-#include "rtc_base/checks.h"
-#include "rtc_base/deprecation.h"
namespace webrtc {
diff --git a/api/rtpparameters.cc b/api/rtpparameters.cc
index 98ced9b..e9f4d5d 100644
--- a/api/rtpparameters.cc
+++ b/api/rtpparameters.cc
@@ -12,7 +12,6 @@
#include <algorithm>
#include <string>
-#include "rtc_base/checks.h"
#include "rtc_base/strings/string_builder.h"
namespace webrtc {
diff --git a/api/rtpsenderinterface.h b/api/rtpsenderinterface.h
index 9554c1c..7c94c21 100644
--- a/api/rtpsenderinterface.h
+++ b/api/rtpsenderinterface.h
@@ -24,7 +24,6 @@
#include "api/proxy.h"
#include "api/rtcerror.h"
#include "api/rtpparameters.h"
-#include "rtc_base/deprecation.h"
#include "rtc_base/refcount.h"
#include "rtc_base/scoped_ref_ptr.h"
diff --git a/api/video/video_bitrate_allocation.cc b/api/video/video_bitrate_allocation.cc
index 6c5ad1e..8922536 100644
--- a/api/video/video_bitrate_allocation.cc
+++ b/api/video/video_bitrate_allocation.cc
@@ -10,12 +10,9 @@
#include "api/video/video_bitrate_allocation.h"
-#include <limits>
-
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/strings/string_builder.h"
-#include "rtc_base/stringutils.h"
namespace webrtc {
diff --git a/api/video/video_content_type.h b/api/video/video_content_type.h
index 8c64602..2d38a62 100644
--- a/api/video/video_content_type.h
+++ b/api/video/video_content_type.h
@@ -13,8 +13,6 @@
#include <stdint.h>
-#include <string>
-
namespace webrtc {
enum class VideoContentType : uint8_t {
diff --git a/audio/channel_send.cc b/audio/channel_send.cc
index d3748b3..8639fbd 100644
--- a/audio/channel_send.cc
+++ b/audio/channel_send.cc
@@ -29,6 +29,7 @@
#include "modules/utility/include/process_thread.h"
#include "rtc_base/checks.h"
#include "rtc_base/criticalsection.h"
+#include "rtc_base/event.h"
#include "rtc_base/format_macros.h"
#include "rtc_base/location.h"
#include "rtc_base/logging.h"
diff --git a/audio/null_audio_poller.cc b/audio/null_audio_poller.cc
index c22b3d8..bd5317b 100644
--- a/audio/null_audio_poller.cc
+++ b/audio/null_audio_poller.cc
@@ -11,6 +11,7 @@
#include "audio/null_audio_poller.h"
#include "rtc_base/logging.h"
#include "rtc_base/thread.h"
+#include "rtc_base/timeutils.h" // for TimeMillis
namespace webrtc {
namespace internal {
diff --git a/common_video/include/incoming_video_stream.h b/common_video/include/incoming_video_stream.h
index 8063061..b32653b 100644
--- a/common_video/include/incoming_video_stream.h
+++ b/common_video/include/incoming_video_stream.h
@@ -15,6 +15,7 @@
#include "common_video/video_render_frames.h"
#include "rtc_base/race_checker.h"
#include "rtc_base/task_queue.h"
+#include "rtc_base/thread_checker.h"
namespace webrtc {
diff --git a/logging/rtc_event_log/rtc_event_log.h b/logging/rtc_event_log/rtc_event_log.h
index 0c71406..3a6bc4a 100644
--- a/logging/rtc_event_log/rtc_event_log.h
+++ b/logging/rtc_event_log/rtc_event_log.h
@@ -12,8 +12,6 @@
#define LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
#include <memory>
-#include <string>
-#include <utility>
#include "api/rtceventlogoutput.h"
#include "logging/rtc_event_log/events/rtc_event.h"
diff --git a/modules/audio_mixer/audio_mixer_impl.h b/modules/audio_mixer/audio_mixer_impl.h
index e8994a6..8edd3b8 100644
--- a/modules/audio_mixer/audio_mixer_impl.h
+++ b/modules/audio_mixer/audio_mixer_impl.h
@@ -17,6 +17,7 @@
#include "api/audio/audio_mixer.h"
#include "modules/audio_mixer/frame_combiner.h"
#include "modules/audio_mixer/output_rate_calculator.h"
+#include "rtc_base/criticalsection.h"
#include "rtc_base/race_checker.h"
#include "rtc_base/scoped_ref_ptr.h"
#include "rtc_base/thread_annotations.h"
diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller.cc b/modules/congestion_controller/rtp/send_side_congestion_controller.cc
index 266a5dc..3970f13 100644
--- a/modules/congestion_controller/rtp/send_side_congestion_controller.cc
+++ b/modules/congestion_controller/rtp/send_side_congestion_controller.cc
@@ -21,6 +21,7 @@
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
#include "rtc_base/bind.h"
#include "rtc_base/checks.h"
+#include "rtc_base/event.h"
#include "rtc_base/format_macros.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
diff --git a/modules/rtp_rtcp/source/contributing_sources.h b/modules/rtp_rtcp/source/contributing_sources.h
index 1a4a572..b6201ce 100644
--- a/modules/rtp_rtcp/source/contributing_sources.h
+++ b/modules/rtp_rtcp/source/contributing_sources.h
@@ -18,7 +18,8 @@
#include "absl/types/optional.h"
#include "api/array_view.h"
-#include "api/rtpreceiverinterface.h"
+#include "api/rtpreceiverinterface.h" // For RtpSource
+#include "rtc_base/timeutils.h" // For kNumMillisecsPerSec
namespace webrtc {
diff --git a/p2p/base/stunrequest.cc b/p2p/base/stunrequest.cc
index 56410be..7e4d2dc 100644
--- a/p2p/base/stunrequest.cc
+++ b/p2p/base/stunrequest.cc
@@ -19,6 +19,7 @@
#include "rtc_base/helpers.h"
#include "rtc_base/logging.h"
#include "rtc_base/stringencode.h"
+#include "rtc_base/timeutils.h" // For TimeMillis
namespace cricket {
diff --git a/p2p/base/tcpport_unittest.cc b/p2p/base/tcpport_unittest.cc
index ef302f9..34385a7 100644
--- a/p2p/base/tcpport_unittest.cc
+++ b/p2p/base/tcpport_unittest.cc
@@ -14,6 +14,7 @@
#include "p2p/base/basicpacketsocketfactory.h"
#include "p2p/base/tcpport.h"
#include "rtc_base/gunit.h"
+#include "rtc_base/helpers.h"
#include "rtc_base/thread.h"
#include "rtc_base/virtualsocketserver.h"
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index 6d67329..f920ddf 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -22,6 +22,7 @@
#include "api/jsepsessiondescription.h"
#include "api/mediastreamproxy.h"
#include "api/mediastreamtrackproxy.h"
+#include "api/umametrics.h"
#include "call/call.h"
#include "logging/rtc_event_log/icelogger.h"
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
diff --git a/pc/peerconnection_ice_unittest.cc b/pc/peerconnection_ice_unittest.cc
index 965956c..e6d6ac1 100644
--- a/pc/peerconnection_ice_unittest.cc
+++ b/pc/peerconnection_ice_unittest.cc
@@ -22,6 +22,7 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/peerconnectionproxy.h"
+#include "api/umametrics.h"
#include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h"
#include "pc/test/fakeaudiocapturemodule.h"
diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc
index 28e0110..5825898 100644
--- a/pc/peerconnection_integrationtest.cc
+++ b/pc/peerconnection_integrationtest.cc
@@ -28,6 +28,7 @@
#include "api/peerconnectioninterface.h"
#include "api/peerconnectionproxy.h"
#include "api/rtpreceiverinterface.h"
+#include "api/umametrics.h"
#include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h"
#include "api/video_codecs/sdp_video_format.h"
diff --git a/pc/peerconnection_rtp_unittest.cc b/pc/peerconnection_rtp_unittest.cc
index bc3662c..8453f17 100644
--- a/pc/peerconnection_rtp_unittest.cc
+++ b/pc/peerconnection_rtp_unittest.cc
@@ -17,6 +17,7 @@
#include "api/jsep.h"
#include "api/mediastreaminterface.h"
#include "api/peerconnectioninterface.h"
+#include "api/umametrics.h"
#include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h"
#include "pc/mediasession.h"
diff --git a/pc/statscollector_unittest.cc b/pc/statscollector_unittest.cc
index fa4d3db..7c61b38 100644
--- a/pc/statscollector_unittest.cc
+++ b/pc/statscollector_unittest.cc
@@ -22,6 +22,7 @@
#include "pc/test/fakevideotracksource.h"
#include "pc/videotrack.h"
#include "rtc_base/fakesslidentity.h"
+#include "rtc_base/messagedigest.h"
#include "rtc_base/third_party/base64/base64.h"
#include "test/gtest.h"
diff --git a/pc/videotrack.h b/pc/videotrack.h
index e669e08..f119dd8 100644
--- a/pc/videotrack.h
+++ b/pc/videotrack.h
@@ -17,6 +17,7 @@
#include "media/base/videosourcebase.h"
#include "pc/mediastreamtrack.h"
#include "rtc_base/scoped_ref_ptr.h"
+#include "rtc_base/thread.h"
#include "rtc_base/thread_checker.h"
namespace webrtc {
diff --git a/pc/webrtcsdp_unittest.cc b/pc/webrtcsdp_unittest.cc
index 9c10554..9c39c41 100644
--- a/pc/webrtcsdp_unittest.cc
+++ b/pc/webrtcsdp_unittest.cc
@@ -22,6 +22,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/gunit.h"
#include "rtc_base/logging.h"
+#include "rtc_base/messagedigest.h"
#include "rtc_base/stringencode.h"
#include "rtc_base/stringutils.h"
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index e9efbd1..5c225a2 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -565,7 +565,9 @@
":checks",
":criticalsection",
":logging",
+ ":macromagic",
":platform_thread",
+ ":platform_thread_types",
":ptr_util",
":refcount",
":rtc_task_queue_api",
diff --git a/rtc_base/asynctcpsocket.cc b/rtc_base/asynctcpsocket.cc
index 3d68a2a..087a98e 100644
--- a/rtc_base/asynctcpsocket.cc
+++ b/rtc_base/asynctcpsocket.cc
@@ -18,6 +18,7 @@
#include "rtc_base/byteorder.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
+#include "rtc_base/timeutils.h" // for TimeMillis
#if defined(WEBRTC_POSIX)
#include <errno.h>
diff --git a/rtc_base/asynctcpsocket.h b/rtc_base/asynctcpsocket.h
index 943e010..c145d6f 100644
--- a/rtc_base/asynctcpsocket.h
+++ b/rtc_base/asynctcpsocket.h
@@ -13,10 +13,12 @@
#include <memory>
-#include "rtc_base/asyncpacketsocket.h"
-#include "rtc_base/buffer.h"
-#include "rtc_base/constructormagic.h"
-#include "rtc_base/socketfactory.h"
+#include "rtc_base/asyncpacketsocket.h" // for PacketOptions, AsyncPacketSo...
+#include "rtc_base/asyncsocket.h" // for AsyncSocket
+#include "rtc_base/buffer.h" // for Buffer
+#include "rtc_base/constructormagic.h" // for RTC_DISALLOW_COPY_AND_ASSIGN
+#include "rtc_base/socket.h" // for Socket, Socket::Option
+#include "rtc_base/socketaddress.h" // for SocketAddress
namespace rtc {
diff --git a/rtc_base/bitrateallocationstrategy.cc b/rtc_base/bitrateallocationstrategy.cc
index d2a06cd..7c65c12 100644
--- a/rtc_base/bitrateallocationstrategy.cc
+++ b/rtc_base/bitrateallocationstrategy.cc
@@ -10,6 +10,7 @@
#include "rtc_base/bitrateallocationstrategy.h"
#include <algorithm>
+#include <map>
#include <utility>
namespace rtc {
diff --git a/rtc_base/bitrateallocationstrategy.h b/rtc_base/bitrateallocationstrategy.h
index f711d1f..a4a17f8 100644
--- a/rtc_base/bitrateallocationstrategy.h
+++ b/rtc_base/bitrateallocationstrategy.h
@@ -11,12 +11,9 @@
#ifndef RTC_BASE_BITRATEALLOCATIONSTRATEGY_H_
#define RTC_BASE_BITRATEALLOCATIONSTRATEGY_H_
-#include <map>
-#include <memory>
#include <string>
#include <vector>
#include "api/array_view.h"
-#include "rtc_base/checks.h"
namespace rtc {
diff --git a/rtc_base/bytebuffer.cc b/rtc_base/bytebuffer.cc
index 94fc6ac..f8ce1a2 100644
--- a/rtc_base/bytebuffer.cc
+++ b/rtc_base/bytebuffer.cc
@@ -12,8 +12,6 @@
#include <string.h>
-#include <algorithm>
-
namespace rtc {
ByteBufferWriter::ByteBufferWriter() : ByteBufferWriterT() {}
diff --git a/rtc_base/copyonwritebuffer.h b/rtc_base/copyonwritebuffer.h
index 0514e2f..177e38f 100644
--- a/rtc_base/copyonwritebuffer.h
+++ b/rtc_base/copyonwritebuffer.h
@@ -16,7 +16,6 @@
#include "rtc_base/buffer.h"
#include "rtc_base/checks.h"
-#include "rtc_base/refcount.h"
#include "rtc_base/refcountedobject.h"
#include "rtc_base/scoped_ref_ptr.h"
diff --git a/rtc_base/file.cc b/rtc_base/file.cc
index 6202411..a793500 100644
--- a/rtc_base/file.cc
+++ b/rtc_base/file.cc
@@ -10,8 +10,6 @@
#include "rtc_base/file.h"
-#include <utility>
-
namespace rtc {
File::File(PlatformFile file) : file_(file) {}
diff --git a/rtc_base/filerotatingstream.cc b/rtc_base/filerotatingstream.cc
index c9a663a..31b0051 100644
--- a/rtc_base/filerotatingstream.cc
+++ b/rtc_base/filerotatingstream.cc
@@ -16,6 +16,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/fileutils.h"
+#include "rtc_base/logging.h"
#include "rtc_base/pathutils.h"
#include "rtc_base/strings/string_builder.h"
diff --git a/rtc_base/fileutils.cc b/rtc_base/fileutils.cc
index 7d83f97..0adbbac 100644
--- a/rtc_base/fileutils.cc
+++ b/rtc_base/fileutils.cc
@@ -10,12 +10,11 @@
#include "rtc_base/fileutils.h"
-#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
#include "rtc_base/pathutils.h"
-#include "rtc_base/stringutils.h"
#if defined(WEBRTC_WIN)
+#include "rtc_base/stringutils.h" // for ToUtf16
#include "rtc_base/win32filesystem.h"
#else
#include "rtc_base/unixfilesystem.h"
diff --git a/rtc_base/fileutils.h b/rtc_base/fileutils.h
index 132fd88..f7afaf9 100644
--- a/rtc_base/fileutils.h
+++ b/rtc_base/fileutils.h
@@ -23,9 +23,7 @@
#include <unistd.h>
#endif // WEBRTC_WIN
-#include "rtc_base/checks.h"
#include "rtc_base/constructormagic.h"
-#include "rtc_base/platform_file.h"
namespace rtc {
diff --git a/rtc_base/flags.cc b/rtc_base/flags.cc
index 5b28794..bcce0da 100644
--- a/rtc_base/flags.cc
+++ b/rtc_base/flags.cc
@@ -15,7 +15,6 @@
#include <string.h>
#include "rtc_base/checks.h"
-#include "rtc_base/stringutils.h"
#if defined(WEBRTC_WIN)
// clang-format off
@@ -23,6 +22,8 @@
#include <windows.h>
#include <shellapi.h> // must come after windows.h
// clang-format on
+
+#include "rtc_base/stringutils.h" // For ToUtf8
#endif
namespace {
diff --git a/rtc_base/flags.h b/rtc_base/flags.h
index 33f6e5b..1c476d8 100644
--- a/rtc_base/flags.h
+++ b/rtc_base/flags.h
@@ -23,7 +23,10 @@
#define RTC_BASE_FLAGS_H_
#include "rtc_base/checks.h"
+
+#if defined(WEBRTC_WIN)
#include "rtc_base/constructormagic.h"
+#endif
namespace rtc {
diff --git a/rtc_base/httpcommon.cc b/rtc_base/httpcommon.cc
index 716a41e..43831b7 100644
--- a/rtc_base/httpcommon.cc
+++ b/rtc_base/httpcommon.cc
@@ -18,17 +18,23 @@
#include <security.h>
#endif
+#include <ctype.h> // for isspace
+#include <stdio.h> // for sprintf
#include <algorithm>
+#include <utility> // for pair
+#include <vector>
#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
-#include "rtc_base/cryptstring.h"
+#include "rtc_base/cryptstring.h" // for CryptString
#include "rtc_base/httpcommon.h"
+#include "rtc_base/logging.h"
#include "rtc_base/messagedigest.h"
#include "rtc_base/socketaddress.h"
#include "rtc_base/strings/string_builder.h"
-#include "rtc_base/third_party/base64/base64.h"
-#include "rtc_base/zero_memory.h"
+#include "rtc_base/stringutils.h" // for strcpyn, _stricmp
+#include "rtc_base/third_party/base64/base64.h" // for Base64
+#include "rtc_base/zero_memory.h" // for ExplicitZeroMemory
namespace rtc {
namespace {
diff --git a/rtc_base/httpcommon.h b/rtc_base/httpcommon.h
index 581bd1e..fbad280 100644
--- a/rtc_base/httpcommon.h
+++ b/rtc_base/httpcommon.h
@@ -11,14 +11,7 @@
#ifndef RTC_BASE_HTTPCOMMON_H_
#define RTC_BASE_HTTPCOMMON_H_
-#include <map>
-#include <memory>
#include <string>
-#include <vector>
-
-#include "rtc_base/checks.h"
-#include "rtc_base/stream.h"
-#include "rtc_base/stringutils.h"
namespace rtc {
diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc
index 129a897..53a1ed8 100644
--- a/rtc_base/logging.cc
+++ b/rtc_base/logging.cc
@@ -26,7 +26,6 @@
static const int kMaxLogLineSize = 1024 - 60;
#endif // WEBRTC_MAC && !defined(WEBRTC_IOS) || WEBRTC_ANDROID
-#include <limits.h>
#include <time.h>
#include <algorithm>
diff --git a/rtc_base/logging.h b/rtc_base/logging.h
index 1bd0c72..5c47c7f 100644
--- a/rtc_base/logging.h
+++ b/rtc_base/logging.h
@@ -60,7 +60,6 @@
#include "rtc_base/deprecation.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/system/inline.h"
-#include "rtc_base/thread_annotations.h"
#if !defined(NDEBUG) || defined(DLOG_ALWAYS_ON)
#define RTC_DLOG_IS_ON 1
diff --git a/rtc_base/memory/aligned_malloc.cc b/rtc_base/memory/aligned_malloc.cc
index a1d54bd..c893c96 100644
--- a/rtc_base/memory/aligned_malloc.cc
+++ b/rtc_base/memory/aligned_malloc.cc
@@ -10,8 +10,8 @@
#include "rtc_base/memory/aligned_malloc.h"
-#include <stdlib.h>
-#include <cstring>
+#include <stdlib.h> // for free, malloc
+#include <string.h> // for memcpy
#ifdef _WIN32
#include <windows.h>
diff --git a/rtc_base/messagehandler.h b/rtc_base/messagehandler.h
index df2d1ad..0c40853 100644
--- a/rtc_base/messagehandler.h
+++ b/rtc_base/messagehandler.h
@@ -11,7 +11,6 @@
#ifndef RTC_BASE_MESSAGEHANDLER_H_
#define RTC_BASE_MESSAGEHANDLER_H_
-#include <memory>
#include <utility>
#include "rtc_base/constructormagic.h"
diff --git a/rtc_base/messagequeue.cc b/rtc_base/messagequeue.cc
index a561af4..84d3a96 100644
--- a/rtc_base/messagequeue.cc
+++ b/rtc_base/messagequeue.cc
@@ -8,13 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <algorithm>
+#include <utility> // for move
#include "rtc_base/atomicops.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/messagequeue.h"
-#include "rtc_base/stringencode.h"
#include "rtc_base/thread.h"
+#include "rtc_base/timeutils.h" // for TimeMillis, TimeDiff, TimeUntil
#include "rtc_base/trace_event.h"
namespace rtc {
diff --git a/rtc_base/messagequeue.h b/rtc_base/messagequeue.h
index e7e4792..c1b9b5a 100644
--- a/rtc_base/messagequeue.h
+++ b/rtc_base/messagequeue.h
@@ -17,7 +17,6 @@
#include <list>
#include <memory>
#include <queue>
-#include <utility>
#include <vector>
#include "rtc_base/constructormagic.h"
@@ -28,7 +27,6 @@
#include "rtc_base/socketserver.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread_annotations.h"
-#include "rtc_base/timeutils.h"
namespace rtc {
diff --git a/rtc_base/nethelper.h b/rtc_base/nethelper.h
index e86d126..f956138 100644
--- a/rtc_base/nethelper.h
+++ b/rtc_base/nethelper.h
@@ -10,7 +10,6 @@
#ifndef RTC_BASE_NETHELPER_H_
#define RTC_BASE_NETHELPER_H_
-#include <cstdlib>
#include <string>
// This header contains helper functions and constants used by different types
diff --git a/rtc_base/nethelpers.cc b/rtc_base/nethelpers.cc
index b1221c3..81cd1af 100644
--- a/rtc_base/nethelpers.cc
+++ b/rtc_base/nethelpers.cc
@@ -25,10 +25,9 @@
#endif
#endif // defined(WEBRTC_POSIX) && !defined(__native_client__)
-#include "rtc_base/byteorder.h"
-#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/signalthread.h"
+#include "rtc_base/third_party/sigslot/sigslot.h" // for signal_with_thread...
namespace rtc {
diff --git a/rtc_base/nethelpers.h b/rtc_base/nethelpers.h
index f9d188f..429f0c0 100644
--- a/rtc_base/nethelpers.h
+++ b/rtc_base/nethelpers.h
@@ -18,12 +18,12 @@
#include <winsock2.h> // NOLINT
#endif
-#include <list>
+#include <vector>
#include "rtc_base/asyncresolverinterface.h"
+#include "rtc_base/ipaddress.h" // for IPAddress
#include "rtc_base/signalthread.h"
#include "rtc_base/socketaddress.h"
-#include "rtc_base/third_party/sigslot/sigslot.h"
namespace rtc {
diff --git a/rtc_base/networkmonitor.cc b/rtc_base/networkmonitor.cc
index ad6805a..e3b2efd 100644
--- a/rtc_base/networkmonitor.cc
+++ b/rtc_base/networkmonitor.cc
@@ -11,6 +11,7 @@
#include "rtc_base/networkmonitor.h"
#include "rtc_base/checks.h"
+#include "rtc_base/logging.h"
namespace {
const uint32_t UPDATE_NETWORKS_MESSAGE = 1;
diff --git a/rtc_base/networkmonitor.h b/rtc_base/networkmonitor.h
index a84a30a..1ad7663 100644
--- a/rtc_base/networkmonitor.h
+++ b/rtc_base/networkmonitor.h
@@ -11,7 +11,6 @@
#ifndef RTC_BASE_NETWORKMONITOR_H_
#define RTC_BASE_NETWORKMONITOR_H_
-#include "rtc_base/logging.h"
#include "rtc_base/network_constants.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread.h"
diff --git a/rtc_base/openssladapter.cc b/rtc_base/openssladapter.cc
index 50284a6..b589195 100644
--- a/rtc_base/openssladapter.cc
+++ b/rtc_base/openssladapter.cc
@@ -23,6 +23,7 @@
#include <openssl/x509v3.h>
#include "rtc_base/openssl.h"
+#include "absl/memory/memory.h" // for make_unique
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
diff --git a/rtc_base/openssladapter.h b/rtc_base/openssladapter.h
index 50a7c08..45ffc6f 100644
--- a/rtc_base/openssladapter.h
+++ b/rtc_base/openssladapter.h
@@ -13,19 +13,22 @@
#include <openssl/ossl_typ.h>
-#include <map>
#include <memory>
#include <string>
#include <vector>
-#include "absl/memory/memory.h"
-#include "rtc_base/buffer.h"
-#include "rtc_base/messagehandler.h"
-#include "rtc_base/messagequeue.h"
-#include "rtc_base/opensslcertificate.h"
-#include "rtc_base/opensslidentity.h"
-#include "rtc_base/opensslsessioncache.h"
-#include "rtc_base/ssladapter.h"
+#include "rtc_base/asyncsocket.h" // for AsyncSocket
+#include "rtc_base/buffer.h" // for Buffer
+#include "rtc_base/messagehandler.h" // for MessageHandler
+#include "rtc_base/messagequeue.h" // for Message
+#include "rtc_base/opensslidentity.h" // for SSL_CTX, OpenSSLIdentity
+#include "rtc_base/opensslsessioncache.h" // for OpenSSLSessionCache
+#include "rtc_base/socket.h" // for Socket::ConnState
+#include "rtc_base/socketaddress.h" // for SocketAddress
+#include "rtc_base/ssladapter.h" // for SSLAdapter, SSLAdapterFactory
+#include "rtc_base/sslcertificate.h" // for SSLCertificateVerifier
+#include "rtc_base/sslidentity.h" // for SSLIdentity
+#include "rtc_base/sslstreamadapter.h" // for SSLMode, SSLRole, SSL_MODE...
namespace rtc {
diff --git a/rtc_base/opensslcertificate.h b/rtc_base/opensslcertificate.h
index c730ffd..b7ecc3b 100644
--- a/rtc_base/opensslcertificate.h
+++ b/rtc_base/opensslcertificate.h
@@ -11,16 +11,16 @@
#ifndef RTC_BASE_OPENSSLCERTIFICATE_H_
#define RTC_BASE_OPENSSLCERTIFICATE_H_
-#include <openssl/evp.h>
-#include <openssl/x509.h>
+#include <openssl/base.h> // for X509, ssl_ctx_st
-#include <memory>
+#include <stddef.h> // for size_t
+#include <stdint.h> // for int64_t
#include <string>
-#include "rtc_base/checks.h"
-#include "rtc_base/constructormagic.h"
-#include "rtc_base/sslcertificate.h"
-#include "rtc_base/sslidentity.h"
+#include "rtc_base/buffer.h" // for Buffer
+#include "rtc_base/constructormagic.h" // for RTC_DISALLOW_COPY_AND_ASSIGN
+#include "rtc_base/sslcertificate.h" // for SSLCertificate
+#include "rtc_base/sslidentity.h" // for SSLIdentityParams
typedef struct ssl_ctx_st SSL_CTX;
diff --git a/rtc_base/openssldigest.h b/rtc_base/openssldigest.h
index c4cd1e0..1427a94 100644
--- a/rtc_base/openssldigest.h
+++ b/rtc_base/openssldigest.h
@@ -11,7 +11,8 @@
#ifndef RTC_BASE_OPENSSLDIGEST_H_
#define RTC_BASE_OPENSSLDIGEST_H_
-#include <openssl/evp.h>
+#include <openssl/base.h> // for EVP_MD, EVP_MD_CTX
+#include <string>
#include "rtc_base/messagedigest.h"
diff --git a/rtc_base/opensslidentity.h b/rtc_base/opensslidentity.h
index 3404427..b72a4c2 100644
--- a/rtc_base/opensslidentity.h
+++ b/rtc_base/opensslidentity.h
@@ -11,16 +11,17 @@
#ifndef RTC_BASE_OPENSSLIDENTITY_H_
#define RTC_BASE_OPENSSLIDENTITY_H_
-#include <openssl/evp.h>
-#include <openssl/x509.h>
+#include <openssl/base.h> // for EVP_PKEY, ssl_ctx_st
-#include <memory>
+#include <ctime> // for time_t
+#include <memory> // for unique_ptr
#include <string>
-#include "rtc_base/checks.h"
-#include "rtc_base/constructormagic.h"
-#include "rtc_base/opensslcertificate.h"
-#include "rtc_base/sslidentity.h"
+#include "rtc_base/checks.h" // for RTC_DCHECK
+#include "rtc_base/constructormagic.h" // for RTC_DISALLOW_COPY_AND_ASSIGN
+#include "rtc_base/opensslcertificate.h" // for OpenSSLCertificate
+#include "rtc_base/sslcertificate.h" // for SSLCertChain
+#include "rtc_base/sslidentity.h" // for SSLIdentity, KeyParams, SSL...
typedef struct ssl_ctx_st SSL_CTX;
diff --git a/rtc_base/opensslutility.h b/rtc_base/opensslutility.h
index 7cb38b5..77ed0b1 100644
--- a/rtc_base/opensslutility.h
+++ b/rtc_base/opensslutility.h
@@ -13,7 +13,6 @@
#include <openssl/ossl_typ.h>
#include <string>
-#include "rtc_base/sslcertificate.h"
namespace rtc {
// The openssl namespace holds static helper methods. All methods related
diff --git a/rtc_base/pathutils.cc b/rtc_base/pathutils.cc
index 594deb7..0764671 100644
--- a/rtc_base/pathutils.cc
+++ b/rtc_base/pathutils.cc
@@ -15,10 +15,9 @@
#include <tchar.h>
#endif // WEBRTC_WIN
-#include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
+#include <string.h> // for strchr
+
#include "rtc_base/pathutils.h"
-#include "rtc_base/stringutils.h"
namespace rtc {
diff --git a/rtc_base/pathutils.h b/rtc_base/pathutils.h
index 9543be0..59f2a4a 100644
--- a/rtc_base/pathutils.h
+++ b/rtc_base/pathutils.h
@@ -13,8 +13,6 @@
#include <string>
-#include "rtc_base/checks.h"
-
namespace rtc {
///////////////////////////////////////////////////////////////////////////////
diff --git a/rtc_base/platform_file.cc b/rtc_base/platform_file.cc
index a4c906a..d74acdd 100644
--- a/rtc_base/platform_file.cc
+++ b/rtc_base/platform_file.cc
@@ -10,10 +10,9 @@
#include "rtc_base/platform_file.h"
-#include "rtc_base/stringutils.h"
-
#if defined(WEBRTC_WIN)
#include <io.h>
+#include "rtc_base/stringutils.h" // For ToUtf16
#else
#include <fcntl.h>
#include <sys/stat.h>
diff --git a/rtc_base/platform_thread.h b/rtc_base/platform_thread.h
index 33921c2..ea67aca 100644
--- a/rtc_base/platform_thread.h
+++ b/rtc_base/platform_thread.h
@@ -14,7 +14,6 @@
#include <string>
#include "rtc_base/constructormagic.h"
-#include "rtc_base/event.h"
#include "rtc_base/platform_thread_types.h"
#include "rtc_base/thread_checker.h"
diff --git a/rtc_base/proxyserver.cc b/rtc_base/proxyserver.cc
index 55cab80..71c4879 100644
--- a/rtc_base/proxyserver.cc
+++ b/rtc_base/proxyserver.cc
@@ -13,6 +13,7 @@
#include <algorithm>
#include "rtc_base/checks.h"
+#include "rtc_base/logging.h"
#include "rtc_base/socketfactory.h"
namespace rtc {
diff --git a/rtc_base/race_checker.h b/rtc_base/race_checker.h
index 73567e9..d6eba08 100644
--- a/rtc_base/race_checker.h
+++ b/rtc_base/race_checker.h
@@ -12,7 +12,7 @@
#define RTC_BASE_RACE_CHECKER_H_
#include "rtc_base/checks.h"
-#include "rtc_base/platform_thread.h"
+#include "rtc_base/platform_thread_types.h" // for PlatformThreadRef
#include "rtc_base/thread_annotations.h"
namespace rtc {
diff --git a/rtc_base/ratetracker.cc b/rtc_base/ratetracker.cc
index e31d266..7c96ca9 100644
--- a/rtc_base/ratetracker.cc
+++ b/rtc_base/ratetracker.cc
@@ -10,8 +10,6 @@
#include "rtc_base/ratetracker.h"
-#include <stddef.h>
-
#include <algorithm>
#include "rtc_base/checks.h"
diff --git a/rtc_base/rtccertificate.cc b/rtc_base/rtccertificate.cc
index 7f027ba..786333f 100644
--- a/rtc_base/rtccertificate.cc
+++ b/rtc_base/rtccertificate.cc
@@ -14,6 +14,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/refcountedobject.h"
+#include "rtc_base/timeutils.h"
namespace rtc {
diff --git a/rtc_base/sequenced_task_checker_unittest.cc b/rtc_base/sequenced_task_checker_unittest.cc
index 96e655b..83fb14f 100644
--- a/rtc_base/sequenced_task_checker_unittest.cc
+++ b/rtc_base/sequenced_task_checker_unittest.cc
@@ -12,6 +12,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/constructormagic.h"
+#include "rtc_base/event.h"
#include "rtc_base/platform_thread.h"
#include "rtc_base/task_queue.h"
#include "rtc_base/thread_checker.h"
diff --git a/rtc_base/signalthread.cc b/rtc_base/signalthread.cc
index eb79dc8..2e0fa0c 100644
--- a/rtc_base/signalthread.cc
+++ b/rtc_base/signalthread.cc
@@ -12,6 +12,7 @@
#include "absl/memory/memory.h"
#include "rtc_base/checks.h"
+#include "rtc_base/nullsocketserver.h"
namespace rtc {
diff --git a/rtc_base/signalthread.h b/rtc_base/signalthread.h
index 021cf4d..448b289 100644
--- a/rtc_base/signalthread.h
+++ b/rtc_base/signalthread.h
@@ -14,10 +14,13 @@
#include <string>
#include "rtc_base/checks.h"
-#include "rtc_base/constructormagic.h"
-#include "rtc_base/nullsocketserver.h"
-#include "rtc_base/third_party/sigslot/sigslot.h"
-#include "rtc_base/thread.h"
+#include "rtc_base/constructormagic.h" // for RTC_DISALLOW_IMPLI...
+#include "rtc_base/criticalsection.h" // for CriticalSection
+#include "rtc_base/messagehandler.h" // for MessageHandler
+#include "rtc_base/messagequeue.h" // for Message
+#include "rtc_base/third_party/sigslot/sigslot.h" // for has_slots, signal_...
+#include "rtc_base/thread.h" // for Thread
+#include "rtc_base/thread_annotations.h" // for RTC_EXCLUSIVE_LOCK...
namespace rtc {
diff --git a/rtc_base/socketadapters.cc b/rtc_base/socketadapters.cc
index acd9b63..98be868 100644
--- a/rtc_base/socketadapters.cc
+++ b/rtc_base/socketadapters.cc
@@ -30,7 +30,6 @@
#include "rtc_base/httpcommon.h"
#include "rtc_base/logging.h"
#include "rtc_base/socketadapters.h"
-#include "rtc_base/stringencode.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/stringutils.h"
#include "rtc_base/zero_memory.h"
diff --git a/rtc_base/socketadapters.h b/rtc_base/socketadapters.h
index ad88fe6..062f75c 100644
--- a/rtc_base/socketadapters.h
+++ b/rtc_base/socketadapters.h
@@ -11,13 +11,11 @@
#ifndef RTC_BASE_SOCKETADAPTERS_H_
#define RTC_BASE_SOCKETADAPTERS_H_
-#include <map>
#include <string>
#include "rtc_base/asyncsocket.h"
#include "rtc_base/constructormagic.h"
#include "rtc_base/cryptstring.h"
-#include "rtc_base/logging.h"
namespace rtc {
diff --git a/rtc_base/socketaddress.h b/rtc_base/socketaddress.h
index bff8e76..b1a52b9 100644
--- a/rtc_base/socketaddress.h
+++ b/rtc_base/socketaddress.h
@@ -15,7 +15,6 @@
#ifdef UNIT_TEST
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
#endif // UNIT_TEST
-#include <vector>
#include "rtc_base/ipaddress.h"
#undef SetPort
diff --git a/rtc_base/ssladapter_unittest.cc b/rtc_base/ssladapter_unittest.cc
index ec532b1..8ed460f 100644
--- a/rtc_base/ssladapter_unittest.cc
+++ b/rtc_base/ssladapter_unittest.cc
@@ -15,6 +15,7 @@
#include "absl/memory/memory.h"
#include "rtc_base/gunit.h"
#include "rtc_base/ipaddress.h"
+#include "rtc_base/messagedigest.h"
#include "rtc_base/socketstream.h"
#include "rtc_base/ssladapter.h"
#include "rtc_base/sslidentity.h"
diff --git a/rtc_base/sslcertificate.cc b/rtc_base/sslcertificate.cc
index 9a38fc0..e40feec 100644
--- a/rtc_base/sslcertificate.cc
+++ b/rtc_base/sslcertificate.cc
@@ -10,16 +10,15 @@
#include "rtc_base/sslcertificate.h"
-#include <ctime>
+#include <algorithm> // for transform
#include <string>
#include <utility>
-#include "absl/memory/memory.h"
-#include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
-#include "rtc_base/opensslcertificate.h"
-#include "rtc_base/sslfingerprint.h"
-#include "rtc_base/third_party/base64/base64.h"
+#include "absl/memory/memory.h" // for WrapUnique, make_unique
+#include "rtc_base/checks.h" // for FatalLogCall, RTC_DC...
+#include "rtc_base/opensslcertificate.h" // for OpenSSLCertificate
+#include "rtc_base/sslfingerprint.h" // for SSLFingerprint
+#include "rtc_base/third_party/base64/base64.h" // for Base64
namespace rtc {
diff --git a/rtc_base/sslcertificate.h b/rtc_base/sslcertificate.h
index 29c4db5..029404c 100644
--- a/rtc_base/sslcertificate.h
+++ b/rtc_base/sslcertificate.h
@@ -15,15 +15,12 @@
#ifndef RTC_BASE_SSLCERTIFICATE_H_
#define RTC_BASE_SSLCERTIFICATE_H_
-#include <algorithm>
#include <memory>
#include <string>
#include <vector>
#include "rtc_base/buffer.h"
#include "rtc_base/constructormagic.h"
-#include "rtc_base/messagedigest.h"
-#include "rtc_base/timeutils.h"
namespace rtc {
diff --git a/rtc_base/sslfingerprint.cc b/rtc_base/sslfingerprint.cc
index b651a3d..4f1ae8f 100644
--- a/rtc_base/sslfingerprint.cc
+++ b/rtc_base/sslfingerprint.cc
@@ -13,7 +13,6 @@
#include <ctype.h>
#include <string>
-#include "rtc_base/helpers.h"
#include "rtc_base/logging.h"
#include "rtc_base/messagedigest.h"
#include "rtc_base/stringencode.h"
diff --git a/rtc_base/sslidentity.cc b/rtc_base/sslidentity.cc
index 823fc38..1d136d7 100644
--- a/rtc_base/sslidentity.cc
+++ b/rtc_base/sslidentity.cc
@@ -11,17 +11,15 @@
// Handling of certificates and keypairs for SSLStreamAdapter's peer mode.
#include "rtc_base/sslidentity.h"
+#include <string.h> // for strspn
#include <ctime>
#include <string>
-#include <utility>
-#include "absl/memory/memory.h"
-#include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
-#include "rtc_base/opensslidentity.h"
-#include "rtc_base/sslfingerprint.h"
-#include "rtc_base/strings/string_builder.h"
-#include "rtc_base/third_party/base64/base64.h"
+#include "rtc_base/checks.h" // for FatalLogCall, RTC_DC...
+#include "rtc_base/opensslidentity.h" // for OpenSSLIdentity
+#include "rtc_base/strings/string_builder.h" // for StringBuilder
+#include "rtc_base/third_party/base64/base64.h" // for Base64, Base64::DO_P...
+#include "rtc_base/timeutils.h" // for TmToSeconds
namespace rtc {
diff --git a/rtc_base/sslidentity.h b/rtc_base/sslidentity.h
index 1379d73..d17d38b 100644
--- a/rtc_base/sslidentity.h
+++ b/rtc_base/sslidentity.h
@@ -13,16 +13,10 @@
#ifndef RTC_BASE_SSLIDENTITY_H_
#define RTC_BASE_SSLIDENTITY_H_
-#include <algorithm>
-#include <memory>
+#include <ctime>
#include <string>
-#include <vector>
-#include "rtc_base/buffer.h"
-#include "rtc_base/constructormagic.h"
-#include "rtc_base/messagedigest.h"
#include "rtc_base/sslcertificate.h"
-#include "rtc_base/timeutils.h"
namespace rtc {
diff --git a/rtc_base/sslidentity_unittest.cc b/rtc_base/sslidentity_unittest.cc
index 132e240..68b5828 100644
--- a/rtc_base/sslidentity_unittest.cc
+++ b/rtc_base/sslidentity_unittest.cc
@@ -14,6 +14,7 @@
#include "rtc_base/fakesslidentity.h"
#include "rtc_base/gunit.h"
#include "rtc_base/helpers.h"
+#include "rtc_base/messagedigest.h"
#include "rtc_base/ssladapter.h"
#include "rtc_base/sslfingerprint.h"
#include "rtc_base/sslidentity.h"
diff --git a/rtc_base/sslstreamadapter_unittest.cc b/rtc_base/sslstreamadapter_unittest.cc
index 3403bdb..389b0ea 100644
--- a/rtc_base/sslstreamadapter_unittest.cc
+++ b/rtc_base/sslstreamadapter_unittest.cc
@@ -17,6 +17,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/gunit.h"
#include "rtc_base/helpers.h"
+#include "rtc_base/messagedigest.h"
#include "rtc_base/ssladapter.h"
#include "rtc_base/sslidentity.h"
#include "rtc_base/sslstreamadapter.h"
diff --git a/rtc_base/stream.cc b/rtc_base/stream.cc
index d1ec140..ea2e47a 100644
--- a/rtc_base/stream.cc
+++ b/rtc_base/stream.cc
@@ -15,21 +15,20 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include <string.h> // for memcpy, memmove, strlen
#include <algorithm>
#include <string>
#include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
+#include "rtc_base/location.h" // for RTC_FROM_HERE
#include "rtc_base/messagequeue.h"
#include "rtc_base/stream.h"
-#include "rtc_base/stringencode.h"
-#include "rtc_base/stringutils.h"
#include "rtc_base/thread.h"
-#include "rtc_base/timeutils.h"
#if defined(WEBRTC_WIN)
#include <windows.h>
#define fileno _fileno
+#include "rtc_base/stringutils.h" // for ToUtf16
#endif
namespace rtc {
diff --git a/rtc_base/stream.h b/rtc_base/stream.h
index 81c5e41..7c6e618 100644
--- a/rtc_base/stream.h
+++ b/rtc_base/stream.h
@@ -18,7 +18,6 @@
#include "rtc_base/buffer.h"
#include "rtc_base/constructormagic.h"
#include "rtc_base/criticalsection.h"
-#include "rtc_base/logging.h"
#include "rtc_base/messagehandler.h"
#include "rtc_base/messagequeue.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
diff --git a/rtc_base/stringencode.cc b/rtc_base/stringencode.cc
index a57845f..6a065cb 100644
--- a/rtc_base/stringencode.cc
+++ b/rtc_base/stringencode.cc
@@ -10,9 +10,6 @@
#include "rtc_base/stringencode.h"
-#include <stdio.h>
-#include <stdlib.h>
-
#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
#include "rtc_base/stringutils.h"
diff --git a/rtc_base/strings/string_builder.cc b/rtc_base/strings/string_builder.cc
index 2fd4aba..0dca938 100644
--- a/rtc_base/strings/string_builder.cc
+++ b/rtc_base/strings/string_builder.cc
@@ -10,6 +10,12 @@
#include "rtc_base/strings/string_builder.h"
+#include <stdarg.h> // for va_end, va_list, va_start
+#include <cstring> // for strlen
+
+#include "rtc_base/checks.h" // for FatalLogCall, RTC_DCHECK
+#include "rtc_base/numerics/safe_minmax.h" // for SafeMin
+
namespace rtc {
SimpleStringBuilder::SimpleStringBuilder(rtc::ArrayView<char> buffer)
diff --git a/rtc_base/strings/string_builder.h b/rtc_base/strings/string_builder.h
index 186c2f7..27001d1 100644
--- a/rtc_base/strings/string_builder.h
+++ b/rtc_base/strings/string_builder.h
@@ -12,13 +12,11 @@
#define RTC_BASE_STRINGS_STRING_BUILDER_H_
#include <cstdio>
-#include <cstring>
#include <string>
+#include <utility>
#include "absl/strings/string_view.h"
#include "api/array_view.h"
-#include "rtc_base/checks.h"
-#include "rtc_base/numerics/safe_minmax.h"
#include "rtc_base/stringencode.h"
#include "rtc_base/stringutils.h"
diff --git a/rtc_base/stringutils.cc b/rtc_base/stringutils.cc
index 6baddd1..35153ab 100644
--- a/rtc_base/stringutils.cc
+++ b/rtc_base/stringutils.cc
@@ -7,11 +7,10 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <algorithm>
-#include <cstdio>
+
+#include "rtc_base/stringutils.h"
#include "rtc_base/checks.h"
-#include "rtc_base/stringutils.h"
namespace rtc {
diff --git a/rtc_base/task_queue_libevent.cc b/rtc_base/task_queue_libevent.cc
index d3b1a7c..ce05bae 100644
--- a/rtc_base/task_queue_libevent.cc
+++ b/rtc_base/task_queue_libevent.cc
@@ -10,11 +10,17 @@
#include "rtc_base/task_queue.h"
+#include <errno.h> // for EAGAIN, errno
#include <fcntl.h>
+#include <pthread.h> // for pthread_getspecific
#include <signal.h>
-#include <string.h>
+#include <stdint.h> // for uint32_t
+#include <time.h> // for nanosleep, timespec
#include <unistd.h>
#include <list>
+#include <memory> // for unique_ptr, allocator
+#include <type_traits> // for remove_reference<>::...
+#include <utility> // for move
#include "base/third_party/libevent/event.h"
#include "rtc_base/checks.h"
@@ -22,11 +28,13 @@
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/platform_thread.h"
+#include "rtc_base/platform_thread_types.h" // for CurrentThreadRef
#include "rtc_base/refcount.h"
#include "rtc_base/refcountedobject.h"
+#include "rtc_base/scoped_ref_ptr.h" // for scoped_refptr
#include "rtc_base/system/unused.h"
-#include "rtc_base/task_queue.h"
#include "rtc_base/task_queue_posix.h"
+#include "rtc_base/thread_annotations.h" // for RTC_GUARDED_BY
#include "rtc_base/timeutils.h"
namespace rtc {
diff --git a/rtc_base/third_party/sigslot/sigslot.h b/rtc_base/third_party/sigslot/sigslot.h
index c77e4e6..8bd1c70 100644
--- a/rtc_base/third_party/sigslot/sigslot.h
+++ b/rtc_base/third_party/sigslot/sigslot.h
@@ -96,7 +96,6 @@
#ifndef RTC_BASE_THIRD_PARTY_SIGSLOT_SIGSLOT_H_
#define RTC_BASE_THIRD_PARTY_SIGSLOT_SIGSLOT_H_
-#include <stdlib.h>
#include <cstring>
#include <list>
#include <set>
diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc
index 2d5704e..911ac16 100644
--- a/rtc_base/thread.cc
+++ b/rtc_base/thread.cc
@@ -24,10 +24,11 @@
#pragma warning(disable : 4722)
#endif
+#include <utility> // for move
+
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/nullsocketserver.h"
-#include "rtc_base/platform_thread.h"
#include "rtc_base/stringutils.h"
#include "rtc_base/timeutils.h"
#include "rtc_base/trace_event.h"
diff --git a/rtc_base/thread.h b/rtc_base/thread.h
index 5a46610..fde5e8b 100644
--- a/rtc_base/thread.h
+++ b/rtc_base/thread.h
@@ -11,12 +11,9 @@
#ifndef RTC_BASE_THREAD_H_
#define RTC_BASE_THREAD_H_
-#include <algorithm>
#include <list>
#include <memory>
#include <string>
-#include <utility>
-#include <vector>
#if defined(WEBRTC_POSIX)
#include <pthread.h>
diff --git a/rtc_base/thread_darwin.mm b/rtc_base/thread_darwin.mm
index a404849..e64d6eb 100644
--- a/rtc_base/thread_darwin.mm
+++ b/rtc_base/thread_darwin.mm
@@ -13,6 +13,7 @@
#import <Foundation/Foundation.h>
#include "rtc_base/platform_thread.h"
+#include "rtc_base/timeutils.h" // for TimeAfter, TimeUntil
/*
* This file contains platform-specific implementations for several
diff --git a/rtc_base/unixfilesystem.cc b/rtc_base/unixfilesystem.cc
index 023c34c..818cb8a 100644
--- a/rtc_base/unixfilesystem.cc
+++ b/rtc_base/unixfilesystem.cc
@@ -47,6 +47,7 @@
#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
#include "rtc_base/fileutils.h"
+#include "rtc_base/logging.h"
#include "rtc_base/pathutils.h"
#include "rtc_base/stream.h"
#include "rtc_base/stringutils.h"
diff --git a/rtc_base/win32filesystem.cc b/rtc_base/win32filesystem.cc
index b500e5e..cd43966 100644
--- a/rtc_base/win32filesystem.cc
+++ b/rtc_base/win32filesystem.cc
@@ -20,6 +20,7 @@
#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
#include "rtc_base/fileutils.h"
+#include "rtc_base/logging.h"
#include "rtc_base/pathutils.h"
#include "rtc_base/stream.h"
#include "rtc_base/stringutils.h"
diff --git a/rtc_base/win32socketserver.cc b/rtc_base/win32socketserver.cc
index cab751a..230f3ed 100644
--- a/rtc_base/win32socketserver.cc
+++ b/rtc_base/win32socketserver.cc
@@ -16,6 +16,7 @@
#include "rtc_base/byteorder.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
+#include "rtc_base/timeutils.h" // For Time, TimeSince
#include "rtc_base/win32window.h"
namespace rtc {
diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn
index 64aece0..9a319ab 100644
--- a/sdk/android/BUILD.gn
+++ b/sdk/android/BUILD.gn
@@ -830,6 +830,7 @@
":videoframe_jni",
"//api:libjingle_peerconnection_api",
"//api/video:video_frame",
+ "//rtc_base:rtc_base",
"//rtc_base:rtc_base_approved",
"//third_party/abseil-cpp/absl/memory",
]
diff --git a/sdk/android/native_api/video/videosource.h b/sdk/android/native_api/video/videosource.h
index 0c4f333..11d983d 100644
--- a/sdk/android/native_api/video/videosource.h
+++ b/sdk/android/native_api/video/videosource.h
@@ -14,6 +14,7 @@
#include <jni.h>
#include "api/mediastreaminterface.h"
+#include "rtc_base/thread.h"
#include "sdk/android/native_api/jni/scoped_java_ref.h"
namespace webrtc {
diff --git a/sdk/android/src/jni/androidnetworkmonitor.cc b/sdk/android/src/jni/androidnetworkmonitor.cc
index b1351ef..7ac1728 100644
--- a/sdk/android/src/jni/androidnetworkmonitor.cc
+++ b/sdk/android/src/jni/androidnetworkmonitor.cc
@@ -19,6 +19,7 @@
#include "rtc_base/bind.h"
#include "rtc_base/checks.h"
#include "rtc_base/ipaddress.h"
+#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
#include "sdk/android/generated_base_jni/jni/NetworkMonitorAutoDetect_jni.h"
#include "sdk/android/generated_base_jni/jni/NetworkMonitor_jni.h"
diff --git a/sdk/objc/api/peerconnection/RTCVideoSource+Private.h b/sdk/objc/api/peerconnection/RTCVideoSource+Private.h
index 2441e0c..828aad8 100644
--- a/sdk/objc/api/peerconnection/RTCVideoSource+Private.h
+++ b/sdk/objc/api/peerconnection/RTCVideoSource+Private.h
@@ -13,6 +13,7 @@
#import "RTCMediaSource+Private.h"
#include "api/mediastreaminterface.h"
+#include "rtc_base/thread.h"
NS_ASSUME_NONNULL_BEGIN
diff --git a/sdk/objc/native/api/video_capturer.h b/sdk/objc/native/api/video_capturer.h
index 5b6f3f9..d6f396b 100644
--- a/sdk/objc/native/api/video_capturer.h
+++ b/sdk/objc/native/api/video_capturer.h
@@ -15,6 +15,7 @@
#include "api/mediastreaminterface.h"
#include "rtc_base/scoped_ref_ptr.h"
+#include "rtc_base/thread.h"
namespace webrtc {
diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn
index 3703aa8..24d4bfd 100644
--- a/test/scenario/BUILD.gn
+++ b/test/scenario/BUILD.gn
@@ -82,6 +82,7 @@
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_base_tests_utils",
"../../rtc_base:rtc_task_queue",
+ "../../rtc_base:safe_minmax",
"../../rtc_base:sequenced_task_checker",
"../../rtc_base:stringutils",
"../../system_wrappers",
diff --git a/test/scenario/network_node.cc b/test/scenario/network_node.cc
index ff13893..ec84109 100644
--- a/test/scenario/network_node.cc
+++ b/test/scenario/network_node.cc
@@ -12,6 +12,8 @@
#include <algorithm>
#include <vector>
+#include "rtc_base/numerics/safe_minmax.h"
+
namespace webrtc {
namespace test {
namespace {