Fix lint issues in pacing/
(Mostly include-what-you-use.)
Bug: webrtc:42226242
Change-Id: I3717cccb24ac4f0a5443995d1d355561a5a54c8d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361601
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42971}
diff --git a/modules/pacing/BUILD.gn b/modules/pacing/BUILD.gn
index 7878676..21d529f 100644
--- a/modules/pacing/BUILD.gn
+++ b/modules/pacing/BUILD.gn
@@ -30,9 +30,11 @@
deps = [
":interval_budget",
+ "../../api:array_view",
"../../api:field_trials_view",
"../../api:field_trials_view",
"../../api:function_view",
+ "../../api:rtp_headers",
"../../api:rtp_packet_sender",
"../../api:sequence_checker",
"../../api/rtc_event_log",
@@ -51,6 +53,7 @@
"../../rtc_base:logging",
"../../rtc_base:macromagic",
"../../rtc_base:rtc_numerics",
+ "../../rtc_base:safe_conversions",
"../../rtc_base:timeutils",
"../../rtc_base/experiments:field_trial_parser",
"../../rtc_base/synchronization:mutex",
@@ -94,6 +97,9 @@
deps = [
":interval_budget",
":pacing",
+ "../../api:array_view",
+ "../../api:rtp_headers",
+ "../../api:sequence_checker",
"../../api/task_queue:task_queue",
"../../api/transport:field_trial_based_config",
"../../api/transport:network_control",
diff --git a/modules/pacing/bitrate_prober.cc b/modules/pacing/bitrate_prober.cc
index 5b6142a..dc9f4be 100644
--- a/modules/pacing/bitrate_prober.cc
+++ b/modules/pacing/bitrate_prober.cc
@@ -11,11 +11,17 @@
#include "modules/pacing/bitrate_prober.h"
#include <algorithm>
+#include <cstddef>
+#include <optional>
#include "api/field_trials_view.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"
+#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/logging.h"
namespace webrtc {
diff --git a/modules/pacing/bitrate_prober.h b/modules/pacing/bitrate_prober.h
index 7ceb129..86da9c1 100644
--- a/modules/pacing/bitrate_prober.h
+++ b/modules/pacing/bitrate_prober.h
@@ -12,12 +12,13 @@
#define MODULES_PACING_BITRATE_PROBER_H_
#include <stddef.h>
-#include <stdint.h>
+#include <optional>
#include <queue>
#include "api/field_trials_view.h"
#include "api/transport/network_types.h"
+#include "api/units/data_size.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "rtc_base/experiments/field_trial_parser.h"
diff --git a/modules/pacing/bitrate_prober_unittest.cc b/modules/pacing/bitrate_prober_unittest.cc
index 2954398..826e895 100644
--- a/modules/pacing/bitrate_prober_unittest.cc
+++ b/modules/pacing/bitrate_prober_unittest.cc
@@ -15,6 +15,7 @@
#include "api/transport/field_trial_based_config.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 "test/explicit_key_value_config.h"
diff --git a/modules/pacing/interval_budget.cc b/modules/pacing/interval_budget.cc
index 321ca46..2057c2d 100644
--- a/modules/pacing/interval_budget.cc
+++ b/modules/pacing/interval_budget.cc
@@ -11,6 +11,8 @@
#include "modules/pacing/interval_budget.h"
#include <algorithm>
+#include <cstddef>
+#include <cstdint>
#include "rtc_base/numerics/safe_conversions.h"
diff --git a/modules/pacing/interval_budget_unittest.cc b/modules/pacing/interval_budget_unittest.cc
index e182d35..8be0f61 100644
--- a/modules/pacing/interval_budget_unittest.cc
+++ b/modules/pacing/interval_budget_unittest.cc
@@ -10,6 +10,8 @@
#include "modules/pacing/interval_budget.h"
+#include <cstddef>
+
#include "test/gtest.h"
namespace webrtc {
diff --git a/modules/pacing/pacing_controller.cc b/modules/pacing/pacing_controller.cc
index 5999fa5..011b1c8 100644
--- a/modules/pacing/pacing_controller.cc
+++ b/modules/pacing/pacing_controller.cc
@@ -11,12 +11,21 @@
#include "modules/pacing/pacing_controller.h"
#include <algorithm>
+#include <array>
+#include <cstddef>
+#include <cstdint>
#include <memory>
+#include <optional>
#include <utility>
#include <vector>
#include "absl/cleanup/cleanup.h"
#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
+#include "api/array_view.h"
+#include "api/field_trials_view.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"
@@ -24,6 +33,7 @@
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
+#include "rtc_base/numerics/safe_conversions.h"
#include "system_wrappers/include/clock.h"
namespace webrtc {
diff --git a/modules/pacing/pacing_controller.h b/modules/pacing/pacing_controller.h
index db70ec9..880af29 100644
--- a/modules/pacing/pacing_controller.h
+++ b/modules/pacing/pacing_controller.h
@@ -15,26 +15,23 @@
#include <stdint.h>
#include <array>
-#include <atomic>
#include <memory>
#include <optional>
#include <vector>
+#include "api/array_view.h"
#include "api/field_trials_view.h"
-#include "api/function_view.h"
#include "api/rtp_packet_sender.h"
-#include "api/transport/field_trial_based_config.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 "modules/pacing/bitrate_prober.h"
-#include "modules/pacing/interval_budget.h"
#include "modules/pacing/prioritized_packet_queue.h"
-#include "modules/pacing/rtp_packet_pacer.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
-#include "rtc_base/experiments/field_trial_parser.h"
-#include "rtc_base/thread_annotations.h"
+#include "system_wrappers/include/clock.h"
namespace webrtc {
diff --git a/modules/pacing/pacing_controller_unittest.cc b/modules/pacing/pacing_controller_unittest.cc
index 01430ff..4618bd3 100644
--- a/modules/pacing/pacing_controller_unittest.cc
+++ b/modules/pacing/pacing_controller_unittest.cc
@@ -11,16 +11,24 @@
#include "modules/pacing/pacing_controller.h"
#include <algorithm>
+#include <cmath>
#include <cstddef>
+#include <cstdint>
+#include <cstdlib>
#include <memory>
+#include <optional>
#include <utility>
#include <vector>
+#include "api/array_view.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 "modules/pacing/bitrate_prober.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
+#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "system_wrappers/include/clock.h"
#include "test/explicit_key_value_config.h"
#include "test/gmock.h"
diff --git a/modules/pacing/packet_router.cc b/modules/pacing/packet_router.cc
index 8f4d492..f85a9af 100644
--- a/modules/pacing/packet_router.cc
+++ b/modules/pacing/packet_router.cc
@@ -12,15 +12,20 @@
#include <algorithm>
#include <cstdint>
-#include <limits>
#include <memory>
#include <optional>
#include <utility>
+#include <vector>
#include "absl/functional/any_invocable.h"
+#include "api/array_view.h"
+#include "api/rtp_headers.h"
+#include "api/sequence_checker.h"
#include "api/transport/network_types.h"
+#include "api/units/data_size.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtcp_packet.h"
+#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
diff --git a/modules/pacing/packet_router.h b/modules/pacing/packet_router.h
index 1422645..be0617d 100644
--- a/modules/pacing/packet_router.h
+++ b/modules/pacing/packet_router.h
@@ -17,14 +17,16 @@
#include <cstdint>
#include <list>
#include <memory>
+#include <optional>
#include <set>
#include <unordered_map>
-#include <utility>
#include <vector>
#include "absl/functional/any_invocable.h"
+#include "api/array_view.h"
#include "api/sequence_checker.h"
#include "api/transport/network_types.h"
+#include "api/units/data_size.h"
#include "modules/pacing/pacing_controller.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtcp_packet.h"
diff --git a/modules/pacing/packet_router_unittest.cc b/modules/pacing/packet_router_unittest.cc
index 20e9622..f9a55c7 100644
--- a/modules/pacing/packet_router_unittest.cc
+++ b/modules/pacing/packet_router_unittest.cc
@@ -13,12 +13,20 @@
#include <cstddef>
#include <cstdint>
#include <memory>
+#include <optional>
#include <utility>
+#include <vector>
+#include "api/rtp_headers.h"
+#include "api/transport/network_types.h"
+#include "api/units/data_size.h"
#include "api/units/time_delta.h"
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
+#include "modules/rtp_rtcp/source/rtcp_packet.h"
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
+#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "rtc_base/checks.h"
#include "rtc_base/fake_clock.h"
@@ -35,19 +43,13 @@
namespace {
using ::testing::_;
-using ::testing::AnyNumber;
-using ::testing::AtLeast;
using ::testing::ElementsAreArray;
-using ::testing::Field;
-using ::testing::Gt;
using ::testing::InSequence;
-using ::testing::Le;
using ::testing::MockFunction;
using ::testing::NiceMock;
using ::testing::Pointee;
using ::testing::Property;
using ::testing::Return;
-using ::testing::SaveArg;
constexpr int kProbeMinProbes = 5;
constexpr int kProbeMinBytes = 1000;
diff --git a/modules/pacing/prioritized_packet_queue.cc b/modules/pacing/prioritized_packet_queue.cc
index fa2ad7d..1fd1066 100644
--- a/modules/pacing/prioritized_packet_queue.cc
+++ b/modules/pacing/prioritized_packet_queue.cc
@@ -12,10 +12,15 @@
#include <algorithm>
#include <array>
+#include <cstddef>
+#include <cstdint>
+#include <deque>
+#include <memory>
#include <optional>
#include <utility>
#include "absl/container/inlined_vector.h"
+#include "api/units/data_size.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
diff --git a/modules/pacing/prioritized_packet_queue.h b/modules/pacing/prioritized_packet_queue.h
index 179ef10..bb6465d 100644
--- a/modules/pacing/prioritized_packet_queue.h
+++ b/modules/pacing/prioritized_packet_queue.h
@@ -14,6 +14,7 @@
#include <stddef.h>
#include <array>
+#include <cstdint>
#include <deque>
#include <list>
#include <memory>
@@ -23,6 +24,7 @@
#include "api/units/data_size.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
namespace webrtc {
diff --git a/modules/pacing/prioritized_packet_queue_unittest.cc b/modules/pacing/prioritized_packet_queue_unittest.cc
index 76c3103..6370fac 100644
--- a/modules/pacing/prioritized_packet_queue_unittest.cc
+++ b/modules/pacing/prioritized_packet_queue_unittest.cc
@@ -10,14 +10,17 @@
#include "modules/pacing/prioritized_packet_queue.h"
+#include <cstddef>
+#include <cstdint>
#include <memory>
#include <utility>
+#include "api/units/data_size.h"
#include "api/units/time_delta.h"
+#include "api/units/timestamp.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "rtc_base/checks.h"
-#include "test/gmock.h"
#include "test/gtest.h"
namespace webrtc {
diff --git a/modules/pacing/rtp_packet_pacer.h b/modules/pacing/rtp_packet_pacer.h
index f388c07..d195163 100644
--- a/modules/pacing/rtp_packet_pacer.h
+++ b/modules/pacing/rtp_packet_pacer.h
@@ -11,7 +11,6 @@
#ifndef MODULES_PACING_RTP_PACKET_PACER_H_
#define MODULES_PACING_RTP_PACKET_PACER_H_
-#include <stdint.h>
#include <optional>
#include <vector>
diff --git a/modules/pacing/task_queue_paced_sender.cc b/modules/pacing/task_queue_paced_sender.cc
index ca89770..ef94a98 100644
--- a/modules/pacing/task_queue_paced_sender.cc
+++ b/modules/pacing/task_queue_paced_sender.cc
@@ -11,12 +11,27 @@
#include "modules/pacing/task_queue_paced_sender.h"
#include <algorithm>
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <optional>
#include <utility>
+#include <vector>
#include "absl/cleanup/cleanup.h"
+#include "api/field_trials_view.h"
+#include "api/sequence_checker.h"
#include "api/task_queue/pending_task_safety_flag.h"
+#include "api/task_queue/task_queue_base.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 "modules/pacing/pacing_controller.h"
+#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "rtc_base/checks.h"
+#include "rtc_base/numerics/exp_filter.h"
#include "rtc_base/trace_event.h"
namespace webrtc {
diff --git a/modules/pacing/task_queue_paced_sender.h b/modules/pacing/task_queue_paced_sender.h
index be2bc84..bc46a75 100644
--- a/modules/pacing/task_queue_paced_sender.h
+++ b/modules/pacing/task_queue_paced_sender.h
@@ -19,15 +19,18 @@
#include <vector>
#include "api/field_trials_view.h"
+#include "api/rtp_packet_sender.h"
#include "api/sequence_checker.h"
#include "api/task_queue/pending_task_safety_flag.h"
+#include "api/task_queue/task_queue_base.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 "modules/pacing/pacing_controller.h"
#include "modules/pacing/rtp_packet_pacer.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
-#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/numerics/exp_filter.h"
#include "rtc_base/thread_annotations.h"
diff --git a/modules/pacing/task_queue_paced_sender_unittest.cc b/modules/pacing/task_queue_paced_sender_unittest.cc
index fda6615..061cf1d 100644
--- a/modules/pacing/task_queue_paced_sender_unittest.cc
+++ b/modules/pacing/task_queue_paced_sender_unittest.cc
@@ -11,20 +11,20 @@
#include "modules/pacing/task_queue_paced_sender.h"
#include <algorithm>
-#include <any>
-#include <atomic>
-#include <list>
+#include <cstddef>
+#include <cstdint>
#include <memory>
-#include <string>
#include <utility>
#include <vector>
+#include "api/sequence_checker.h"
#include "api/task_queue/task_queue_base.h"
#include "api/task_queue/task_queue_factory.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 "modules/pacing/pacing_controller.h"
#include "modules/pacing/packet_router.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
@@ -36,10 +36,7 @@
using ::testing::_;
using ::testing::AtLeast;
using ::testing::AtMost;
-using ::testing::Lt;
using ::testing::NiceMock;
-using ::testing::Return;
-using ::testing::SaveArg;
namespace webrtc {
namespace {