Automated change: Fix sanity tests
diff --git a/src/core/handshaker/security/legacy_secure_endpoint.cc b/src/core/handshaker/security/legacy_secure_endpoint.cc index ff9bab9..7c416bf 100644 --- a/src/core/handshaker/security/legacy_secure_endpoint.cc +++ b/src/core/handshaker/security/legacy_secure_endpoint.cc
@@ -18,6 +18,19 @@ #include "src/core/handshaker/security/legacy_secure_endpoint.h" +#include <inttypes.h> + +#include <algorithm> +#include <atomic> +#include <memory> + +#include "absl/base/thread_annotations.h" +#include "absl/log/check.h" +#include "absl/log/log.h" +#include "absl/status/status.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" + #include <grpc/event_engine/memory_allocator.h> #include <grpc/event_engine/memory_request.h> #include <grpc/slice.h> @@ -27,11 +40,6 @@ #include <grpc/support/log.h> #include <grpc/support/port_platform.h> #include <grpc/support/sync.h> -#include <inttypes.h> - -#include <algorithm> -#include <atomic> -#include <memory> #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/debug_location.h" @@ -49,12 +57,6 @@ #include "src/core/tsi/transport_security_grpc.h" #include "src/core/tsi/transport_security_interface.h" #include "src/core/util/string.h" -#include "absl/base/thread_annotations.h" -#include "absl/log/check.h" -#include "absl/log/log.h" -#include "absl/status/status.h" -#include "absl/strings/string_view.h" -#include "absl/types/optional.h" #define STAGING_BUFFER_SIZE 8192
diff --git a/src/core/handshaker/security/secure_endpoint.cc b/src/core/handshaker/security/secure_endpoint.cc index 5aea209..b613a11 100644 --- a/src/core/handshaker/security/secure_endpoint.cc +++ b/src/core/handshaker/security/secure_endpoint.cc
@@ -18,19 +18,26 @@ #include "src/core/handshaker/security/secure_endpoint.h" -#include <grpc/support/port_platform.h> - #include <atomic> #include <cstddef> #include <cstdint> #include <utility> -#include "include/grpc/event_engine/event_engine.h" -#include "include/grpc/event_engine/slice.h" -#include "include/grpc/event_engine/slice_buffer.h" -#include "include/grpc/slice.h" -#include "include/grpc/support/alloc.h" -#include "include/grpc/support/log.h" +#include "absl/base/thread_annotations.h" +#include "absl/functional/any_invocable.h" +#include "absl/functional/bind_front.h" +#include "absl/log/check.h" +#include "absl/log/log.h" +#include "absl/status/status.h" + +#include <grpc/event_engine/event_engine.h> +#include <grpc/event_engine/slice.h> +#include <grpc/event_engine/slice_buffer.h> +#include <grpc/slice.h> +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include <grpc/support/port_platform.h> + #include "src/core/lib/debug/trace_impl.h" #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/event_engine/extensions/supports_fd.h" @@ -44,12 +51,6 @@ #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/tsi/transport_security_grpc.h" #include "src/core/tsi/transport_security_interface.h" -#include "absl/base/thread_annotations.h" -#include "absl/functional/any_invocable.h" -#include "absl/functional/bind_front.h" -#include "absl/log/check.h" -#include "absl/log/log.h" -#include "absl/status/status.h" #define STAGING_BUFFER_SIZE 8192 @@ -522,7 +523,7 @@ std::move(to_wrap), leftover_slices, channel_args, leftover_nslices)) {} - ~SecureEndpoint() = default; + ~SecureEndpoint() override = default; bool Read(absl::AnyInvocable<void(absl::Status)> on_read, SliceBuffer* buffer, const ReadArgs* args) override { @@ -563,7 +564,7 @@ std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint> to_wrap, grpc_event_engine::experimental::Slice* leftover_slices, - const grpc_core::ChannelArgs& channel_args, size_t leftover_nslices) { + const ChannelArgs& channel_args, size_t leftover_nslices) { return std::make_unique<SecureEndpoint>(protector, zero_copy_protector, std::move(to_wrap), leftover_slices, channel_args, leftover_nslices);
diff --git a/src/core/handshaker/security/secure_endpoint.h b/src/core/handshaker/security/secure_endpoint.h index a9b4207..212ac56 100644 --- a/src/core/handshaker/security/secure_endpoint.h +++ b/src/core/handshaker/security/secure_endpoint.h
@@ -19,14 +19,15 @@ #ifndef GRPC_SRC_CORE_HANDSHAKER_SECURITY_SECURE_ENDPOINT_H #define GRPC_SRC_CORE_HANDSHAKER_SECURITY_SECURE_ENDPOINT_H -#include <grpc/grpc.h> -#include <grpc/slice.h> -#include <grpc/support/port_platform.h> #include <stddef.h> #include <memory> -#include "include/grpc/event_engine/event_engine.h" +#include <grpc/event_engine/event_engine.h> +#include <grpc/grpc.h> +#include <grpc/slice.h> +#include <grpc/support/port_platform.h> + #include "src/core/lib/channel/channel_args.h" #include "src/core/tsi/transport_security_interface.h" @@ -42,7 +43,7 @@ std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint> to_wrap, grpc_event_engine::experimental::Slice* leftover_slices, - const grpc_core::ChannelArgs& channel_args, size_t leftover_nslices); + const ChannelArgs& channel_args, size_t leftover_nslices); } // namespace grpc_core
diff --git a/src/core/handshaker/security/security_handshaker.cc b/src/core/handshaker/security/security_handshaker.cc index a8beba8..bf7746d 100644 --- a/src/core/handshaker/security/security_handshaker.cc +++ b/src/core/handshaker/security/security_handshaker.cc
@@ -18,14 +18,6 @@ #include "src/core/handshaker/security/security_handshaker.h" -#include <grpc/grpc_security.h> -#include <grpc/grpc_security_constants.h> -#include <grpc/impl/channel_arg_names.h> -#include <grpc/slice.h> -#include <grpc/slice_buffer.h> -#include <grpc/support/alloc.h> -#include <grpc/support/log.h> -#include <grpc/support/port_platform.h> #include <limits.h> #include <stdint.h> #include <string.h> @@ -35,6 +27,22 @@ #include <string> #include <utility> +#include "absl/base/attributes.h" +#include "absl/log/check.h" +#include "absl/status/status.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" + +#include <grpc/grpc_security.h> +#include <grpc/grpc_security_constants.h> +#include <grpc/impl/channel_arg_names.h> +#include <grpc/slice.h> +#include <grpc/slice_buffer.h> +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include <grpc/support/port_platform.h> + #include "src/core/channelz/channelz.h" #include "src/core/handshaker/handshaker.h" #include "src/core/handshaker/handshaker_factory.h" @@ -58,12 +66,6 @@ #include "src/core/telemetry/stats.h" #include "src/core/telemetry/stats_data.h" #include "src/core/tsi/transport_security_grpc.h" -#include "absl/base/attributes.h" -#include "absl/log/check.h" -#include "absl/status/status.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/string_view.h" -#include "absl/types/optional.h" #define GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE 256
diff --git a/src/core/lib/debug/trace_flags.cc b/src/core/lib/debug/trace_flags.cc index 2afd884..05ef50a 100644 --- a/src/core/lib/debug/trace_flags.cc +++ b/src/core/lib/debug/trace_flags.cc
@@ -76,8 +76,6 @@ TraceFlag event_engine_endpoint_trace(false, "event_engine_endpoint"); TraceFlag event_engine_endpoint_data_trace(false, "event_engine_endpoint_data"); TraceFlag event_engine_poller_trace(false, "event_engine_poller"); -TraceFlag event_engine_secure_endpoint_trace(false, - "event_engine_secure_endpoint"); TraceFlag executor_trace(false, "executor"); TraceFlag fault_injection_filter_trace(false, "fault_injection_filter"); TraceFlag flowctl_trace(false, "flowctl");
diff --git a/src/core/lib/debug/trace_flags.h b/src/core/lib/debug/trace_flags.h index 9803e5e..65d59df 100644 --- a/src/core/lib/debug/trace_flags.h +++ b/src/core/lib/debug/trace_flags.h
@@ -74,7 +74,6 @@ extern TraceFlag event_engine_endpoint_trace; extern TraceFlag event_engine_endpoint_data_trace; extern TraceFlag event_engine_poller_trace; -extern TraceFlag event_engine_secure_endpoint_trace; extern TraceFlag executor_trace; extern TraceFlag fault_injection_filter_trace; extern TraceFlag flowctl_trace;
diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint_pair.h b/src/core/lib/iomgr/event_engine_shims/endpoint_pair.h index 847466e..999e112 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint_pair.h +++ b/src/core/lib/iomgr/event_engine_shims/endpoint_pair.h
@@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_PAIR_H_ -#define GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_PAIR_H_ +#ifndef GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_PAIR_H +#define GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_PAIR_H #include <grpc/event_engine/event_engine.h> #include <grpc/support/port_platform.h> @@ -51,4 +51,4 @@ } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_PAIR_H_ +#endif // GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_PAIR_H
diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint_pair_posix.cc b/src/core/lib/iomgr/event_engine_shims/endpoint_pair_posix.cc index 0dd2e93..5106028 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint_pair_posix.cc +++ b/src/core/lib/iomgr/event_engine_shims/endpoint_pair_posix.cc
@@ -23,15 +23,19 @@ #ifdef GRPC_POSIX_SOCKET_TCP #include <errno.h> #include <fcntl.h> -#include <grpc/event_engine/event_engine.h> -#include <grpc/support/alloc.h> -#include <grpc/support/log.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <string> +#include "absl/log/check.h" +#include "absl/strings/str_cat.h" + +#include <grpc/event_engine/event_engine.h> +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> + #include "src/core/lib/event_engine/channel_args_endpoint_config.h" #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/event_engine/extensions/supports_fd.h" @@ -44,8 +48,6 @@ #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/resource_quota/api.h" #include "src/core/util/string.h" -#include "absl/log/check.h" -#include "absl/strings/str_cat.h" namespace grpc_event_engine { namespace experimental {
diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint_pair_windows.cc b/src/core/lib/iomgr/event_engine_shims/endpoint_pair_windows.cc index 1b43b57..e95ee0d 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint_pair_windows.cc +++ b/src/core/lib/iomgr/event_engine_shims/endpoint_pair_windows.cc
@@ -23,11 +23,15 @@ #ifdef GRPC_WINSOCK_SOCKET #include <errno.h> #include <fcntl.h> -#include <grpc/event_engine/event_engine.h> #include <string.h> #include <memory> +#include "absl/log/check.h" +#include "absl/log/log.h" + +#include <grpc/event_engine/event_engine.h> + #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/event_engine/thread_pool/thread_pool.h" #include "src/core/lib/event_engine/windows/win_socket.h" @@ -38,8 +42,6 @@ #include "src/core/lib/iomgr/socket_windows.h" #include "src/core/lib/iomgr/tcp_windows.h" #include "src/core/lib/resource_quota/api.h" -#include "absl/log/check.h" -#include "absl/log/log.h" namespace grpc_event_engine { namespace experimental { @@ -64,7 +66,7 @@ SOCKET_ERROR); cli_sock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, - ::grpc_get_default_wsa_socket_flags()); + grpc_get_default_wsa_socket_flags()); CHECK(cli_sock != INVALID_SOCKET); CHECK(WSAConnect(cli_sock, (grpc_sockaddr*)&addr, addr_len, NULL, NULL, NULL,
diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc index 571c930..5505766 100644 --- a/test/core/security/secure_endpoint_test.cc +++ b/test/core/security/secure_endpoint_test.cc
@@ -19,13 +19,18 @@ #include "src/core/handshaker/security/secure_endpoint.h" #include <fcntl.h> -#include <grpc/grpc.h> -#include <grpc/support/alloc.h> -#include <gtest/gtest.h> #include <sys/types.h> #include <memory> +#include <gtest/gtest.h> + +#include "absl/log/check.h" +#include "absl/log/log.h" + +#include <grpc/grpc.h> +#include <grpc/support/alloc.h> + #include "src/core/handshaker/security/legacy_secure_endpoint.h" #include "src/core/lib/event_engine/channel_args_endpoint_config.h" #include "src/core/lib/event_engine/default_event_engine.h" @@ -44,8 +49,6 @@ #include "src/core/util/useful.h" #include "test/core/iomgr/endpoint_tests.h" #include "test/core/test_util/test_config.h" -#include "absl/log/check.h" -#include "absl/log/log.h" static gpr_mu* g_mu; static grpc_pollset* g_pollset; @@ -73,7 +76,7 @@ class InterceptEndpoint : public EventEngine::Endpoint, EndpointSupportsFdExtension { public: - InterceptEndpoint(std::unique_ptr<EventEngine::Endpoint> wrapped_ep) + explicit InterceptEndpoint(std::unique_ptr<EventEngine::Endpoint> wrapped_ep) : wrapped_ep_(std::move(wrapped_ep)) {} bool Read(absl::AnyInvocable<void(absl::Status)> on_read, SliceBuffer* buffer,