From c443e33cc67aaf749af08d5f0f84ba918c819bcf Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 5 May 2022 14:36:56 -0700 Subject: [PATCH] [iwyu] chttp2 (#29580) * [iwyu] chttp2 * fix * Automated change: Fix sanity tests * Automated change: Fix sanity tests * Automated change: Fix sanity tests * fwd file * fix * fix * Automated change: Fix sanity tests * fix Co-authored-by: ctiller --- BUILD | 52 +++++++++++++++++ CMakeLists.txt | 10 ++-- build_autogenerated.yaml | 4 ++ gRPC-C++.podspec | 3 + gRPC-Core.podspec | 3 + grpc.gemspec | 1 + grpc.gyp | 2 + package.xml | 1 + .../chttp2/client/chttp2_connector.cc | 32 ++++++++--- .../chttp2/client/chttp2_connector.h | 8 +++ .../transport/chttp2/server/chttp2_server.cc | 39 ++++++++++--- .../transport/chttp2/server/chttp2_server.h | 2 + .../transport/chttp2/transport/bin_decoder.cc | 6 +- .../transport/chttp2/transport/bin_decoder.h | 2 + .../transport/chttp2/transport/bin_encoder.cc | 1 + .../chttp2/transport/chttp2_transport.cc | 56 +++++++++++++++---- .../chttp2/transport/chttp2_transport.h | 5 ++ .../chttp2/transport/context_list.cc | 4 ++ .../transport/chttp2/transport/context_list.h | 4 ++ .../chttp2/transport/flow_control.cc | 8 ++- .../transport/chttp2/transport/flow_control.h | 6 ++ .../transport/chttp2/transport/frame_data.cc | 8 ++- .../transport/chttp2/transport/frame_data.h | 4 ++ .../chttp2/transport/frame_goaway.cc | 3 + .../transport/chttp2/transport/frame_goaway.h | 3 + .../transport/chttp2/transport/frame_ping.cc | 5 ++ .../transport/chttp2/transport/frame_ping.h | 3 + .../chttp2/transport/frame_rst_stream.cc | 8 ++- .../chttp2/transport/frame_rst_stream.h | 3 + .../chttp2/transport/frame_settings.cc | 15 ++++- .../chttp2/transport/frame_settings.h | 4 ++ .../chttp2/transport/frame_window_update.cc | 5 +- .../chttp2/transport/frame_window_update.h | 3 + .../chttp2/transport/hpack_encoder.cc | 20 +++---- .../chttp2/transport/hpack_encoder.h | 15 +++++ .../chttp2/transport/hpack_encoder_table.cc | 3 + .../chttp2/transport/hpack_encoder_table.h | 3 + .../chttp2/transport/hpack_parser.cc | 30 +++++++--- .../transport/chttp2/transport/hpack_parser.h | 6 ++ .../chttp2/transport/hpack_parser_table.cc | 13 +++-- .../chttp2/transport/hpack_parser_table.h | 5 ++ .../ext/transport/chttp2/transport/internal.h | 22 ++++++++ .../ext/transport/chttp2/transport/parsing.cc | 33 +++++++++-- .../chttp2/transport/stream_lists.cc | 6 +- .../transport/chttp2/transport/stream_map.cc | 2 +- .../transport/chttp2/transport/stream_map.h | 1 + .../ext/transport/chttp2/transport/varint.h | 2 + .../ext/transport/chttp2/transport/writing.cc | 39 ++++++++++++- src/core/lib/channel/handshaker_factory.h | 13 ++--- src/core/lib/channel/handshaker_registry.h | 1 + src/core/lib/iomgr/iomgr_fwd.h | 25 +++++++++ src/core/lib/iomgr/pollset_set.h | 3 +- src/core/lib/resolver/resolver_factory.h | 3 +- src/core/lib/transport/transport.h | 1 + src/core/lib/transport/transport_impl.h | 1 + tools/dockerfile/grpc_iwyu/iwyu.sh | 1 + tools/doxygen/Doxyfile.c++.internal | 1 + tools/doxygen/Doxyfile.core.internal | 1 + 58 files changed, 476 insertions(+), 87 deletions(-) create mode 100644 src/core/lib/iomgr/iomgr_fwd.h diff --git a/BUILD b/BUILD index 64b527c8f54..4fd4da5b0c3 100644 --- a/BUILD +++ b/BUILD @@ -1466,6 +1466,7 @@ grpc_cc_library( ], deps = [ "gpr_base", + "iomgr_fwd", ], ) @@ -1744,6 +1745,13 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "iomgr_fwd", + hdrs = [ + "src/core/lib/iomgr/iomgr_fwd.h", + ], +) + grpc_cc_library( name = "grpc_sockaddr", srcs = [ @@ -2429,6 +2437,7 @@ grpc_cc_library( deps = [ "gpr_base", "grpc_service_config", + "iomgr_fwd", "orphanable", "server_address", "uri_parser", @@ -4606,24 +4615,41 @@ grpc_cc_library( "absl/memory", "absl/status", "absl/strings", + "absl/strings:cord", "absl/strings:str_format", + "absl/types:optional", + "absl/types:span", + "absl/types:variant", + "absl/utility", ], language = "c++", visibility = ["@grpc:grpclb"], deps = [ + "arena", + "bitset", + "chunked_vector", + "debug_location", "gpr_base", "grpc_base", + "grpc_codegen", "grpc_http_filters", + "grpc_resolver", "grpc_trace", "grpc_transport_chttp2_alpn", "hpack_constants", "hpack_encoder_table", "httpcli", + "iomgr_fwd", "memory_quota", + "orphanable", "pid_controller", + "ref_counted", + "ref_counted_ptr", + "resource_quota", "resource_quota_trace", "slice", "slice_refcount", + "time", "uri_parser", "useful", ], @@ -4652,16 +4678,28 @@ grpc_cc_library( hdrs = [ "src/core/ext/transport/chttp2/client/chttp2_connector.h", ], + external_deps = [ + "absl/status", + "absl/status:statusor", + ], language = "c++", deps = [ + "channel_args_preconditioning", + "channel_stack_type", "config", + "debug_location", "gpr_base", "grpc_base", "grpc_client_channel", + "grpc_codegen", "grpc_insecure_credentials", "grpc_resolver", "grpc_security_base", + "grpc_trace", "grpc_transport_chttp2", + "handshaker_registry", + "orphanable", + "resolved_address", "slice", "sockaddr_utils", "uri_parser", @@ -4677,25 +4715,39 @@ grpc_cc_library( "src/core/ext/transport/chttp2/server/chttp2_server.h", ], external_deps = [ + "absl/base:core_headers", + "absl/memory", + "absl/status", + "absl/status:statusor", "absl/strings", "absl/strings:str_format", ], language = "c++", deps = [ "config", + "debug_location", "gpr_base", "grpc_base", "grpc_codegen", "grpc_http_filters", "grpc_insecure_credentials", + "grpc_resolver", "grpc_security_base", + "grpc_trace", "grpc_transport_chttp2", + "handshaker_registry", + "iomgr_fwd", "memory_quota", + "orphanable", "ref_counted", "ref_counted_ptr", + "resolved_address", + "resource_quota", "slice", "sockaddr_utils", + "time", "uri_parser", + "useful", ], ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d41f09ad01..496750e8306 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2309,6 +2309,7 @@ target_link_libraries(grpc absl::bind_front absl::hash absl::statusor + absl::span absl::variant absl::utility gpr @@ -2852,6 +2853,7 @@ target_link_libraries(grpc_unsecure absl::bind_front absl::hash absl::statusor + absl::span absl::variant absl::utility gpr @@ -19143,7 +19145,7 @@ generate_pkgconfig( "gRPC" "high performance general RPC framework" "${gRPC_CORE_VERSION}" - "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" + "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" "" "grpc.pc") @@ -19153,7 +19155,7 @@ generate_pkgconfig( "gRPC unsecure" "high performance general RPC framework without SSL" "${gRPC_CORE_VERSION}" - "gpr absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" + "gpr absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" "-lgrpc_unsecure" "" "grpc_unsecure.pc") @@ -19163,7 +19165,7 @@ generate_pkgconfig( "gRPC++" "C++ wrapper for gRPC" "${gRPC_CPP_VERSION}" - "grpc absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" + "grpc absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" "-lgrpc++" "" "grpc++.pc") @@ -19173,7 +19175,7 @@ generate_pkgconfig( "gRPC++ unsecure" "C++ wrapper for gRPC without SSL" "${gRPC_CPP_VERSION}" - "grpc_unsecure absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" + "grpc_unsecure absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant" "-lgrpc++_unsecure" "" "grpc++_unsecure.pc") diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 4a97b1e6a8f..248b1695933 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -779,6 +779,7 @@ libs: - src/core/lib/iomgr/internal_errqueue.h - src/core/lib/iomgr/iocp_windows.h - src/core/lib/iomgr/iomgr.h + - src/core/lib/iomgr/iomgr_fwd.h - src/core/lib/iomgr/iomgr_internal.h - src/core/lib/iomgr/load_file.h - src/core/lib/iomgr/lockfree_event.h @@ -1646,6 +1647,7 @@ libs: - absl/functional:bind_front - absl/hash:hash - absl/status:statusor + - absl/types:span - absl/types:variant - absl/utility:utility - gpr @@ -1960,6 +1962,7 @@ libs: - src/core/lib/iomgr/internal_errqueue.h - src/core/lib/iomgr/iocp_windows.h - src/core/lib/iomgr/iomgr.h + - src/core/lib/iomgr/iomgr_fwd.h - src/core/lib/iomgr/iomgr_internal.h - src/core/lib/iomgr/load_file.h - src/core/lib/iomgr/lockfree_event.h @@ -2417,6 +2420,7 @@ libs: - absl/functional:bind_front - absl/hash:hash - absl/status:statusor + - absl/types:span - absl/types:variant - absl/utility:utility - gpr diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 2a360e77ac5..c94ab54f97a 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -211,6 +211,7 @@ Pod::Spec.new do |s| ss.dependency 'abseil/synchronization/synchronization', abseil_version ss.dependency 'abseil/time/time', abseil_version ss.dependency 'abseil/types/optional', abseil_version + ss.dependency 'abseil/types/span', abseil_version ss.dependency 'abseil/types/variant', abseil_version ss.dependency 'abseil/utility/utility', abseil_version @@ -745,6 +746,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/internal_errqueue.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_fwd.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.h', @@ -1559,6 +1561,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/internal_errqueue.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_fwd.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index ce1e4d8b06d..9f350953828 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -187,6 +187,7 @@ Pod::Spec.new do |s| ss.dependency 'abseil/synchronization/synchronization', abseil_version ss.dependency 'abseil/time/time', abseil_version ss.dependency 'abseil/types/optional', abseil_version + ss.dependency 'abseil/types/span', abseil_version ss.dependency 'abseil/types/variant', abseil_version ss.dependency 'abseil/utility/utility', abseil_version ss.compiler_flags = '-DBORINGSSL_PREFIX=GRPC -Wno-unreachable-code -Wno-shorten-64-to-32' @@ -1199,6 +1200,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.cc', 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_fwd.h', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -2163,6 +2165,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/internal_errqueue.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_fwd.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/lockfree_event.h', diff --git a/grpc.gemspec b/grpc.gemspec index 652b1f75440..07d91ce716c 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1116,6 +1116,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/iocp_windows.h ) s.files += %w( src/core/lib/iomgr/iomgr.cc ) s.files += %w( src/core/lib/iomgr/iomgr.h ) + s.files += %w( src/core/lib/iomgr/iomgr_fwd.h ) s.files += %w( src/core/lib/iomgr/iomgr_internal.cc ) s.files += %w( src/core/lib/iomgr/iomgr_internal.h ) s.files += %w( src/core/lib/iomgr/iomgr_posix.cc ) diff --git a/grpc.gyp b/grpc.gyp index fc3dbb6a7b7..7e6ae7a93f6 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -365,6 +365,7 @@ 'absl/functional:bind_front', 'absl/hash:hash', 'absl/status:statusor', + 'absl/types:span', 'absl/types:variant', 'absl/utility:utility', 'gpr', @@ -1115,6 +1116,7 @@ 'absl/functional:bind_front', 'absl/hash:hash', 'absl/status:statusor', + 'absl/types:span', 'absl/types:variant', 'absl/utility:utility', 'gpr', diff --git a/package.xml b/package.xml index 3cca426b544..abf2ca44fca 100644 --- a/package.xml +++ b/package.xml @@ -1098,6 +1098,7 @@ + diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc index cf1d320e2fb..8e624be32b8 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc @@ -20,42 +20,58 @@ #include "src/core/ext/transport/chttp2/client/chttp2_connector.h" -#include +#include + +#include + +#include "absl/status/status.h" +#include "absl/status/statusor.h" #include #include -#include +#include +#include +#include #include -#include +#include +#include #include "src/core/ext/filters/client_channel/client_channel.h" +#include "src/core/ext/filters/client_channel/client_channel_factory.h" #include "src/core/ext/filters/client_channel/connector.h" +#include "src/core/ext/filters/client_channel/subchannel.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" -#include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/channel_args_preconditioning.h" +#include "src/core/lib/channel/channel_stack_builder.h" +#include "src/core/lib/channel/channelz.h" #include "src/core/lib/channel/handshaker.h" +#include "src/core/lib/channel/handshaker_registry.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/iomgr/resolved_address.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/resolver/resolver_registry.h" -#include "src/core/lib/resource_quota/api.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/insecure/insecure_credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/channel.h" +#include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/transport.h" -#include "src/core/lib/uri/uri_parser.h" #ifdef GPR_SUPPORT_CHANNELS_FROM_FD #include +#include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/tcp_client_posix.h" -#include "src/core/lib/iomgr/tcp_posix.h" #endif // GPR_SUPPORT_CHANNELS_FROM_FD diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.h b/src/core/ext/transport/chttp2/client/chttp2_connector.h index 59db078f3b7..3c6f4b58546 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.h +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.h @@ -21,9 +21,17 @@ #include +#include "absl/types/optional.h" + #include "src/core/ext/filters/client_channel/connector.h" #include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker_registry.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/timer.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 058777376b9..e6414b6fafd 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -24,11 +24,20 @@ #include #include +#include +#include +#include +#include +#include #include -#include "absl/strings/match.h" +#include "absl/base/thread_annotations.h" +#include "absl/memory/memory.h" +#include "absl/status/status.h" +#include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" #include "absl/strings/strip.h" #include @@ -36,38 +45,52 @@ #include #include #include -#include +#include -#include "src/core/ext/filters/http/server/http_server_filter.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/channel_stack_builder.h" +#include "src/core/lib/channel/channelz.h" #include "src/core/lib/channel/handshaker.h" +#include "src/core/lib/channel/handshaker_registry.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gpr/useful.h" +#include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" +#include "src/core/lib/iomgr/pollset.h" +#include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/resolve_address.h" +#include "src/core/lib/iomgr/resolved_address.h" #include "src/core/lib/iomgr/tcp_server.h" +#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/resource_quota/api.h" #include "src/core/lib/resource_quota/memory_quota.h" -#include "src/core/lib/security/context/security_context.h" +#include "src/core/lib/resource_quota/resource_quota.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/insecure/insecure_credentials.h" +#include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/server.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/lib/transport/transport.h" #include "src/core/lib/uri/uri_parser.h" #ifdef GPR_SUPPORT_CHANNELS_FROM_FD - +#include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/tcp_posix.h" -#include "src/core/lib/surface/completion_queue.h" - #endif // GPR_SUPPORT_CHANNELS_FROM_FD namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.h b/src/core/ext/transport/chttp2/server/chttp2_server.h index e4e6b7cc978..84cf8bb55c6 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.h +++ b/src/core/ext/transport/chttp2/server/chttp2_server.h @@ -21,6 +21,8 @@ #include +#include + #include #include "src/core/lib/iomgr/error.h" diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.cc b/src/core/ext/transport/chttp2/transport/bin_decoder.cc index 4be4cc2579b..5246d79f1dc 100644 --- a/src/core/ext/transport/chttp2/transport/bin_decoder.cc +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.cc @@ -20,12 +20,12 @@ #include "src/core/ext/transport/chttp2/transport/bin_decoder.h" +#include "absl/base/attributes.h" + #include #include -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/lib/slice/slice_refcount.h" static uint8_t decode_table[] = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h index a2d614207f9..603d53d2522 100644 --- a/src/core/ext/transport/chttp2/transport/bin_decoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h @@ -22,6 +22,8 @@ #include #include +#include +#include #include diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.cc b/src/core/ext/transport/chttp2/transport/bin_encoder.cc index cd92f726aa4..eacf9ab9635 100644 --- a/src/core/ext/transport/chttp2/transport/bin_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/bin_encoder.cc @@ -20,6 +20,7 @@ #include "src/core/ext/transport/chttp2/transport/bin_encoder.h" +#include #include #include diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 85d0be42322..36f5153f819 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -20,43 +20,79 @@ #include #include -#include #include +#include #include +#include +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/status/status.h" +#include "absl/strings/cord.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include #include #include #include +#include #include -#include #include "src/core/ext/transport/chttp2/transport/context_list.h" +#include "src/core/ext/transport/chttp2/transport/flow_control.h" +#include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/frame_data.h" +#include "src/core/ext/transport/chttp2/transport/frame_goaway.h" +#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h" +#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" +#include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/stream_map.h" #include "src/core/ext/transport/chttp2/transport/varint.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/debug/stats.h" -#include "src/core/lib/gpr/env.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gpr/useful.h" +#include "src/core/lib/gprpp/bitset.h" +#include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/global_config_env.h" +#include "src/core/lib/gprpp/global_config_generic.h" +#include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/time.h" #include "src/core/lib/http/parser.h" -#include "src/core/lib/iomgr/executor.h" -#include "src/core/lib/iomgr/iomgr.h" +#include "src/core/lib/iomgr/combiner.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" +#include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/profiling/timers.h" #include "src/core/lib/resource_quota/api.h" +#include "src/core/lib/resource_quota/arena.h" +#include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/lib/resource_quota/resource_quota.h" #include "src/core/lib/resource_quota/trace.h" +#include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/lib/slice/slice_refcount.h" +#include "src/core/lib/transport/bdp_estimator.h" +#include "src/core/lib/transport/byte_stream.h" +#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/http2_errors.h" +#include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/status_conversion.h" -#include "src/core/lib/transport/timeout_encoding.h" #include "src/core/lib/transport/transport.h" #include "src/core/lib/transport/transport_impl.h" -#include "src/core/lib/uri/uri_parser.h" GPR_GLOBAL_CONFIG_DEFINE_BOOL( grpc_experimental_disable_flow_control, false, diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h index aab837e484e..193908292a0 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h @@ -21,8 +21,13 @@ #include +#include +#include + #include "src/core/lib/channel/channelz.h" #include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/transport/transport.h" diff --git a/src/core/ext/transport/chttp2/transport/context_list.cc b/src/core/ext/transport/chttp2/transport/context_list.cc index 70e3774699d..d714c34c93e 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.cc +++ b/src/core/ext/transport/chttp2/transport/context_list.cc @@ -20,6 +20,10 @@ #include "src/core/ext/transport/chttp2/transport/context_list.h" +#include + +#include "src/core/ext/transport/chttp2/transport/internal.h" + namespace { void (*write_timestamps_callback_g)(void*, grpc_core::Timestamps*, grpc_error_handle error) = nullptr; diff --git a/src/core/ext/transport/chttp2/transport/context_list.h b/src/core/ext/transport/chttp2/transport/context_list.h index f4963d849cb..d4066e6462c 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.h +++ b/src/core/ext/transport/chttp2/transport/context_list.h @@ -21,8 +21,12 @@ #include +#include + +#include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/lib/iomgr/buffer_list.h" +#include "src/core/lib/iomgr/error.h" namespace grpc_core { /** A list of RPC Contexts */ diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index 1ab72ca2d57..54aad55a994 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -22,18 +22,22 @@ #include #include -#include -#include +#include #include #include "absl/strings/str_format.h" +#include #include #include +#include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/lib/gpr/string.h" +#include "src/core/lib/gpr/useful.h" +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/resource_quota/memory_quota.h" grpc_core::TraceFlag grpc_flowctl_trace(false, "flowctl"); diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h index 9bce7c8a947..e44cb878c7b 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.h +++ b/src/core/ext/transport/chttp2/transport/flow_control.h @@ -22,10 +22,16 @@ #include #include +#include + +#include #include "src/core/ext/transport/chttp2/transport/http2_settings.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/bdp_estimator.h" #include "src/core/lib/transport/pid_controller.h" diff --git a/src/core/ext/transport/chttp2/transport/frame_data.cc b/src/core/ext/transport/chttp2/transport/frame_data.cc index 21083278819..b3eb18c1d4b 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.cc +++ b/src/core/ext/transport/chttp2/transport/frame_data.cc @@ -22,15 +22,21 @@ #include +#include "absl/base/attributes.h" #include "absl/strings/str_format.h" -#include +#include #include #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/lib/channel/channelz.h" #include "src/core/lib/gpr/string.h" +#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/lib/slice/slice_refcount.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/transport/transport.h" diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h index 6690e5f3098..61e20973063 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.h +++ b/src/core/ext/transport/chttp2/transport/frame_data.h @@ -23,10 +23,14 @@ #include +#include + #include #include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/byte_stream.h" #include "src/core/lib/transport/transport.h" diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/src/core/ext/transport/chttp2/transport/frame_goaway.cc index eb90e2e980b..1cad58a2a0b 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.cc +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.cc @@ -22,8 +22,11 @@ #include +#include "absl/base/attributes.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" +#include #include #include diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h index 2ceb6202424..96ba6fe6488 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.h +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h @@ -21,10 +21,13 @@ #include +#include + #include #include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/lib/iomgr/error.h" typedef enum { GRPC_CHTTP2_GOAWAY_LSI0, diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc index b87c221dc7a..3c53444963c 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.cc +++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc @@ -22,12 +22,17 @@ #include +#include + #include "absl/strings/str_format.h" #include #include #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/stream_map.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/exec_ctx.h" static bool g_disable_ping_ack = false; diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h index c878cff851b..46ed6bcd757 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.h +++ b/src/core/ext/transport/chttp2/transport/frame_ping.h @@ -21,9 +21,12 @@ #include +#include + #include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/lib/iomgr/error.h" struct grpc_chttp2_ping_parser { uint8_t byte; diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc index d2365d32145..18a7d0e9a30 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc @@ -20,16 +20,20 @@ #include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h" +#include + #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include +#include #include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/internal.h" -#include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/transport/http2_errors.h" +#include "src/core/lib/transport/metadata_batch.h" grpc_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code, grpc_transport_one_way_stats* stats) { diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h index 6581317617e..840e71e3abc 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h @@ -21,9 +21,12 @@ #include +#include + #include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/transport.h" struct grpc_chttp2_rst_stream_parser { diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index eefd6d29c8f..dfbfde9ee7e 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -22,16 +22,25 @@ #include +#include + +#include "absl/base/attributes.h" #include "absl/strings/str_format.h" -#include +#include #include -#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/ext/transport/chttp2/transport/flow_control.h" #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/ext/transport/chttp2/transport/frame_goaway.h" +#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/stream_map.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/transport/http2_errors.h" +#include "src/core/lib/gpr/useful.h" +#include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/iomgr/exec_ctx.h" static uint8_t* fill_header(uint8_t* out, uint32_t length, uint8_t flags) { *out++ = static_cast(length >> 16); diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h index 9ec116b7280..5616a11e005 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.h +++ b/src/core/ext/transport/chttp2/transport/frame_settings.h @@ -21,10 +21,14 @@ #include +#include +#include + #include #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" +#include "src/core/lib/iomgr/error.h" typedef enum { GRPC_CHTTP2_SPS_ID0, diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.cc b/src/core/ext/transport/chttp2/transport/frame_window_update.cc index 9763e8100ca..790c654cb59 100644 --- a/src/core/ext/transport/chttp2/transport/frame_window_update.cc +++ b/src/core/ext/transport/chttp2/transport/frame_window_update.cc @@ -20,13 +20,16 @@ #include "src/core/ext/transport/chttp2/transport/frame_window_update.h" +#include + #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include #include +#include "src/core/ext/transport/chttp2/transport/flow_control.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/lib/gprpp/manual_constructor.h" grpc_slice grpc_chttp2_window_update_create( uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats* stats) { diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h index ea414d7a8d7..05dee14f3fa 100644 --- a/src/core/ext/transport/chttp2/transport/frame_window_update.h +++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h @@ -21,9 +21,12 @@ #include +#include + #include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/transport.h" struct grpc_chttp2_window_update_parser { diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index e88ecac7479..ea2648aea3c 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -20,27 +20,23 @@ #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" -#include -#include - +#include #include +#include -#include "src/core/ext/transport/chttp2/transport/hpack_constants.h" -#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h" +#include "absl/utility/utility.h" -/* This is here for grpc_is_binary_header - * TODO(murgatroid99): Remove this - */ -#include #include -#include +#include #include #include "src/core/ext/transport/chttp2/transport/bin_encoder.h" +#include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/ext/transport/chttp2/transport/hpack_constants.h" +#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h" #include "src/core/ext/transport/chttp2/transport/varint.h" #include "src/core/lib/debug/stats.h" -#include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/surface/validate_metadata.h" #include "src/core/lib/transport/timeout_encoding.h" diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h index f44a33b8255..5f377a46cbf 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h @@ -21,14 +21,29 @@ #include +#include + #include +#include +#include + +#include "absl/strings/match.h" +#include "absl/strings/string_view.h" +#include #include #include +#include #include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h" +#include "src/core/lib/compression/compression_internal.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/timeout_encoding.h" #include "src/core/lib/transport/transport.h" extern grpc_core::TraceFlag grpc_http_trace; diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc index ef31a019244..a5e3fe5805d 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc @@ -16,6 +16,9 @@ #include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h" +#include +#include + #include namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h b/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h index ca8769480ea..246975d16a9 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h @@ -17,6 +17,9 @@ #include +#include +#include + #include "absl/container/inlined_vector.h" #include "src/core/ext/transport/chttp2/transport/hpack_constants.h" diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index cb17759bba5..c0144baaa5d 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -21,24 +21,40 @@ #include "src/core/ext/transport/chttp2/transport/hpack_parser.h" #include +#include #include -#include +#include +#include +#include +#include +#include + +#include "absl/base/attributes.h" +#include "absl/strings/match.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "absl/types/span.h" +#include "absl/types/variant.h" -#include +#include #include -#include "src/core/ext/transport/chttp2/transport/bin_encoder.h" +#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h" +#include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/lib/debug/stats.h" -#include "src/core/lib/gpr/string.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/profiling/timers.h" -#include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/slice/slice_string_helpers.h" -#include "src/core/lib/surface/validate_metadata.h" +#include "src/core/lib/slice/slice.h" +#include "src/core/lib/slice/slice_refcount_base.h" #include "src/core/lib/transport/http2_errors.h" +#include "src/core/lib/transport/parsed_metadata.h" +#include "src/core/lib/transport/transport.h" #if __cplusplus > 201103L #define GRPC_HPACK_CONSTEXPR_FN constexpr diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h index 2e520210147..1903a5df942 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h @@ -22,9 +22,15 @@ #include #include +#include + +#include + +#include #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/metadata_batch.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc b/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc index 261c7bd1b8c..7f73905e184 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc @@ -16,24 +16,27 @@ * */ +// IWYU pragma: no_include + #include #include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" -#include +#include + +#include #include #include +#include #include "absl/strings/str_format.h" +#include "absl/strings/string_view.h" -#include #include #include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/murmur_hash.h" -#include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/surface/validate_metadata.h" +#include "src/core/lib/slice/slice.h" extern grpc_core::TraceFlag grpc_http_trace; diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h index 532ec79417e..3a6146100bb 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h @@ -21,12 +21,17 @@ #include +#include + +#include + #include #include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/parsed_metadata.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 76221e02f6c..ffb7738c17b 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -23,6 +23,16 @@ #include #include +#include +#include + +#include + +#include "absl/strings/string_view.h" + +#include +#include +#include #include "src/core/ext/transport/chttp2/transport/flow_control.h" #include "src/core/ext/transport/chttp2/transport/frame.h" @@ -34,16 +44,28 @@ #include "src/core/ext/transport/chttp2/transport/frame_window_update.h" #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/hpack_parser.h" +#include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/ext/transport/chttp2/transport/stream_map.h" #include "src/core/lib/channel/channelz.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/bitset.h" +#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/timer.h" +#include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/lib/transport/byte_stream.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/transport.h" #include "src/core/lib/transport/transport_impl.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index 7cac0850834..867803a3b86 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -18,21 +18,42 @@ #include +#include #include +#include + +#include "absl/base/attributes.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include +#include #include +#include "src/core/ext/transport/chttp2/transport/flow_control.h" +#include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/ext/transport/chttp2/transport/frame_data.h" +#include "src/core/ext/transport/chttp2/transport/frame_goaway.h" +#include "src/core/ext/transport/chttp2/transport/frame_ping.h" +#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h" +#include "src/core/ext/transport/chttp2/transport/frame_settings.h" +#include "src/core/ext/transport/chttp2/transport/frame_window_update.h" +#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" +#include "src/core/ext/transport/chttp2/transport/hpack_parser.h" +#include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" +#include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/ext/transport/chttp2/transport/internal.h" -#include "src/core/lib/profiling/timers.h" -#include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/ext/transport/chttp2/transport/stream_map.h" +#include "src/core/lib/channel/channelz.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/transport/bdp_estimator.h" #include "src/core/lib/transport/http2_errors.h" -#include "src/core/lib/transport/status_conversion.h" -#include "src/core/lib/transport/timeout_encoding.h" +#include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/transport.h" using grpc_core::HPackParser; diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc index ef01fee6b5d..aaa73975b5c 100644 --- a/src/core/ext/transport/chttp2/transport/stream_lists.cc +++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc @@ -20,8 +20,12 @@ #include -#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/ext/transport/chttp2/transport/flow_control.h" +#include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/bitset.h" +#include "src/core/lib/gprpp/manual_constructor.h" static const char* stream_list_id_string(grpc_chttp2_stream_list_id id) { switch (id) { diff --git a/src/core/ext/transport/chttp2/transport/stream_map.cc b/src/core/ext/transport/chttp2/transport/stream_map.cc index 647214b94a0..c837f4df3bb 100644 --- a/src/core/ext/transport/chttp2/transport/stream_map.cc +++ b/src/core/ext/transport/chttp2/transport/stream_map.cc @@ -20,7 +20,7 @@ #include "src/core/ext/transport/chttp2/transport/stream_map.h" -#include +#include #include #include diff --git a/src/core/ext/transport/chttp2/transport/stream_map.h b/src/core/ext/transport/chttp2/transport/stream_map.h index 485abd2d130..845fa01dbeb 100644 --- a/src/core/ext/transport/chttp2/transport/stream_map.h +++ b/src/core/ext/transport/chttp2/transport/stream_map.h @@ -22,6 +22,7 @@ #include #include +#include /* Data structure to map a uint32_t to a data object (represented by a void*) diff --git a/src/core/ext/transport/chttp2/transport/varint.h b/src/core/ext/transport/chttp2/transport/varint.h index d4ba48756ad..36bfd444743 100644 --- a/src/core/ext/transport/chttp2/transport/varint.h +++ b/src/core/ext/transport/chttp2/transport/varint.h @@ -21,6 +21,8 @@ #include +#include + /* Helpers for hpack varint encoding */ namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 7a89986bfa7..59de95e44ec 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -18,17 +18,53 @@ #include -#include +#include +#include +#include +#include +#include + +#include "absl/types/optional.h" + +#include +#include #include #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/context_list.h" +#include "src/core/ext/transport/chttp2/transport/flow_control.h" +#include "src/core/ext/transport/chttp2/transport/frame.h" +#include "src/core/ext/transport/chttp2/transport/frame_data.h" +#include "src/core/ext/transport/chttp2/transport/frame_ping.h" +#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h" +#include "src/core/ext/transport/chttp2/transport/frame_settings.h" +#include "src/core/ext/transport/chttp2/transport/frame_window_update.h" +#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" +#include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/ext/transport/chttp2/transport/internal.h" +#include "src/core/ext/transport/chttp2/transport/stream_map.h" +#include "src/core/lib/channel/channelz.h" #include "src/core/lib/debug/stats.h" +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/chunked_vector.h" +#include "src/core/lib/gprpp/debug_location.h" +#include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/time.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/profiling/timers.h" +#include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/lib/transport/bdp_estimator.h" #include "src/core/lib/transport/http2_errors.h" +#include "src/core/lib/transport/metadata_batch.h" +#include "src/core/lib/transport/transport.h" static void add_to_write_list(grpc_chttp2_write_cb** list, grpc_chttp2_write_cb* cb) { @@ -226,7 +262,6 @@ static bool is_default_initial_metadata(grpc_metadata_batch* initial_metadata) { } namespace { -class StreamWriteContext; class WriteContext { public: diff --git a/src/core/lib/channel/handshaker_factory.h b/src/core/lib/channel/handshaker_factory.h index 0d55a6d79ac..bb8c3dfb7a4 100644 --- a/src/core/lib/channel/handshaker_factory.h +++ b/src/core/lib/channel/handshaker_factory.h @@ -23,15 +23,14 @@ #include -// A handshaker factory is used to create handshakers. +#include "src/core/lib/iomgr/iomgr_fwd.h" -// TODO(ctiller): grpc_pollset_set and HandshakeManager are forward declared in -// this file. grpc_pollset_set ought to be eliminated when EventEngine lands IO -// support. At the same time, we ought to be able to include handshake_manager.h -// here and eliminate the HandshakeManager dependency - we cannot right now -// because HandshakeManager names too many iomgr types. +// A handshaker factory is used to create handshakers. -typedef struct grpc_pollset_set grpc_pollset_set; +// TODO(ctiller): HandshakeManager is forward declared in this file. When +// EventEngine lands IO support we ought to be able to include +// handshake_manager.h here and eliminate the HandshakeManager dependency - we +// cannot right now because HandshakeManager names too many iomgr types. namespace grpc_core { diff --git a/src/core/lib/channel/handshaker_registry.h b/src/core/lib/channel/handshaker_registry.h index ccd61412c56..a4bf8a78a04 100644 --- a/src/core/lib/channel/handshaker_registry.h +++ b/src/core/lib/channel/handshaker_registry.h @@ -27,6 +27,7 @@ #include #include "src/core/lib/channel/handshaker_factory.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" namespace grpc_core { diff --git a/src/core/lib/iomgr/iomgr_fwd.h b/src/core/lib/iomgr/iomgr_fwd.h new file mode 100644 index 00000000000..bf6effacdfb --- /dev/null +++ b/src/core/lib/iomgr/iomgr_fwd.h @@ -0,0 +1,25 @@ +// Copyright 2022 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_CORE_LIB_IOMGR_IOMGR_FWD_H +#define GRPC_CORE_LIB_IOMGR_IOMGR_FWD_H + +// A bunch of forward declarations that are useful to higher level things that +// don't want to depend on all of iomgr. + +#include + +typedef struct grpc_pollset_set grpc_pollset_set; + +#endif // GRPC_CORE_LIB_IOMGR_IOMGR_FWD_H diff --git a/src/core/lib/iomgr/pollset_set.h b/src/core/lib/iomgr/pollset_set.h index d3355b8ff8c..8355f8e14bb 100644 --- a/src/core/lib/iomgr/pollset_set.h +++ b/src/core/lib/iomgr/pollset_set.h @@ -21,6 +21,7 @@ #include +#include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/pollset.h" /* A grpc_pollset_set is a set of pollsets that are interested in an @@ -28,8 +29,6 @@ fd's (etc) that have been registered with the set_set to that pollset. Registering fd's automatically adds them to all current pollsets. */ -typedef struct grpc_pollset_set grpc_pollset_set; - typedef struct grpc_pollset_set_vtable { grpc_pollset_set* (*create)(void); void (*destroy)(grpc_pollset_set* pollset_set); diff --git a/src/core/lib/resolver/resolver_factory.h b/src/core/lib/resolver/resolver_factory.h index 091d30ee8ab..877a438a092 100644 --- a/src/core/lib/resolver/resolver_factory.h +++ b/src/core/lib/resolver/resolver_factory.h @@ -25,11 +25,10 @@ #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/resolver/resolver.h" #include "src/core/lib/uri/uri_parser.h" -typedef struct grpc_pollset_set grpc_pollset_set; - namespace grpc_core { // TODO(yashkt): Move WorkSerializer to its own Bazel target, depend on that diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index ba311953b01..691920e0504 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -47,6 +47,7 @@ #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/pollset_set.h" diff --git a/src/core/lib/transport/transport_impl.h b/src/core/lib/transport/transport_impl.h index 6256d1872e1..c183b151c7d 100644 --- a/src/core/lib/transport/transport_impl.h +++ b/src/core/lib/transport/transport_impl.h @@ -27,6 +27,7 @@ #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/promise/arena_promise.h" diff --git a/tools/dockerfile/grpc_iwyu/iwyu.sh b/tools/dockerfile/grpc_iwyu/iwyu.sh index 49492021be3..3d986c9d357 100755 --- a/tools/dockerfile/grpc_iwyu/iwyu.sh +++ b/tools/dockerfile/grpc_iwyu/iwyu.sh @@ -32,6 +32,7 @@ cd ${IWYU_ROOT} cat compile_commands.json | sed "s,\"file\": \",\"file\": \"${IWYU_ROOT}/,g" > compile_commands_for_iwyu.json export ENABLED_MODULES=' + src/core/ext/transport/chttp2 src/core/lib/avl src/core/lib/channel src/core/lib/config diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 172f4c5d656..d890bb30c6d 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2098,6 +2098,7 @@ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iocp_windows.h \ src/core/lib/iomgr/iomgr.cc \ src/core/lib/iomgr/iomgr.h \ +src/core/lib/iomgr/iomgr_fwd.h \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_internal.h \ src/core/lib/iomgr/iomgr_posix.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index e88580d864a..b17484e7919 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1893,6 +1893,7 @@ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iocp_windows.h \ src/core/lib/iomgr/iomgr.cc \ src/core/lib/iomgr/iomgr.h \ +src/core/lib/iomgr/iomgr_fwd.h \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_internal.h \ src/core/lib/iomgr/iomgr_posix.cc \