IWYU p2p and use C++ headers instead of C headers
Removing the C headers shown by
git grep "<*\.h>" p2p/
using
find p2p -name "*.h" -o -name "*.cc" | xargs sed -i '/<stdint.h>/d'
followed by
find p2p -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
tools_webrtc/gn_check_autofix.py -C out/Default/
followed by
git cl format
then manually removing double blank lines and moving a platform specific
include to the bottom.
Bug: webrtc:42226242
Change-Id: I9e5fcd22cee7358de9b4e2dde4f487f210550fd9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396824
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#44975}
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
index 5dab310..859b32d 100644
--- a/p2p/BUILD.gn
+++ b/p2p/BUILD.gn
@@ -77,6 +77,7 @@
":ice_switch_reason",
":ice_transport_internal",
":p2p_constants",
+ ":p2p_transport_channel_ice_field_trials",
":transport_description",
"../api:array_view",
"../api:candidate",
@@ -380,6 +381,7 @@
":connection",
":ice_controller_interface",
":ice_transport_internal",
+ ":p2p_transport_channel_ice_field_trials",
":transport_description",
]
}
@@ -539,6 +541,7 @@
"../rtc_base:network_route",
"../rtc_base:socket",
"../rtc_base/network:received_packet",
+ "../rtc_base/network:sent_packet",
"../rtc_base/system:rtc_export",
"../rtc_base/third_party/sigslot",
"//third_party/abseil-cpp/absl/functional:any_invocable",
@@ -1143,6 +1146,7 @@
"../rtc_base:threading",
"../rtc_base:timeutils",
"../rtc_base/network:received_packet",
+ "../rtc_base/network:sent_packet",
"../rtc_base/synchronization:mutex",
"../rtc_base/third_party/sigslot",
"../test:test_support",
@@ -1241,6 +1245,7 @@
"../api/task_queue",
"../api/task_queue:pending_task_safety_flag",
"../api/test/network_emulation",
+ "../api/transport:ecn_marking",
"../api/transport:enums",
"../api/transport:stun_types",
"../api/units:data_rate",
diff --git a/p2p/base/async_stun_tcp_socket.cc b/p2p/base/async_stun_tcp_socket.cc
index 9a1c906..8cbf16d 100644
--- a/p2p/base/async_stun_tcp_socket.cc
+++ b/p2p/base/async_stun_tcp_socket.cc
@@ -10,10 +10,7 @@
#include "p2p/base/async_stun_tcp_socket.h"
-#include <errno.h>
-#include <stdint.h>
-#include <string.h>
-
+#include <cerrno>
#include <cstddef>
#include <cstdint>
diff --git a/p2p/base/async_stun_tcp_socket.h b/p2p/base/async_stun_tcp_socket.h
index d4146d6..d74c759 100644
--- a/p2p/base/async_stun_tcp_socket.h
+++ b/p2p/base/async_stun_tcp_socket.h
@@ -11,8 +11,7 @@
#ifndef P2P_BASE_ASYNC_STUN_TCP_SOCKET_H_
#define P2P_BASE_ASYNC_STUN_TCP_SOCKET_H_
-#include <stddef.h>
-
+#include <cstddef>
#include <cstdint>
#include "api/array_view.h"
diff --git a/p2p/base/async_stun_tcp_socket_unittest.cc b/p2p/base/async_stun_tcp_socket_unittest.cc
index 5e3bd96..39515dd 100644
--- a/p2p/base/async_stun_tcp_socket_unittest.cc
+++ b/p2p/base/async_stun_tcp_socket_unittest.cc
@@ -10,9 +10,8 @@
#include "p2p/base/async_stun_tcp_socket.h"
-#include <stdint.h>
-#include <string.h>
-
+#include <cstddef>
+#include <cstring>
#include <list>
#include <memory>
#include <string>
diff --git a/p2p/base/basic_ice_controller.h b/p2p/base/basic_ice_controller.h
index e8593db..f5983db 100644
--- a/p2p/base/basic_ice_controller.h
+++ b/p2p/base/basic_ice_controller.h
@@ -26,6 +26,7 @@
#include "p2p/base/ice_switch_reason.h"
#include "p2p/base/ice_transport_internal.h"
#include "p2p/base/p2p_constants.h"
+#include "p2p/base/p2p_transport_channel_ice_field_trials.h"
#include "p2p/base/transport_description.h"
#include "rtc_base/network.h"
#include "rtc_base/network_constants.h"
diff --git a/p2p/base/basic_packet_socket_factory.cc b/p2p/base/basic_packet_socket_factory.cc
index 785f80b..3810e2b 100644
--- a/p2p/base/basic_packet_socket_factory.cc
+++ b/p2p/base/basic_packet_socket_factory.cc
@@ -10,8 +10,6 @@
#include "p2p/base/basic_packet_socket_factory.h"
-#include <stddef.h>
-
#include <cstdint>
#include <memory>
#include <string>
diff --git a/p2p/base/basic_packet_socket_factory.h b/p2p/base/basic_packet_socket_factory.h
index 276e309..f93d60a 100644
--- a/p2p/base/basic_packet_socket_factory.h
+++ b/p2p/base/basic_packet_socket_factory.h
@@ -11,8 +11,7 @@
#ifndef P2P_BASE_BASIC_PACKET_SOCKET_FACTORY_H_
#define P2P_BASE_BASIC_PACKET_SOCKET_FACTORY_H_
-#include <stdint.h>
-
+#include <cstdint>
#include <memory>
#include "api/async_dns_resolver.h"
diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc
index 92403b4..ffc5068 100644
--- a/p2p/base/connection.cc
+++ b/p2p/base/connection.cc
@@ -10,9 +10,8 @@
#include "p2p/base/connection.h"
-#include <math.h>
-
#include <algorithm>
+#include <cmath>
#include <cstddef>
#include <cstdint>
#include <memory>
diff --git a/p2p/base/connection.h b/p2p/base/connection.h
index 79cb94a..9e3c10b 100644
--- a/p2p/base/connection.h
+++ b/p2p/base/connection.h
@@ -11,8 +11,7 @@
#ifndef P2P_BASE_CONNECTION_H_
#define P2P_BASE_CONNECTION_H_
-#include <stddef.h>
-
+#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
diff --git a/p2p/base/ice_controller_factory_interface.h b/p2p/base/ice_controller_factory_interface.h
index bcf493d..26e44dc 100644
--- a/p2p/base/ice_controller_factory_interface.h
+++ b/p2p/base/ice_controller_factory_interface.h
@@ -18,6 +18,7 @@
#include "p2p/base/connection.h"
#include "p2p/base/ice_controller_interface.h"
#include "p2p/base/ice_transport_internal.h"
+#include "p2p/base/p2p_transport_channel_ice_field_trials.h"
#include "p2p/base/transport_description.h"
namespace webrtc {
diff --git a/p2p/base/ice_controller_interface.h b/p2p/base/ice_controller_interface.h
index a082d22..b63cb0c 100644
--- a/p2p/base/ice_controller_interface.h
+++ b/p2p/base/ice_controller_interface.h
@@ -20,7 +20,6 @@
#include "p2p/base/connection.h"
#include "p2p/base/ice_switch_reason.h"
#include "p2p/base/ice_transport_internal.h"
-#include "p2p/base/p2p_transport_channel_ice_field_trials.h"
#include "p2p/base/transport_description.h"
#include "rtc_base/checks.h"
#include "rtc_base/system/rtc_export.h"
diff --git a/p2p/base/ice_transport_internal.h b/p2p/base/ice_transport_internal.h
index ac63624..04ce84c 100644
--- a/p2p/base/ice_transport_internal.h
+++ b/p2p/base/ice_transport_internal.h
@@ -11,8 +11,7 @@
#ifndef P2P_BASE_ICE_TRANSPORT_INTERNAL_H_
#define P2P_BASE_ICE_TRANSPORT_INTERNAL_H_
-#include <stdint.h>
-
+#include <cstdint>
#include <functional>
#include <optional>
#include <string>
diff --git a/p2p/base/p2p_constants.h b/p2p/base/p2p_constants.h
index 80aa376..19973b9 100644
--- a/p2p/base/p2p_constants.h
+++ b/p2p/base/p2p_constants.h
@@ -11,8 +11,8 @@
#ifndef P2P_BASE_P2P_CONSTANTS_H_
#define P2P_BASE_P2P_CONSTANTS_H_
-#include <stddef.h>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
#include "rtc_base/system/rtc_export.h"
diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc
index 81af5da..f592513 100644
--- a/p2p/base/p2p_transport_channel.cc
+++ b/p2p/base/p2p_transport_channel.cc
@@ -10,12 +10,11 @@
#include "p2p/base/p2p_transport_channel.h"
-#include <errno.h>
-#include <stdlib.h>
-
#include <algorithm>
+#include <cerrno>
#include <cstdint>
#include <cstdio>
+#include <cstdlib>
#include <functional>
#include <memory>
#include <optional>
diff --git a/p2p/base/p2p_transport_channel.h b/p2p/base/p2p_transport_channel.h
index 479c2e5..e57bb5e 100644
--- a/p2p/base/p2p_transport_channel.h
+++ b/p2p/base/p2p_transport_channel.h
@@ -20,9 +20,8 @@
#ifndef P2P_BASE_P2P_TRANSPORT_CHANNEL_H_
#define P2P_BASE_P2P_TRANSPORT_CHANNEL_H_
-#include <stddef.h>
-#include <stdint.h>
-
+#include <cstddef>
+#include <cstdint>
#include <functional>
#include <map>
#include <memory>
diff --git a/p2p/base/packet_transport_internal.h b/p2p/base/packet_transport_internal.h
index 2418cf4..fe09f3c 100644
--- a/p2p/base/packet_transport_internal.h
+++ b/p2p/base/packet_transport_internal.h
@@ -20,6 +20,7 @@
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/callback_list.h"
#include "rtc_base/network/received_packet.h"
+#include "rtc_base/network/sent_packet.h"
#include "rtc_base/network_route.h"
#include "rtc_base/socket.h"
#include "rtc_base/system/rtc_export.h"
diff --git a/p2p/base/packet_transport_internal_unittest.cc b/p2p/base/packet_transport_internal_unittest.cc
index 0ffb26b..533e6a0 100644
--- a/p2p/base/packet_transport_internal_unittest.cc
+++ b/p2p/base/packet_transport_internal_unittest.cc
@@ -12,8 +12,8 @@
#include <optional>
+#include "api/transport/ecn_marking.h"
#include "p2p/test/fake_packet_transport.h"
-#include "rtc_base/network/ecn_marking.h"
#include "rtc_base/network/received_packet.h"
#include "rtc_base/socket_address.h"
#include "test/gmock.h"
diff --git a/p2p/base/port.cc b/p2p/base/port.cc
index f488e61..305660a 100644
--- a/p2p/base/port.cc
+++ b/p2p/base/port.cc
@@ -24,7 +24,6 @@
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/candidate.h"
-#include "api/rtc_error.h"
#include "api/sequence_checker.h"
#include "api/task_queue/task_queue_base.h"
#include "api/transport/stun.h"
diff --git a/p2p/base/port.h b/p2p/base/port.h
index b7dbe49..1af992a 100644
--- a/p2p/base/port.h
+++ b/p2p/base/port.h
@@ -11,9 +11,8 @@
#ifndef P2P_BASE_PORT_H_
#define P2P_BASE_PORT_H_
-#include <stddef.h>
-#include <stdint.h>
-
+#include <cstddef>
+#include <cstdint>
#include <functional>
#include <map>
#include <memory>
diff --git a/p2p/base/port_allocator.cc b/p2p/base/port_allocator.cc
index 0e7c1ad..ba95687 100644
--- a/p2p/base/port_allocator.cc
+++ b/p2p/base/port_allocator.cc
@@ -14,7 +14,6 @@
#include <iterator>
#include <memory>
#include <optional>
-#include <set>
#include <utility>
#include <vector>
diff --git a/p2p/base/port_allocator.h b/p2p/base/port_allocator.h
index 997ddfb..c1047cf 100644
--- a/p2p/base/port_allocator.h
+++ b/p2p/base/port_allocator.h
@@ -11,8 +11,7 @@
#ifndef P2P_BASE_PORT_ALLOCATOR_H_
#define P2P_BASE_PORT_ALLOCATOR_H_
-#include <stdint.h>
-
+#include <cstdint>
#include <memory>
#include <optional>
#include <string>
diff --git a/p2p/base/port_unittest.cc b/p2p/base/port_unittest.cc
index 68b0aea..3fe90e3 100644
--- a/p2p/base/port_unittest.cc
+++ b/p2p/base/port_unittest.cc
@@ -10,10 +10,10 @@
#include "p2p/base/port.h"
-#include <string.h>
-
#include <cmath>
+#include <cstddef>
#include <cstdint>
+#include <cstring>
#include <limits>
#include <list>
#include <memory>
diff --git a/p2p/base/pseudo_tcp.cc b/p2p/base/pseudo_tcp.cc
index a3e336e..afe1d16 100644
--- a/p2p/base/pseudo_tcp.cc
+++ b/p2p/base/pseudo_tcp.cc
@@ -10,12 +10,11 @@
#include "p2p/base/pseudo_tcp.h"
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
#include <algorithm>
+#include <cerrno>
+#include <cstddef>
#include <cstdint>
+#include <cstring>
#include <memory>
#include <set>
diff --git a/p2p/base/pseudo_tcp.h b/p2p/base/pseudo_tcp.h
index 9ba5799..f8f4e8f 100644
--- a/p2p/base/pseudo_tcp.h
+++ b/p2p/base/pseudo_tcp.h
@@ -11,9 +11,8 @@
#ifndef P2P_BASE_PSEUDO_TCP_H_
#define P2P_BASE_PSEUDO_TCP_H_
-#include <stddef.h>
-#include <stdint.h>
-
+#include <cstddef>
+#include <cstdint>
#include <list>
#include <memory>
diff --git a/p2p/base/pseudo_tcp_unittest.cc b/p2p/base/pseudo_tcp_unittest.cc
index 7d5400f..b29c8a4 100644
--- a/p2p/base/pseudo_tcp_unittest.cc
+++ b/p2p/base/pseudo_tcp_unittest.cc
@@ -10,11 +10,10 @@
#include "p2p/base/pseudo_tcp.h"
-#include <string.h>
-
#include <algorithm>
#include <cstddef>
#include <cstdint>
+#include <cstring>
#include <string>
#include <utility>
#include <vector>
diff --git a/p2p/base/stun_request.h b/p2p/base/stun_request.h
index 22a252e..6f47e65 100644
--- a/p2p/base/stun_request.h
+++ b/p2p/base/stun_request.h
@@ -11,9 +11,8 @@
#ifndef P2P_BASE_STUN_REQUEST_H_
#define P2P_BASE_STUN_REQUEST_H_
-#include <stddef.h>
-#include <stdint.h>
-
+#include <cstddef>
+#include <cstdint>
#include <functional>
#include <map>
#include <memory>
diff --git a/p2p/base/tcp_port.cc b/p2p/base/tcp_port.cc
index 625ff76..76fe9c0 100644
--- a/p2p/base/tcp_port.cc
+++ b/p2p/base/tcp_port.cc
@@ -66,8 +66,7 @@
#include "p2p/base/tcp_port.h"
-#include <errno.h>
-
+#include <cerrno>
#include <cstddef>
#include <cstdint>
#include <list>
diff --git a/p2p/base/transport_description_factory.cc b/p2p/base/transport_description_factory.cc
index 6391e89..3a0c947 100644
--- a/p2p/base/transport_description_factory.cc
+++ b/p2p/base/transport_description_factory.cc
@@ -10,8 +10,6 @@
#include "p2p/base/transport_description_factory.h"
-#include <stddef.h>
-
#include <memory>
#include <string>
diff --git a/p2p/base/transport_description_factory.h b/p2p/base/transport_description_factory.h
index b1a7cc9..28525ac 100644
--- a/p2p/base/transport_description_factory.h
+++ b/p2p/base/transport_description_factory.h
@@ -19,7 +19,6 @@
#include "p2p/base/ice_credentials_iterator.h"
#include "p2p/base/transport_description.h"
#include "rtc_base/rtc_certificate.h"
-#include "rtc_base/ssl_identity.h"
namespace webrtc {
diff --git a/p2p/base/transport_description_factory_unittest.cc b/p2p/base/transport_description_factory_unittest.cc
index fe08118..0236f80 100644
--- a/p2p/base/transport_description_factory_unittest.cc
+++ b/p2p/base/transport_description_factory_unittest.cc
@@ -10,8 +10,7 @@
#include "p2p/base/transport_description_factory.h"
-#include <stddef.h>
-
+#include <cstddef>
#include <memory>
#include <string>
#include <vector>
diff --git a/p2p/base/turn_port.h b/p2p/base/turn_port.h
index 794e4a4..c951ca4 100644
--- a/p2p/base/turn_port.h
+++ b/p2p/base/turn_port.h
@@ -11,8 +11,7 @@
#ifndef P2P_BASE_TURN_PORT_H_
#define P2P_BASE_TURN_PORT_H_
-#include <stdio.h>
-
+#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
diff --git a/p2p/base/turn_port_unittest.cc b/p2p/base/turn_port_unittest.cc
index c5da027..6858d7d 100644
--- a/p2p/base/turn_port_unittest.cc
+++ b/p2p/base/turn_port_unittest.cc
@@ -7,11 +7,19 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "p2p/base/turn_port.h"
+
#include <cstddef>
#include <cstdint>
+#include <list>
+#include <memory>
+#include <optional>
#include <string>
+#include <utility>
+#include <vector>
#include "absl/functional/any_invocable.h"
+#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/candidate.h"
#include "api/environment/environment.h"
@@ -20,56 +28,47 @@
#include "api/test/mock_async_dns_resolver.h"
#include "api/test/rtc_error_matchers.h"
#include "api/transport/stun.h"
-#include "p2p/base/connection_info.h"
-#include "p2p/base/port.h"
-#include "p2p/base/port_interface.h"
-#include "p2p/base/stun_request.h"
-#include "p2p/client/relay_port_factory_interface.h"
-#include "rtc_base/async_packet_socket.h"
-#include "rtc_base/ip_address.h"
-#include "rtc_base/net_helpers.h"
-#include "rtc_base/network.h"
-#include "rtc_base/network/received_packet.h"
-#include "rtc_base/third_party/sigslot/sigslot.h"
-#include "system_wrappers/include/metrics.h"
-#include "test/gmock.h"
-#include "test/wait_until.h"
-#if defined(WEBRTC_POSIX)
-#include <dirent.h> // IWYU pragma: keep
-
-#include "absl/strings/string_view.h"
-#endif
-
-#include <list>
-#include <memory>
-#include <optional>
-#include <utility>
-#include <vector>
-
#include "api/units/time_delta.h"
#include "p2p/base/basic_packet_socket_factory.h"
#include "p2p/base/connection.h"
+#include "p2p/base/connection_info.h"
#include "p2p/base/p2p_constants.h"
+#include "p2p/base/port.h"
#include "p2p/base/port_allocator.h"
+#include "p2p/base/port_interface.h"
#include "p2p/base/stun_port.h"
+#include "p2p/base/stun_request.h"
#include "p2p/base/transport_description.h"
-#include "p2p/base/turn_port.h"
+#include "p2p/client/relay_port_factory_interface.h"
#include "p2p/test/mock_dns_resolving_packet_socket_factory.h"
#include "p2p/test/test_turn_customizer.h"
#include "p2p/test/test_turn_server.h"
#include "p2p/test/turn_server.h"
+#include "rtc_base/async_packet_socket.h"
#include "rtc_base/buffer.h"
#include "rtc_base/byte_buffer.h"
#include "rtc_base/checks.h"
#include "rtc_base/fake_clock.h"
#include "rtc_base/gunit.h"
+#include "rtc_base/ip_address.h"
#include "rtc_base/net_helper.h"
+#include "rtc_base/net_helpers.h"
+#include "rtc_base/network.h"
+#include "rtc_base/network/received_packet.h"
#include "rtc_base/socket.h"
#include "rtc_base/socket_address.h"
+#include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread.h"
#include "rtc_base/time_utils.h"
#include "rtc_base/virtual_socket_server.h"
+#include "system_wrappers/include/metrics.h"
+#include "test/gmock.h"
#include "test/gtest.h"
+#include "test/wait_until.h"
+
+#if defined(WEBRTC_POSIX)
+#include <dirent.h> // IWYU pragma: keep
+#endif
namespace {
using ::testing::_;
diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc
index cf370d9..b8573ac 100644
--- a/p2p/client/basic_port_allocator.cc
+++ b/p2p/client/basic_port_allocator.cc
@@ -42,7 +42,6 @@
#include "p2p/client/relay_port_factory_interface.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/checks.h"
-#include "rtc_base/crypto_random.h"
#include "rtc_base/ip_address.h"
#include "rtc_base/logging.h"
#include "rtc_base/net_helper.h"
diff --git a/p2p/dtls/dtls_transport_internal.h b/p2p/dtls/dtls_transport_internal.h
index c54d567..6ab8412 100644
--- a/p2p/dtls/dtls_transport_internal.h
+++ b/p2p/dtls/dtls_transport_internal.h
@@ -11,9 +11,8 @@
#ifndef P2P_DTLS_DTLS_TRANSPORT_INTERNAL_H_
#define P2P_DTLS_DTLS_TRANSPORT_INTERNAL_H_
-#include <stddef.h>
-#include <stdint.h>
-
+#include <cstddef>
+#include <cstdint>
#include <memory>
#include <optional>
#include <utility>
diff --git a/p2p/test/fake_packet_transport.h b/p2p/test/fake_packet_transport.h
index d563ba5..3670079 100644
--- a/p2p/test/fake_packet_transport.h
+++ b/p2p/test/fake_packet_transport.h
@@ -19,8 +19,10 @@
#include "api/transport/ecn_marking.h"
#include "api/units/timestamp.h"
#include "p2p/base/packet_transport_internal.h"
+#include "rtc_base/async_packet_socket.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/network/received_packet.h"
+#include "rtc_base/network/sent_packet.h"
#include "rtc_base/network_route.h"
#include "rtc_base/socket.h"
#include "rtc_base/socket_address.h"
diff --git a/p2p/test/nat_socket_factory.h b/p2p/test/nat_socket_factory.h
index 2da761d..d125856 100644
--- a/p2p/test/nat_socket_factory.h
+++ b/p2p/test/nat_socket_factory.h
@@ -11,8 +11,7 @@
#ifndef P2P_TEST_NAT_SOCKET_FACTORY_H_
#define P2P_TEST_NAT_SOCKET_FACTORY_H_
-#include <stddef.h>
-
+#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
diff --git a/p2p/test/nat_unittest.cc b/p2p/test/nat_unittest.cc
index e98bd17..9f80568 100644
--- a/p2p/test/nat_unittest.cc
+++ b/p2p/test/nat_unittest.cc
@@ -8,10 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <string.h>
-
#include <algorithm>
#include <cstddef>
+#include <cstring>
#include <memory>
#include <vector>
diff --git a/p2p/test/stun_server.h b/p2p/test/stun_server.h
index 517fa1d..072c866 100644
--- a/p2p/test/stun_server.h
+++ b/p2p/test/stun_server.h
@@ -11,8 +11,6 @@
#ifndef P2P_TEST_STUN_SERVER_H_
#define P2P_TEST_STUN_SERVER_H_
-#include <stddef.h>
-
#include <memory>
#include "absl/strings/string_view.h"
diff --git a/p2p/test/stun_server_unittest.cc b/p2p/test/stun_server_unittest.cc
index 1a86a30..8baa8b7 100644
--- a/p2p/test/stun_server_unittest.cc
+++ b/p2p/test/stun_server_unittest.cc
@@ -10,8 +10,7 @@
#include "p2p/test/stun_server.h"
-#include <string.h>
-
+#include <cstring>
#include <memory>
#include <string>