IWYU modules/congestion_controller

using
  find modules/congestion_controller/ -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
  tools_webrtc/gn_check_autofix.py -C out/Default/
and git cl format

Manual changes to the emulated network visiblity were required.

BUG=webrtc:42226242

Change-Id: Ie082452c353f8cd91c3701c6d4a0fbb2a03fd138
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/381684
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44183}
diff --git a/modules/congestion_controller/BUILD.gn b/modules/congestion_controller/BUILD.gn
index 0d946c5..64dbdcd 100644
--- a/modules/congestion_controller/BUILD.gn
+++ b/modules/congestion_controller/BUILD.gn
@@ -31,6 +31,7 @@
     "../../rtc_base:macromagic",
     "../../rtc_base/experiments:field_trial_parser",
     "../../rtc_base/synchronization:mutex",
+    "../../system_wrappers",
     "../pacing",
     "../remote_bitrate_estimator",
     "../remote_bitrate_estimator:congestion_control_feedback_generator",
diff --git a/modules/congestion_controller/goog_cc/BUILD.gn b/modules/congestion_controller/goog_cc/BUILD.gn
index 17ef305..3261686 100644
--- a/modules/congestion_controller/goog_cc/BUILD.gn
+++ b/modules/congestion_controller/goog_cc/BUILD.gn
@@ -332,6 +332,7 @@
         "../../../test:explicit_key_value_config",
         "../../../test:field_trial",
         "../../../test:test_support",
+        "../../../test/network:emulated_network",
         "../../../test/scenario",
         "../../../test/scenario:column_printer",
         "../../pacing",
diff --git a/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc b/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc
index ec0f813..6f85c4c 100644
--- a/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc
+++ b/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc
@@ -14,7 +14,6 @@
 
 #include "api/units/data_size.h"
 #include "test/explicit_key_value_config.h"
-#include "test/gmock.h"
 #include "test/gtest.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc
index e34dfee..e9e4568 100644
--- a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc
+++ b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc
@@ -33,7 +33,9 @@
 #include "call/video_receive_stream.h"
 #include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
 #include "test/field_trial.h"
+#include "test/gmock.h"
 #include "test/gtest.h"
+#include "test/network/network_emulation.h"
 #include "test/scenario/call_client.h"
 #include "test/scenario/column_printer.h"
 #include "test/scenario/scenario.h"
diff --git a/modules/congestion_controller/include/receive_side_congestion_controller.h b/modules/congestion_controller/include/receive_side_congestion_controller.h
index 30373d5..2041404 100644
--- a/modules/congestion_controller/include/receive_side_congestion_controller.h
+++ b/modules/congestion_controller/include/receive_side_congestion_controller.h
@@ -14,12 +14,9 @@
 #include <cstdint>
 #include <memory>
 
-#include "absl/base/attributes.h"
-#include "absl/base/nullability.h"
 #include "api/environment/environment.h"
 #include "api/media_types.h"
 #include "api/sequence_checker.h"
-#include "api/transport/network_control.h"
 #include "api/units/data_rate.h"
 #include "api/units/time_delta.h"
 #include "modules/congestion_controller/remb_throttler.h"
diff --git a/modules/congestion_controller/pcc/BUILD.gn b/modules/congestion_controller/pcc/BUILD.gn
index 0af1baf..5fce915 100644
--- a/modules/congestion_controller/pcc/BUILD.gn
+++ b/modules/congestion_controller/pcc/BUILD.gn
@@ -109,6 +109,7 @@
       ":pcc_controller",
       ":rtt_tracker",
       ":utility_function",
+      "../../../api/environment",
       "../../../api/environment:environment_factory",
       "../../../api/transport:network_control",
       "../../../api/units:data_rate",
diff --git a/modules/congestion_controller/pcc/bitrate_controller.cc b/modules/congestion_controller/pcc/bitrate_controller.cc
index 3c907f7..bb3e3e2 100644
--- a/modules/congestion_controller/pcc/bitrate_controller.cc
+++ b/modules/congestion_controller/pcc/bitrate_controller.cc
@@ -12,11 +12,17 @@
 
 #include <algorithm>
 #include <cmath>
+#include <cstdint>
 #include <cstdlib>
 #include <memory>
+#include <optional>
 #include <utility>
 #include <vector>
 
+#include "api/units/data_rate.h"
+#include "modules/congestion_controller/pcc/monitor_interval.h"
+#include "modules/congestion_controller/pcc/utility_function.h"
+
 namespace webrtc {
 namespace pcc {
 
diff --git a/modules/congestion_controller/pcc/bitrate_controller_unittest.cc b/modules/congestion_controller/pcc/bitrate_controller_unittest.cc
index b6e1ee5..b16beaa 100644
--- a/modules/congestion_controller/pcc/bitrate_controller_unittest.cc
+++ b/modules/congestion_controller/pcc/bitrate_controller_unittest.cc
@@ -10,10 +10,19 @@
 
 #include "modules/congestion_controller/pcc/bitrate_controller.h"
 
+#include <cstddef>
 #include <memory>
+#include <optional>
 #include <utility>
+#include <vector>
 
+#include "api/transport/network_types.h"
+#include "api/units/data_rate.h"
+#include "api/units/data_size.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "modules/congestion_controller/pcc/monitor_interval.h"
+#include "modules/congestion_controller/pcc/utility_function.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
 
diff --git a/modules/congestion_controller/pcc/monitor_interval.cc b/modules/congestion_controller/pcc/monitor_interval.cc
index de1e2d5..116dda6 100644
--- a/modules/congestion_controller/pcc/monitor_interval.cc
+++ b/modules/congestion_controller/pcc/monitor_interval.cc
@@ -13,7 +13,13 @@
 #include <stddef.h>
 
 #include <cmath>
+#include <vector>
 
+#include "api/transport/network_types.h"
+#include "api/units/data_rate.h"
+#include "api/units/data_size.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "rtc_base/logging.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/pcc/monitor_interval_unittest.cc b/modules/congestion_controller/pcc/monitor_interval_unittest.cc
index aaff57b..1d33f00 100644
--- a/modules/congestion_controller/pcc/monitor_interval_unittest.cc
+++ b/modules/congestion_controller/pcc/monitor_interval_unittest.cc
@@ -12,6 +12,13 @@
 
 #include <stddef.h>
 
+#include <vector>
+
+#include "api/transport/network_types.h"
+#include "api/units/data_rate.h"
+#include "api/units/data_size.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "test/gtest.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/pcc/pcc_factory.cc b/modules/congestion_controller/pcc/pcc_factory.cc
index c35c6e8..149c990 100644
--- a/modules/congestion_controller/pcc/pcc_factory.cc
+++ b/modules/congestion_controller/pcc/pcc_factory.cc
@@ -12,6 +12,8 @@
 
 #include <memory>
 
+#include "api/transport/network_control.h"
+#include "api/units/time_delta.h"
 #include "modules/congestion_controller/pcc/pcc_network_controller.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/pcc/pcc_network_controller.cc b/modules/congestion_controller/pcc/pcc_network_controller.cc
index 76f91bc..4a643fc 100644
--- a/modules/congestion_controller/pcc/pcc_network_controller.cc
+++ b/modules/congestion_controller/pcc/pcc_network_controller.cc
@@ -11,9 +11,16 @@
 #include "modules/congestion_controller/pcc/pcc_network_controller.h"
 
 #include <algorithm>
+#include <cstddef>
+#include <cstdint>
 #include <optional>
 
+#include "api/transport/network_control.h"
+#include "api/transport/network_types.h"
+#include "api/units/data_rate.h"
 #include "api/units/data_size.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "rtc_base/checks.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc b/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc
index cf4a884..6391f42 100644
--- a/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc
+++ b/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc
@@ -10,13 +10,18 @@
 
 #include "modules/congestion_controller/pcc/pcc_network_controller.h"
 
-#include <memory>
-
+#include "api/environment/environment.h"
 #include "api/environment/environment_factory.h"
+#include "api/transport/network_control.h"
+#include "api/transport/network_types.h"
+#include "api/units/data_rate.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "modules/congestion_controller/pcc/pcc_factory.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
 #include "test/scenario/scenario.h"
+#include "test/scenario/scenario_config.h"
 
 using ::testing::AllOf;
 using ::testing::Field;
diff --git a/modules/congestion_controller/pcc/rtt_tracker.cc b/modules/congestion_controller/pcc/rtt_tracker.cc
index af9dc8f..250a309 100644
--- a/modules/congestion_controller/pcc/rtt_tracker.cc
+++ b/modules/congestion_controller/pcc/rtt_tracker.cc
@@ -11,6 +11,11 @@
 #include "modules/congestion_controller/pcc/rtt_tracker.h"
 
 #include <algorithm>
+#include <vector>
+
+#include "api/transport/network_types.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 
 namespace webrtc {
 namespace pcc {
diff --git a/modules/congestion_controller/pcc/rtt_tracker_unittest.cc b/modules/congestion_controller/pcc/rtt_tracker_unittest.cc
index 7d90e86..dbe6497 100644
--- a/modules/congestion_controller/pcc/rtt_tracker_unittest.cc
+++ b/modules/congestion_controller/pcc/rtt_tracker_unittest.cc
@@ -10,6 +10,9 @@
 
 #include "modules/congestion_controller/pcc/rtt_tracker.h"
 
+#include "api/transport/network_types.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "test/gtest.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/pcc/utility_function.cc b/modules/congestion_controller/pcc/utility_function.cc
index 006a2fc..7ab177f 100644
--- a/modules/congestion_controller/pcc/utility_function.cc
+++ b/modules/congestion_controller/pcc/utility_function.cc
@@ -14,6 +14,7 @@
 #include <cmath>
 
 #include "api/units/data_rate.h"
+#include "modules/congestion_controller/pcc/monitor_interval.h"
 #include "rtc_base/checks.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/pcc/utility_function_unittest.cc b/modules/congestion_controller/pcc/utility_function_unittest.cc
index 19b2d15..8f4add6 100644
--- a/modules/congestion_controller/pcc/utility_function_unittest.cc
+++ b/modules/congestion_controller/pcc/utility_function_unittest.cc
@@ -13,7 +13,6 @@
 #include <stddef.h>
 
 #include <cmath>
-#include <type_traits>
 #include <vector>
 
 #include "api/transport/network_types.h"
@@ -21,6 +20,7 @@
 #include "api/units/data_size.h"
 #include "api/units/time_delta.h"
 #include "api/units/timestamp.h"
+#include "modules/congestion_controller/pcc/monitor_interval.h"
 #include "test/gtest.h"
 
 namespace webrtc {
diff --git a/modules/congestion_controller/receive_side_congestion_controller.cc b/modules/congestion_controller/receive_side_congestion_controller.cc
index d288d15..d6aec66 100644
--- a/modules/congestion_controller/receive_side_congestion_controller.cc
+++ b/modules/congestion_controller/receive_side_congestion_controller.cc
@@ -15,11 +15,9 @@
 #include <memory>
 #include <utility>
 
-#include "absl/base/nullability.h"
 #include "api/environment/environment.h"
 #include "api/media_types.h"
 #include "api/sequence_checker.h"
-#include "api/transport/network_control.h"
 #include "api/units/data_rate.h"
 #include "api/units/time_delta.h"
 #include "api/units/timestamp.h"
diff --git a/modules/congestion_controller/remb_throttler.cc b/modules/congestion_controller/remb_throttler.cc
index fcc30af..d51897e 100644
--- a/modules/congestion_controller/remb_throttler.cc
+++ b/modules/congestion_controller/remb_throttler.cc
@@ -11,7 +11,15 @@
 #include "modules/congestion_controller/remb_throttler.h"
 
 #include <algorithm>
+#include <cstdint>
 #include <utility>
+#include <vector>
+
+#include "api/units/data_rate.h"
+#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
+#include "rtc_base/synchronization/mutex.h"
+#include "system_wrappers/include/clock.h"
 
 namespace webrtc {
 
diff --git a/modules/congestion_controller/remb_throttler.h b/modules/congestion_controller/remb_throttler.h
index 85292cb..dc01849 100644
--- a/modules/congestion_controller/remb_throttler.h
+++ b/modules/congestion_controller/remb_throttler.h
@@ -10,14 +10,15 @@
 #ifndef MODULES_CONGESTION_CONTROLLER_REMB_THROTTLER_H_
 #define MODULES_CONGESTION_CONTROLLER_REMB_THROTTLER_H_
 
+#include <cstdint>
 #include <functional>
 #include <vector>
 
 #include "api/units/data_rate.h"
-#include "api/units/time_delta.h"
 #include "api/units/timestamp.h"
 #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
 #include "rtc_base/synchronization/mutex.h"
+#include "rtc_base/thread_annotations.h"
 
 namespace webrtc {
 
diff --git a/modules/congestion_controller/remb_throttler_unittest.cc b/modules/congestion_controller/remb_throttler_unittest.cc
index 3f8df8a..4e4d0b6 100644
--- a/modules/congestion_controller/remb_throttler_unittest.cc
+++ b/modules/congestion_controller/remb_throttler_unittest.cc
@@ -9,10 +9,12 @@
  */
 #include "modules/congestion_controller/remb_throttler.h"
 
+#include <cstdint>
 #include <vector>
 
 #include "api/units/data_rate.h"
 #include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
 #include "system_wrappers/include/clock.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
diff --git a/modules/congestion_controller/rtp/control_handler.cc b/modules/congestion_controller/rtp/control_handler.cc
index 93e18a8..8322baa 100644
--- a/modules/congestion_controller/rtp/control_handler.cc
+++ b/modules/congestion_controller/rtp/control_handler.cc
@@ -10,14 +10,15 @@
 
 #include "modules/congestion_controller/rtp/control_handler.h"
 
-#include <algorithm>
-#include <vector>
+#include <optional>
 
+#include "api/sequence_checker.h"
+#include "api/transport/network_types.h"
 #include "api/units/data_rate.h"
+#include "api/units/time_delta.h"
 #include "modules/pacing/pacing_controller.h"
+#include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
-#include "rtc_base/numerics/safe_conversions.h"
-#include "rtc_base/numerics/safe_minmax.h"
 
 namespace webrtc {
 
diff --git a/modules/congestion_controller/rtp/control_handler.h b/modules/congestion_controller/rtp/control_handler.h
index f492199..1ab246c 100644
--- a/modules/congestion_controller/rtp/control_handler.h
+++ b/modules/congestion_controller/rtp/control_handler.h
@@ -17,7 +17,6 @@
 
 #include "api/sequence_checker.h"
 #include "api/transport/network_types.h"
-#include "api/units/data_size.h"
 #include "api/units/time_delta.h"
 #include "rtc_base/system/no_unique_address.h"
 
diff --git a/modules/congestion_controller/rtp/transport_feedback_demuxer.cc b/modules/congestion_controller/rtp/transport_feedback_demuxer.cc
index 140c83c..1c29108 100644
--- a/modules/congestion_controller/rtp/transport_feedback_demuxer.cc
+++ b/modules/congestion_controller/rtp/transport_feedback_demuxer.cc
@@ -9,11 +9,17 @@
  */
 #include "modules/congestion_controller/rtp/transport_feedback_demuxer.h"
 
+#include <cstddef>
+#include <cstdint>
 #include <utility>
 #include <vector>
 
 #include "absl/algorithm/container.h"
+#include "api/sequence_checker.h"
+#include "api/units/time_delta.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
+#include "rtc_base/checks.h"
 
 namespace webrtc {
 namespace {
diff --git a/modules/congestion_controller/rtp/transport_feedback_demuxer.h b/modules/congestion_controller/rtp/transport_feedback_demuxer.h
index 278c144..8066117 100644
--- a/modules/congestion_controller/rtp/transport_feedback_demuxer.h
+++ b/modules/congestion_controller/rtp/transport_feedback_demuxer.h
@@ -10,15 +10,16 @@
 #ifndef MODULES_CONGESTION_CONTROLLER_RTP_TRANSPORT_FEEDBACK_DEMUXER_H_
 #define MODULES_CONGESTION_CONTROLLER_RTP_TRANSPORT_FEEDBACK_DEMUXER_H_
 
+#include <cstdint>
 #include <map>
 #include <utility>
 #include <vector>
 
 #include "api/sequence_checker.h"
-#include "modules/include/module_common_types_public.h"
 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "rtc_base/numerics/sequence_number_unwrapper.h"
 #include "rtc_base/system/no_unique_address.h"
+#include "rtc_base/thread_annotations.h"
 
 namespace webrtc {
 
diff --git a/modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc b/modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc
index 5aa4ffc..79f25a9 100644
--- a/modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc
+++ b/modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc
@@ -9,6 +9,11 @@
  */
 #include "modules/congestion_controller/rtp/transport_feedback_demuxer.h"
 
+#include <cstdint>
+#include <vector>
+
+#include "api/units/timestamp.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
diff --git a/test/network/BUILD.gn b/test/network/BUILD.gn
index 70e1702..01b3bda 100644
--- a/test/network/BUILD.gn
+++ b/test/network/BUILD.gn
@@ -16,6 +16,7 @@
   ]
   if (rtc_include_tests) {
     visibility += [
+      "../../modules/congestion_controller/goog_cc:goog_cc_unittests",
       "../peer_scenario:*",
       "../scenario:*",
     ]